66 lines
1.7 KiB
Go
66 lines
1.7 KiB
Go
package main
|
|
|
|
const version = "0.28.2"
|
|
|
|
type config struct {
|
|
Listen string
|
|
Token string
|
|
DockerSock string
|
|
AdvertiseIP string
|
|
PublicIPURL string
|
|
Hostname string
|
|
TLS bool
|
|
CertFile string
|
|
KeyFile string
|
|
Fingerprint string
|
|
}
|
|
|
|
type dockerPort struct {
|
|
IP string `json:"IP"`
|
|
PrivatePort uint16 `json:"PrivatePort"`
|
|
PublicPort uint16 `json:"PublicPort"`
|
|
Type string `json:"Type"`
|
|
}
|
|
|
|
type dockerContainer struct {
|
|
ID string `json:"Id"`
|
|
Names []string `json:"Names"`
|
|
Image string `json:"Image"`
|
|
Labels map[string]string `json:"Labels"`
|
|
Ports []dockerPort `json:"Ports"`
|
|
}
|
|
|
|
type binding struct {
|
|
BindIP string `json:"bind_ip"`
|
|
PublicPort uint16 `json:"public_port"`
|
|
}
|
|
|
|
type service struct {
|
|
Key string `json:"key"`
|
|
TechnicalName string `json:"technical_name"`
|
|
ContainerID string `json:"container_id"`
|
|
ContainerName string `json:"container_name"`
|
|
Image string `json:"image"`
|
|
PrivatePort uint16 `json:"private_port"`
|
|
Protocol string `json:"protocol"`
|
|
Bindings []binding `json:"bindings"`
|
|
}
|
|
|
|
type hostAddress struct {
|
|
IP string `json:"ip"`
|
|
Source string `json:"source"`
|
|
Interface string `json:"interface,omitempty"`
|
|
Scope string `json:"scope"`
|
|
}
|
|
|
|
type inventory struct {
|
|
AgentVersion string `json:"agent_version"`
|
|
Hostname string `json:"hostname"`
|
|
PublicIP string `json:"public_ip"`
|
|
PublicIPSource string `json:"public_ip_source"`
|
|
CertificateSHA256 string `json:"certificate_sha256"`
|
|
Addresses []hostAddress `json:"addresses"`
|
|
ObservedAt string `json:"observed_at"`
|
|
Services []service `json:"services"`
|
|
}
|