Documentation
¶
Index ¶
- Variables
- func Execute(workerFactory WorkerFactory, accountantFactory AccountantFactory, ...) int
- func RESTConfig() (*rest.Config, error)
- type Accountant
- type AccountantFactory
- type BuildWorkload
- type Command
- type Container
- type DBAccountant
- type FileTracker
- type GardenConnection
- type GardenDialer
- type GardenWorker
- type K8sClient
- type K8sGardenDialer
- type K8sWebPod
- type LANGardenDialer
- type Labels
- type PostgresOpener
- type ResourceWorkload
- type Sample
- type StaticPostgresOpener
- type Stats
- type StatsOption
- type StreamAddr
- type StreamConn
- func (sc *StreamConn) Close() error
- func (sc *StreamConn) LocalAddr() net.Addr
- func (sc *StreamConn) Read(p []byte) (n int, err error)
- func (sc *StreamConn) RemoteAddr() net.Addr
- func (sc *StreamConn) SetDeadline(t time.Time) error
- func (sc *StreamConn) SetReadDeadline(t time.Time) error
- func (sc *StreamConn) SetWriteDeadline(t time.Time) error
- func (sc *StreamConn) Write(p []byte) (n int, err error)
- type TmpfsTracker
- type WebNode
- type WebNodeInferredPostgresOpener
- type Worker
- type WorkerFactory
- type Workload
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAccountantFactory = func(cmd Command) (Accountant, error) { var opener PostgresOpener if cmd.WebK8sNamespace != "" && cmd.WebK8sPod != "" { restConfig, err := RESTConfig() if err != nil { return nil, err } k8sClient := &k8sClient{ RESTConfig: restConfig, Namespace: cmd.WebK8sNamespace, } pod, err := k8sClient.GetPod(cmd.WebK8sPod) if err != nil { return nil, err } opener = &WebNodeInferredPostgresOpener{ WebNode: &K8sWebPod{Pod: pod, Client: k8sClient}, FileTracker: &TmpfsTracker{}, } } else { opener = &StaticPostgresOpener{cmd.Postgres} } return &DBAccountant{Opener: opener}, nil }
View Source
var DefaultValidator = func(cmd Command) error { err := validateFileFlag(cmd.Postgres.CACert.Path()) if err != nil { return err } err = validateFileFlag(cmd.Postgres.ClientCert.Path()) if err != nil { return err } err = validateFileFlag(cmd.Postgres.ClientKey.Path()) if err != nil { return err } return nil }
Functions ¶
func Execute ¶
func Execute( workerFactory WorkerFactory, accountantFactory AccountantFactory, validator func(Command) error, args []string, stdout io.Writer, ) int
func RESTConfig ¶
Types ¶
type Accountant ¶
type AccountantFactory ¶
type AccountantFactory func(Command) (Accountant, error)
type BuildWorkload ¶
type BuildWorkload struct {
// contains filtered or unexported fields
}
func (BuildWorkload) ToString ¶
func (bw BuildWorkload) ToString() string
type DBAccountant ¶
type DBAccountant struct {
Opener PostgresOpener
}
type FileTracker ¶
type GardenConnection ¶
type GardenConnection struct {
Dialer GardenDialer
}
func (GardenConnection) AllMetrics ¶
func (gc GardenConnection) AllMetrics() (map[string]garden.ContainerMetricsEntry, error)
type GardenDialer ¶
type GardenWorker ¶
type GardenWorker struct {
Dialer GardenDialer
}
func (*GardenWorker) Containers ¶
func (gw *GardenWorker) Containers(opts ...StatsOption) ([]Container, error)
type K8sClient ¶
type K8sGardenDialer ¶
type LANGardenDialer ¶
type LANGardenDialer struct{}
type Labels ¶
type Labels struct { Type db.ContainerType Workloads []Workload }
type PostgresOpener ¶
type ResourceWorkload ¶
type ResourceWorkload struct {
// contains filtered or unexported fields
}
func (ResourceWorkload) ToString ¶
func (rw ResourceWorkload) ToString() string
type StaticPostgresOpener ¶
type StaticPostgresOpener struct {
flag.PostgresConfig
}
type StatsOption ¶
type StatsOption func()
type StreamAddr ¶
type StreamAddr struct { }
func (*StreamAddr) Network ¶
func (sa *StreamAddr) Network() string
func (*StreamAddr) String ¶
func (sa *StreamAddr) String() string
type StreamConn ¶
type StreamConn struct {
// contains filtered or unexported fields
}
func (*StreamConn) Close ¶
func (sc *StreamConn) Close() error
func (*StreamConn) LocalAddr ¶
func (sc *StreamConn) LocalAddr() net.Addr
func (*StreamConn) RemoteAddr ¶
func (sc *StreamConn) RemoteAddr() net.Addr
func (*StreamConn) SetDeadline ¶
func (sc *StreamConn) SetDeadline(t time.Time) error
func (*StreamConn) SetReadDeadline ¶
func (sc *StreamConn) SetReadDeadline(t time.Time) error
func (*StreamConn) SetWriteDeadline ¶
func (sc *StreamConn) SetWriteDeadline(t time.Time) error
type TmpfsTracker ¶
type TmpfsTracker struct {
// contains filtered or unexported fields
}
func (*TmpfsTracker) Clear ¶
func (tt *TmpfsTracker) Clear()
func (*TmpfsTracker) Count ¶
func (tt *TmpfsTracker) Count() int
type WebNodeInferredPostgresOpener ¶
type WebNodeInferredPostgresOpener struct { WebNode WebNode FileTracker FileTracker }
func (*WebNodeInferredPostgresOpener) Open ¶
func (wnipo *WebNodeInferredPostgresOpener) Open() (*sql.DB, error)
func (*WebNodeInferredPostgresOpener) PostgresConfig ¶
func (wnipo *WebNodeInferredPostgresOpener) PostgresConfig() (flag.PostgresConfig, error)
type Worker ¶
type Worker interface {
Containers(...StatsOption) ([]Container, error)
}
type WorkerFactory ¶
var DefaultWorkerFactory WorkerFactory = func(cmd Command) (Worker, error) { var dialer GardenDialer if cmd.K8sNamespace != "" && cmd.K8sPod != "" { restConfig, err := RESTConfig() if err != nil { return nil, err } dialer = &K8sGardenDialer{ RESTConfig: restConfig, Namespace: cmd.K8sNamespace, PodName: cmd.K8sPod, } } else { dialer = &LANGardenDialer{} } return &GardenWorker{ Dialer: dialer, }, nil }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.