Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { Run(config *Config) error // 启动 GetAllDockerInfo() (map[string]*DockerInfo, error) }
type Config ¶
type Config struct { DockerTimeout time.Duration // SetTimeout takes a timeout and applies it to the HTTPClient ClientSocket string }
func DefaultConfig ¶
func DefaultConfig() *Config
type ContainerInfo ¶
type ContainerInfo struct { Id string Name string // 为了兼容老的k8s,containerd,没有name Namespace string Container string Pod string Image string // v1.ContainerState State string PodUid string CreatedAt int64 LogPath string Labels map[string]string }
* Containerd // (*v1.Container)(0xc000bb6d20)(&Container{ // Id:f9ffa3100560ed2359d37492b16bdee3f7aa685ad32a8f4e2d29815cce1b0356, // PodSandboxId:52f8f44d07374cfe90875cc576626efbac36acfe08d5dc88c2249121cd5028e8, // Metadata:&ContainerMetadata{Name:svc-edit-worker-rdoc,Attempt:7,}, // Image:&ImageSpec{Image:sha256:6d86e41c4ab4882db6e34ca4ac4ca9bcef5206824ee3a889d5ee49993b054c1b, //Annotations:map[string]string{},}, //ImageRef:sha256:6d86e41c4ab4882db6e34ca4ac4ca9bcef5206824ee3a889d5ee49993b054c1b, //State:CONTAINER_RUNNING, //CreatedAt:1699328747358158398, // Labels:map[string]string{ // io.kubernetes.container.name: svc-edit-worker-rdoc, // io.kubernetes.pod.name: svc-edit-worker-rdoc-7b8fbf46b-jcm6d, // io.kubernetes.pod.namespace: co-pro // io.kubernetes.pod.uid: 2bb5f6b6-7ab7-4f28-be91-27e7b9d298a6, //},Annotations:map[string]string{io.kubernetes.container.hash: 5b912111,io.kubernetes.container.ports: [{"containerPort":9001,"protocol":"TCP"},{"containerPort":9003,"protocol":"TCP"}],io.kubernetes.container.restartCount: 7,io.kubernetes.container.terminationMessagePath: /dev/termination-log,io.kubernetes.container.terminationMessagePolicy: File,io.kubernetes.pod.terminationGracePeriod: 30,},})
type DockerInfo ¶
type DockerInfo struct {
ContainerInfo *ContainerInfo
}
func CreateInfoDetail ¶
func CreateInfoDetail(info *ContainerInfo) *DockerInfo