model

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DockerProvider     = "docker"
	KubernetesProvider = "kube"
	CloudProvider      = "cloud"

	SidecarPrefixName             = "sidecar-"
	SidecarVpnImageName           = "hckops/alpine-openvpn:latest"
	SidecarVpnPrivilegedImageName = "hckops/alpine-openvpn-privileged:latest"
	SidecarShareImageName         = "busybox"
	SidecarShareDir               = "/hck/share"
)
View Source
const (
	LabelSchemaKind          = "com.hckops.schema.kind"
	LabelTemplateLocal       = "com.hckops.template.local"
	LabelTemplateRemote      = "com.hckops.template.remote" // TODO not used
	LabelTemplateGit         = "com.hckops.template.git"
	LabelTemplateGitUrl      = "com.hckops.template.git.url"
	LabelTemplateGitRevision = "com.hckops.template.git.revision"
	LabelTemplateGitCommit   = "com.hckops.template.git.commit"
	LabelTemplateGitDir      = "com.hckops.template.git.dir"
	LabelTemplateGitName     = "com.hckops.template.git.name"
	LabelTemplateCachePath   = "com.hckops.template.cache.path"
	LabelSidecarMain         = "com.hckops.sidecar.main"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedTemplateInfo

type CachedTemplateInfo struct {
	Path string
}

type CloudOptions

type CloudOptions struct {
	Version  string
	Address  string
	Username string
	Token    string
}

type CommonInfo added in v0.12.0

type CommonInfo struct {
	NetworkVpn *NetworkVpnInfo
	ShareDir   *ShareDirInfo
}

type DockerOptions

type DockerOptions struct {
	NetworkName          string
	IgnoreImagePullError bool
}

type DockerProviderInfo

type DockerProviderInfo struct {
	Network string
	Ip      string
}

type GitTemplateInfo

type GitTemplateInfo struct {
	Url      string
	Revision string
	Commit   string
	Name     string
}

type Image added in v0.10.0

type Image struct {
	Repository string
	Version    string
}

func (*Image) Name added in v0.10.0

func (image *Image) Name() string

func (*Image) ResolveVersion added in v0.10.0

func (image *Image) ResolveVersion() string

type KubeOptions

type KubeOptions struct {
	InCluster  bool
	ConfigPath string
	Namespace  string
}

type KubeProviderInfo

type KubeProviderInfo struct {
	Namespace string
}

type Labels

type Labels map[string]string

func NewSidecarLabels added in v0.11.0

func NewSidecarLabels() Labels

func (Labels) AddDefaultGit

func (l Labels) AddDefaultGit(url, revision, dir string) Labels

func (Labels) AddDefaultLocal

func (l Labels) AddDefaultLocal() Labels

func (Labels) AddGit

func (l Labels) AddGit(path string, commit string) Labels

func (Labels) AddLabel

func (l Labels) AddLabel(key string, value string) Labels

func (Labels) AddLabels

func (l Labels) AddLabels(labels Labels) Labels

func (Labels) AddLocal

func (l Labels) AddLocal(path string) Labels

func (Labels) AddSidecarMain added in v0.11.0

func (l Labels) AddSidecarMain(containerName string) Labels

func (Labels) Exist

func (l Labels) Exist(name string) (string, error)

func (Labels) ToCachedTemplateInfo

func (l Labels) ToCachedTemplateInfo() *CachedTemplateInfo

func (Labels) ToGitTemplateInfo

func (l Labels) ToGitTemplateInfo() *GitTemplateInfo

type NetworkVpnInfo added in v0.12.0

type NetworkVpnInfo struct {
	Name        string
	LocalPath   string
	ConfigValue string
	Privileged  bool
}

type Parameters added in v0.10.0

type Parameters map[string]string

type ShareDirInfo added in v0.12.0

type ShareDirInfo struct {
	LocalPath  string
	RemotePath string
	LockDir    bool
}

type SidecarInfo added in v0.11.0

type SidecarInfo struct {
	Id   string
	Name string
}

type SidecarShareInjectOpts added in v0.12.0

type SidecarShareInjectOpts struct {
	MainContainerName string
	ShareDir          *ShareDirInfo
}

type SidecarShareUploadOpts added in v0.12.0

type SidecarShareUploadOpts struct {
	Namespace string
	PodName   string
	ShareDir  *ShareDirInfo
}

type SidecarVpnInjectOpts added in v0.12.0

type SidecarVpnInjectOpts struct {
	Name       string // containerName for docker and podName for kube
	NetworkVpn *NetworkVpnInfo
}

type StreamOptions added in v0.10.0

type StreamOptions struct {
	In    io.ReadCloser
	Out   io.Writer
	Err   io.Writer
	IsTty bool // tty is false for ssh tunnel or logs
}

func NewStdStreamOpts added in v0.10.0

func NewStdStreamOpts(tty bool) *StreamOptions

Jump to

Keyboard shortcuts

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