Documentation ¶
Index ¶
- Variables
- func ContainerResetTime(id string) bool
- func CriticalExit(s string)
- func GetStats(container *dapi.ContainerShort, oldS *OldStats, wg *sync.WaitGroup)
- func HTTPHandlerDockerinfos(w http.ResponseWriter, r *http.Request)
- func HTTPHandlerList(w http.ResponseWriter, r *http.Request)
- func HTTPHandlerProbeinfos(w http.ResponseWriter, r *http.Request)
- func HTTPReq(path string) (int, string)
- func HTTPSecureAPI(r *http.Request, rm *mux.RouteMatch) bool
- func HTTPURILogger(r *http.Request, rm *mux.RouteMatch) bool
- func Init()
- func InitAPIClient()
- func InitConfig(path string)
- func InitLogger(l1, l2, l3 bool) *logo.Logger
- func RefreshContainerList() error
- func RunHTTPServer()
- func SetContainerCPUUsage(id string, size float64) bool
- func SetContainerMemoryUsed(id string, size float64) bool
- func SetContainerNetBandwithRX(id string, size float64) bool
- func SetContainerNetBandwithTX(id string, size float64) bool
- func SetContainerSizeRootFs(id string, size float64) bool
- func SetContainerSizeRw(id string, size float64) bool
- func StatsController()
- func StorageController()
- func TestDockerAPI()
- type Config
- type OldStats
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ContainerList map[string]*dguard.Container DockerDriver string )
List of probe's containers
Functions ¶
func ContainerResetTime ¶
Set the memory used size of a container in the ContainerList
func GetStats ¶
func GetStats(container *dapi.ContainerShort, oldS *OldStats, wg *sync.WaitGroup)
Get container's stats
func HTTPHandlerDockerinfos ¶
func HTTPHandlerDockerinfos(w http.ResponseWriter, r *http.Request)
Handle GET /dockerinfos
func HTTPHandlerList ¶
func HTTPHandlerList(w http.ResponseWriter, r *http.Request)
Handle GET /list
func HTTPHandlerProbeinfos ¶
func HTTPHandlerProbeinfos(w http.ResponseWriter, r *http.Request)
Handle GET /probeinfos
func HTTPURILogger ¶
func HTTPURILogger(r *http.Request, rm *mux.RouteMatch) bool
Log HTTP requests' URI
func SetContainerCPUUsage ¶
Set the cpu usage of a container in the ContainerList
func SetContainerMemoryUsed ¶
Set the memory used size of a container in the ContainerList
func SetContainerNetBandwithRX ¶
Set the net bandwith RX of a container in the ContainerList
func SetContainerNetBandwithTX ¶
Set the net bandwith TX of a container in the ContainerList
func SetContainerSizeRootFs ¶
Set the RootFs size of a container in the ContainerList
func SetContainerSizeRw ¶
Set the Rw size of a container in the ContainerList
Types ¶
type Config ¶
type Config struct { Docker struct { UnixSocketPath string `yaml:"unix-socket-path"` } `yaml:"docker"` DockerGuard struct { ListenInterface string `yaml:"listen-interface"` ListenPort string `yaml:"listen-port"` APIPassword string `yaml:"api-password"` RefreshContainerListInterval int `yaml:"refresh-container-list-interval"` StorageControllerInterval int `yaml:"storage-controller-interval"` StorageControllerPause int `yaml:"storage-controller-pause"` } `yaml:"docker-guard"` }
Program config struct
var ( // Program config DGConfig Config )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.