internal

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateContext

func ActivateContext(val string) error

func BoolFlag

func BoolFlag(args *[]string, flags ...string) bool

func CopyDockerCompose

func CopyDockerCompose(cfg *Config) error

func Execute

func Execute(config *Config, cmd string, args []string) (io.Reader, io.Reader, func(), func() error, error)

Execute executes the command based on the configuration: locally or remotely (ssh).

func StringFlag

func StringFlag(args *[]string, flags ...string) string

Types

type Build added in v0.0.1

type Build struct {
	File          string `yaml:"file,omitempty"`
	Push          bool   `yaml:"push,omitempty"`
	Platforms     string `yaml:"platforms,omitempty"`
	Args          string `yaml:"args,omitempty"`
	ForceRecreate bool   `yaml:"force,omitempty"`
}

type Command

type Command struct {
	Command     []string
	Description string
	MaxArgs     int
	Handler     func(*Config, []string) error
	Subcommands []Command
}

func (*Command) Help

func (c *Command) Help(v []string) string

func (*Command) Is

func (c *Command) Is(v string) bool

type Config

type Config struct {
	Name    string `yaml:"name"`
	Image   string `yaml:"image,omitempty"`
	Context string `yaml:"context,omitempty"`

	Build *Build `yaml:"build,omitempty"`
	SSH   *SSH   `yaml:"ssh,omitempty"`
}

func DockerCompose

func DockerCompose(cfg *Config) *Config

func LoadConfig

func LoadConfig() *Config

func (*Config) Print

func (c *Config) Print() string

func (*Config) Save

func (c *Config) Save() error

type Context

type Context struct {
	ID     string `yaml:"id"`
	Name   string `yaml:"name"`
	Active bool   `yaml:"active,omitempty"`
	SSH    *SSH   `yaml:"ssh,omitempty"`
	Build  *Build `yaml:"build,omitempty"`
}

func ActiveContext

func ActiveContext() *Context

func AllContexts

func AllContexts() ([]*Context, error)

func FindContext

func FindContext(val string) (*Context, error)

func (*Context) Delete

func (c *Context) Delete() error

func (*Context) Save

func (c *Context) Save() error

type SSH

type SSH struct {
	Host       string `yaml:"host"`
	Port       int    `yaml:"port,omitempty"`
	Username   string `yaml:"username"`
	Password   string `yaml:"password,omitempty"`
	PrivateKey string `yaml:"privateKey,omitempty"`
	Passphrase string `yaml:"-"`

	SwarmMode bool `yaml:"swarmMode,omitempty"`
}

func (*SSH) GetHost

func (s *SSH) GetHost() string

Jump to

Keyboard shortcuts

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