utils

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2017 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UUIDLabel      = "io.rancher.container.uuid"
	CattelURLLabel = "io.rancher.container.cattle_url"
	AgentIDLabel   = "io.rancher.container.agent_id"
	TempName       = "work"
	TempPrefix     = "cattle-temp-"
)
View Source
const (
	DefaultVersion    = "1.22"
	DockerRuntime     = "docker"
	ContainerdRuntime = "containerd"
)

Variables

View Source
var ConfigOverride = make(map[string]string)
View Source
var NameRegexCompiler = regexp.MustCompile("^[a-zA-Z0-9][a-zA-Z0-9_.-]+$")
View Source
var (
	SerializeCompute = false
)

Functions

func APIProxyListenPort

func APIProxyListenPort() int

func APIURL

func APIURL(df string) string

func AccessKey

func AccessKey() string

func AddLabel

func AddLabel(config *container.Config, key string, value string)

func AddToEnv

func AddToEnv(config *container.Config, result map[string]string, args ...string)

func AgentIDFilter

func AgentIDFilter(id string, container types.Container) bool

func DefaultValue

func DefaultValue(name string, df string) string

func DoPing

func DoPing() bool

func DockerEnable

func DockerEnable() bool

func DockerHostIP

func DockerHostIP() string

func FindContainer

func FindContainer(client *engineCli.Client, containerSpec v3.Container, byAgent bool) (string, error)

func FindFirst

func FindFirst(containers []types.Container, f func(types.Container) bool) (types.Container, bool)

func FromString

func FromString(rawstring string) map[string]interface{}

func GetContainerSpec

func GetContainerSpec(event *revents.Event) (v3.Container, error)

func GetDeploymentSyncRequest

func GetDeploymentSyncRequest(event *revents.Event) (v3.DeploymentSyncRequest, error)

func GetFieldsIfExist

func GetFieldsIfExist(m map[string]interface{}, fields ...string) (interface{}, bool)

func GetProgress

func GetProgress(request *revents.Event, cli *v3.RancherClient) *progress.Progress

func GetRuntimeClient

func GetRuntimeClient(runtime, version string) *client.Client

func HasKey

func HasKey(m interface{}, key string) bool

func HasLabel

func HasLabel(containerSpec v3.Container) bool

func Home

func Home() string

func HostAPIIP

func HostAPIIP() string

func HostAPIPort

func HostAPIPort() string

func HostProxy

func HostProxy() string

func Hostname

func Hostname() (string, error)

func IDFilter

func IDFilter(id string, container types.Container) bool

func InterfaceToBool

func InterfaceToBool(v interface{}) bool

func InterfaceToString

func InterfaceToString(v interface{}) string

func IsContainerNotFoundError

func IsContainerNotFoundError(e error) bool

func IsNoOp

func IsNoOp(containerSpec v3.Container) bool

func JwtPublicKeyFile

func JwtPublicKeyFile() string

func KeyFile

func KeyFile() string

func Labels

func Labels() map[string]string

func NameFilter

func NameFilter(name string, container types.Container) bool

func RemoveContainer

func RemoveContainer(client *engineCli.Client, containerID string) error

func SearchInList

func SearchInList(slice []string, target string) bool

func SecretKey

func SecretKey() string

func SemverTrunk

func SemverTrunk(version string, vals int) string

func Serialize

func Serialize(f func() error) error

func SetAPIURL

func SetAPIURL(value string)

func SetAccessKey

func SetAccessKey(value string)

func SetSecretKey

func SetSecretKey(value string)

func Stamp

func Stamp() string

func StateDir

func StateDir() string

func StructToMap

func StructToMap(v interface{}) (map[string]interface{}, error)

func ToMapString

func ToMapString(m map[string]interface{}) map[string]string

func URL

func URL() string

func Unmarshalling

func Unmarshalling(data interface{}, v interface{}) error

Types

type ContainerNotFoundError

type ContainerNotFoundError struct {
}

func (ContainerNotFoundError) Error

func (c ContainerNotFoundError) Error() string

Jump to

Keyboard shortcuts

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