release

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Arg1Call

func Arg1Call(arg1 string, work func(string) error) cmdFunc

func BashQuote added in v1.0.4

func BashQuote(original string) string

func CheckEnv

func CheckEnv(env string) (string, error)

func Config added in v1.0.1

func Config(envStr string) *config.Config

func Env1Call

func Env1Call(work func(string, string) error) cmdFunc

func Env2Call added in v1.0.2

func Env2Call(work func(string, string, string) error) cmdFunc

func EnvCall

func EnvCall(work func(string) error) cmdFunc

func EnvConfig added in v1.0.1

func EnvConfig(env string) *config.EnvConfig

func EnvData added in v1.0.1

func EnvData(envStr string) strmap.StrMap

func EnvSliceCall

func EnvSliceCall(work func(string, []string) error) cmdFunc

optional env, and optional signle argument slice seperated by "--"

func EnvSlicesCall

func EnvSlicesCall(work func(string, [][]string) error) cmdFunc

optional env, and optional multiple argument slices seperated by "--"

func GetClusters

func GetClusters() map[string]*Cluster

func GoCmd

func GoCmd() string

func GoGetByProxy

func GoGetByProxy(args ...string) error

func HasService

func HasService(env, svcName string) bool

func InProject

func InProject() bool

func IsCurrentUser

func IsCurrentUser(users string) (bool, error)

func ModulePath

func ModulePath() (string, error)

func MultiPorts added in v1.0.6

func MultiPorts(env string, svcNames []string) bool

func Name

func Name(env string) string

func NoArgCall

func NoArgCall(work func() error) cmdFunc

func Root

func Root() string

func ServiceDir added in v1.0.2

func ServiceDir(svcName string) string

func ServiceName

func ServiceName(svcName, env string) string

func ServiceNameRegexp

func ServiceNameRegexp(svcName, env string) string

func ServiceNames

func ServiceNames(env string) (names []string)

func SrcDir added in v1.0.7

func SrcDir() string

func TimeTag

func TimeTag(env string) string

Types

type Cluster

type Cluster struct {
	User  string `yaml:"user"`
	Nodes []Node `yaml:"nodes"`
	// contains filtered or unexported fields
}

func GetCluster

func GetCluster(env string) *Cluster

func (Cluster) GetNodes

func (c Cluster) GetNodes(feature string) (nodes []Node)

func (Cluster) IsLocalHost

func (c Cluster) IsLocalHost() (bool, error)

func (Cluster) List

func (c Cluster) List()

func (Cluster) NodesCount added in v1.0.6

func (c Cluster) NodesCount() int

func (Cluster) Run

func (c Cluster) Run(feature string, o cmd.O, script string) (string, error)

func (Cluster) ServiceRun

func (c Cluster) ServiceRun(svcName, feature string, o cmd.O, script string) (string, error)

type Deploy

type Deploy struct {
	AccessNodes     map[string]string
	Services        map[string]*Service
	VolumesToCreate []string `yaml:"volumesToCreate"`
}

func GetDeploy

func GetDeploy(env string) *Deploy

type Node

type Node struct {

	// addr for ssh and service may be on different network segments.
	Addr        string            `yaml:"addr"`       // addr for ssh
	ServiceAddr string            `yaml:"seviceAddr"` // addr for service, use Addr if empty.
	Labels      map[string]string `yaml:"labels"`
	// contains filtered or unexported fields
}

func (Node) GetServiceAddr

func (n Node) GetServiceAddr() string

func (Node) IsLocalHost

func (n Node) IsLocalHost() (bool, error)

func (Node) IsLocalHostP

func (n Node) IsLocalHostP() bool

func (Node) Match

func (n Node) Match(labels map[string]string) bool

func (Node) Run

func (n Node) Run(o cmd.O, script string) (string, error)

func (Node) Services

func (n Node) Services(env, svcName string) []string

func (Node) SshAddr

func (n Node) SshAddr() string

func (Node) SshCmd

func (n Node) SshCmd() string

type Service

type Service struct {
	Nodes            map[string]string
	Image            string
	Ports            []uint16
	Command, Options []string
	// contains filtered or unexported fields
}

func GetService

func GetService(env, svcName string) *Service

func (Service) FirstContainerName

func (svc Service) FirstContainerName() string

func (Service) ImageName

func (svc Service) ImageName(tag string) string

Jump to

Keyboard shortcuts

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