lich

package
v0.0.0-...-3ecd8c4 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: MIT Imports: 15 Imported by: 0

README

testing/lich 运行环境构建

基于 docker-compose 实现跨平台跨语言环境的容器依赖管理方案,以解决运行ut场景下的 (mysql, redis, mc)容器依赖问题。

使用说明参见:https://github.com/huizluo/kratos/tree/master/tool/testcli/README.md

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup() (err error)

Setup setup UT related environment dependence for everything.

func Teardown

func Teardown() (err error)

Teardown unsetup all environment dependence.

Types

type Container

type Container struct {
	ID      string    `json:"Id"`
	Created time.Time `json:"Created"`
	Path    string    `json:"Path"`
	Args    []string  `json:"Args"`
	State   struct {
		Status     string    `json:"Status"`
		Running    bool      `json:"Running"`
		Paused     bool      `json:"Paused"`
		Restarting bool      `json:"Restarting"`
		OOMKilled  bool      `json:"OOMKilled"`
		Dead       bool      `json:"Dead"`
		Pid        int       `json:"Pid"`
		ExitCode   int       `json:"ExitCode"`
		Error      string    `json:"Error"`
		StartedAt  time.Time `json:"StartedAt"`
		FinishedAt time.Time `json:"FinishedAt"`
		Health     struct {
			Status        string `json:"Status"`
			FailingStreak int    `json:"FailingStreak"`
			Log           []struct {
				Start    time.Time `json:"Start"`
				End      time.Time `json:"End"`
				ExitCode int       `json:"ExitCode"`
				Output   string    `json:"Output"`
			} `json:"Log"`
		} `json:"Health"`
	} `json:"State"`
	Config struct {
		Hostname   string   `json:"Hostname"`
		Domainname string   `json:"Domainname"`
		User       string   `json:"User"`
		Tty        bool     `json:"Tty"`
		OpenStdin  bool     `json:"OpenStdin"`
		StdinOnce  bool     `json:"StdinOnce"`
		Env        []string `json:"Env"`
		Cmd        []string `json:"Cmd"`
		Image      string   `json:"Image"`
		WorkingDir string   `json:"WorkingDir"`
		Entrypoint []string `json:"Entrypoint"`
	} `json:"Config"`
	Image           string `json:"Image"`
	ResolvConfPath  string `json:"ResolvConfPath"`
	HostnamePath    string `json:"HostnamePath"`
	HostsPath       string `json:"HostsPath"`
	LogPath         string `json:"LogPath"`
	Name            string `json:"Name"`
	RestartCount    int    `json:"RestartCount"`
	Driver          string `json:"Driver"`
	Platform        string `json:"Platform"`
	MountLabel      string `json:"MountLabel"`
	ProcessLabel    string `json:"ProcessLabel"`
	AppArmorProfile string `json:"AppArmorProfile"`
	NetworkSettings struct {
		Bridge      string `json:"Bridge"`
		SandboxID   string `json:"SandboxID"`
		HairpinMode bool   `json:"HairpinMode"`
		Ports       map[string][]struct {
			HostIP   string `json:"HostIp"`
			HostPort string `json:"HostPort"`
		} `json:"Ports"`
	} `json:"NetworkSettings"`
}

Container docker inspect resp.

func (*Container) GetID

func (c *Container) GetID() (id string)

GetID get id at container

func (*Container) GetImage

func (c *Container) GetImage() (image string)

GetImage get image name at container

func (*Container) Healthcheck

func (c *Container) Healthcheck() (err error)

Healthcheck check container health.

Jump to

Keyboard shortcuts

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