docker

package
v0.0.0-...-0c25fb7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(eventer ContainerEventer, host, version string, httpClient *http.Client, httpHeader map[string]string) (observer.Observer, error)

New for current docker container

func NewService

func NewService(eventer ServiceContainerEventer, host, version string, httpClient *http.Client, httpHeader map[string]string, registerHost bool) (observer.Observer, error)

NewService for current docker container

func ServiceInfo

func ServiceInfo(containerID string, registerHostIP bool, docker *client.Client) (*service.Options, error)

ServiceInfo by container ID

Types

type ContainerEventer

type ContainerEventer interface {
	Event(containerID, action string)
	Error(err error)
}

type ServiceContainerEventer

type ServiceContainerEventer interface {
	ServiceEvent(event string, srv *service.Service)
	ServiceError(err error)
}

ServiceContainerEventer processor

type Stats

type Stats struct {
	CPUUsage    float64 // 0-100
	MemoryUsage uint64  // bytes
	MemoryLimit uint64  // bytes
}

Stats of container usage

func ContainerStats

func ContainerStats(containerID string, docker *client.Client) (*Stats, error)

ContainerStats information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL