container

package
v0.0.0-...-f375033 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: BSD-3-Clause Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTsuruVariablesNotFound = errors.New("could not find wanted envs")
)

Functions

This section is empty.

Types

type Container

type Container struct {
	docker.Container

	TsuruApp      bool
	AppName       string
	ProcessName   string
	ShortHostname string

	Tags     []string
	RawExtra *json.RawMessage
	// contains filtered or unexported fields
}

func (*Container) GetLabelAny

func (c *Container) GetLabelAny(names ...string) (string, bool)

GetLabelAny returns the first label value that exists with given names

func (*Container) HasEnvs

func (c *Container) HasEnvs(requiredEnvs []string) bool

HasEnvs checks if the container has the requiredEnvs variables set

func (*Container) IsIsolated

func (c *Container) IsIsolated() bool

func (*Container) Stats

func (c *Container) Stats() (*docker.Stats, error)

type InfoClient

type InfoClient struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(endpoint string) (*InfoClient, error)

func (*InfoClient) GetAppContainer

func (c *InfoClient) GetAppContainer(containerId string, useCache bool) (*Container, error)

GetAppContainer returns the container with id containerId if that container is an tsuru application. It may use a cache to prevent calling the docker api.

func (*InfoClient) GetClient

func (c *InfoClient) GetClient() *docker.Client

func (*InfoClient) GetContainer

func (c *InfoClient) GetContainer(containerId string, useCache bool, requiredEnvs []string) (*Container, error)

GetContainer returns the container with the provided id if the container has the required environment variable. It may use a cache to prevent calling the docker api.

func (*InfoClient) ListContainers

func (c *InfoClient) ListContainers() ([]docker.APIContainers, error)

Jump to

Keyboard shortcuts

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