cmd

package
v0.0.0-...-f91a3ff Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDebug

func SetDebug()

Types

type AddOptions

type AddOptions struct {
	Cluster string
	Debug   bool
	Masters []string
	Nodes   []string
}

func (*AddOptions) Args

func (ao *AddOptions) Args() []string

type ApplyOptions

type ApplyOptions struct {
	Clusterfile string
	Debug       bool
	ConfigFile  []string
	Env         []string
	Set         []string
	Values      []string
}

func (*ApplyOptions) Args

func (ro *ApplyOptions) Args() []string

type Args

type Args []string

type BuildOptions

type BuildOptions struct {
	AllPlatforms       bool
	Debug              bool
	Authfile           string
	BuildContext       []string
	BuildArg           []string
	CertDir            string
	Creds              string
	Context            string
	DisableCompression bool
	DNS                string
	DNSOption          []string
	DNSSearch          []string
	Env                []string
	File               string
	ForceRm            bool
	Format             string
	From               string
	HTTPProxy          bool
	Ignorefile         string
	Jobs               int
	Label              []string
	Manifest           string
	MaxPullProcs       int
	Platform           string
	Pull               string
	Quiet              bool
	Retry              int
	RetryDelay         string
	Rm                 bool
	SaveImage          bool
	ShmSize            string
	Tag                string
}

func (*BuildOptions) Args

func (bo *BuildOptions) Args() []string

type CRICycle

type CRICycle interface {
	CRIImageList(display bool) ([]byte, error)
	CRIProcessList(display bool) ([]byte, error)
	CRIPodList(display bool) ([]byte, error)
	CRIImagePull(name string) error
}

type CertOptions

type CertOptions struct {
	Cluster string
	Debug   bool
	AltName []string
}

func (*CertOptions) Args

func (co *CertOptions) Args() []string

type ClusterCycle

type ClusterCycle interface {
	Apply(*ApplyOptions) error
	Build(*BuildOptions) error
	Create(*CreateOptions) ([]byte, error)
	Add(*AddOptions) error
	Delete(*DeleteOptions) error
	Run(*RunOptions) error
	Reset(*ResetOptions) error
	Cert(*CertOptions) error
}

type CommandOptions

type CommandOptions interface {
	Args() []string
}

type CreateOptions

type CreateOptions struct {
	Cluster  string
	Platform string
	Debug    bool
	Short    bool
	Image    string
}

func (*CreateOptions) Args

func (co *CreateOptions) Args() []string

type DeleteOptions

type DeleteOptions struct {
	Cluster string
	Force   bool
	Debug   bool
	Masters []string
	Nodes   []string
}

func (*DeleteOptions) Args

func (do *DeleteOptions) Args() []string

type ImageService

type ImageService interface {
	ImagePull(*PullOptions) error
	ImagePush(image string) error
	ImageList() error
	ImageTag(name, newName string) error
	ImageSave(image string, path string, archive string) error
	ImageLoad(path string) error
	ImageMerge(options *MergeOptions) error
	ImageRemove(images ...string) error
	ImageInspect(image string) error
}

type Interface

type Interface interface {
	Exec(cmd string, args ...string) ([]byte, error)
	AsyncExec(cmd string, args ...string) error
	Copy(src string, dst string) error
	CopyR(dst string, src string) error
}

Interface defines the interface for executing commands

func NewRemoteCmd

func NewRemoteCmd(host string, s *v1beta1.SSH) Interface

type LocalCmd

type LocalCmd struct{}

LocalCmd implements the Interface for local command execution using os/exec

func (LocalCmd) AsyncExec

func (c LocalCmd) AsyncExec(cmd string, arg ...string) error

func (LocalCmd) Copy

func (c LocalCmd) Copy(src string, dst string) error

func (LocalCmd) CopyR

func (c LocalCmd) CopyR(dst string, src string) error

func (LocalCmd) Exec

func (c LocalCmd) Exec(cmd string, args ...string) ([]byte, error)

Exec executes the given command on the local machine

type MergeOptions

type MergeOptions struct {
	Quiet        bool
	Tag          []string
	ImageRefs    []string
	AuthFile     string
	AllPlatforms bool
}

func (*MergeOptions) Args

func (mo *MergeOptions) Args() []string

type PullOptions

type PullOptions struct {
	AllTags          bool
	AuthFile         string
	CertDir          string
	Creds            string
	DecryptionKey    []string
	Platform         string
	Policy           string
	Quiet            bool
	RemoveSignatures bool
	Retry            uint
	RetryDelay       time.Duration
	ImageRefs        []string
}

ImagesOptions sealos images pull/push options

func (*PullOptions) Args

func (po *PullOptions) Args() []string

type RemoteCmd

type RemoteCmd struct {
	Host string
	ssh.Interface
}

RemoteCmd implements the Interface for remote command execution using SSH

func (*RemoteCmd) AsyncExec

func (c *RemoteCmd) AsyncExec(cmd string, args ...string) error

func (*RemoteCmd) Copy

func (c *RemoteCmd) Copy(src string, dst string) error

func (*RemoteCmd) CopyR

func (c *RemoteCmd) CopyR(dst string, src string) error

func (*RemoteCmd) Exec

func (c *RemoteCmd) Exec(cmd string, args ...string) ([]byte, error)

Exec executes the given command on the remote machine

type ResetOptions

type ResetOptions struct {
	Cluster string
	Force   bool
	Debug   bool
	Masters []string
	Nodes   []string
	SSH     *v1beta1.SSH
}

func (*ResetOptions) Args

func (ro *ResetOptions) Args() []string

type RunOptions

type RunOptions struct {
	Cluster    string
	Debug      bool
	Cmd        []string
	ConfigFile []string
	Env        []string
	Force      bool
	Masters    []string
	Nodes      []string
	Images     []string
	SSH        *v1beta1.SSH
	Transport  string
}

LifeCycleOptions sealos run/apply/delete/reset/create/add/cert options

func (*RunOptions) Args

func (ro *RunOptions) Args() []string

type SealosCmd

type SealosCmd struct {
	BinPath    string
	CriBinPath string
	Executor   Interface
	ImageService
	ClusterCycle
	CRICycle
}

func NewSealosCmd

func NewSealosCmd(binPath string, executor Interface) *SealosCmd

func (*SealosCmd) Add

func (s *SealosCmd) Add(args *AddOptions) error

func (*SealosCmd) Apply

func (s *SealosCmd) Apply(args *ApplyOptions) error

func (*SealosCmd) Build

func (s *SealosCmd) Build(args *BuildOptions) error

func (*SealosCmd) CRIImageList

func (s *SealosCmd) CRIImageList(display bool) ([]byte, error)

func (*SealosCmd) CRIImagePull

func (s *SealosCmd) CRIImagePull(name string) error

func (*SealosCmd) CRIPodList

func (s *SealosCmd) CRIPodList(display bool) ([]byte, error)

func (*SealosCmd) CRIProcessList

func (s *SealosCmd) CRIProcessList(display bool) ([]byte, error)

func (*SealosCmd) Cert

func (s *SealosCmd) Cert(args *CertOptions) error

func (*SealosCmd) Create

func (s *SealosCmd) Create(args *CreateOptions) ([]byte, error)

func (*SealosCmd) Delete

func (s *SealosCmd) Delete(args *DeleteOptions) error

func (*SealosCmd) ImageInspect

func (s *SealosCmd) ImageInspect(image string) error

func (*SealosCmd) ImageList

func (s *SealosCmd) ImageList() error

func (*SealosCmd) ImageLoad

func (s *SealosCmd) ImageLoad(path string) error

func (*SealosCmd) ImageMerge

func (s *SealosCmd) ImageMerge(args *MergeOptions) error

func (*SealosCmd) ImageMultiSave

func (s *SealosCmd) ImageMultiSave(path string, name ...string) error

func (*SealosCmd) ImagePull

func (s *SealosCmd) ImagePull(args *PullOptions) error

func (*SealosCmd) ImagePush

func (s *SealosCmd) ImagePush(image string) error

func (*SealosCmd) ImageRemove

func (s *SealosCmd) ImageRemove(images ...string) error

func (*SealosCmd) ImageSave

func (s *SealosCmd) ImageSave(image string, path string, archive string) error

func (*SealosCmd) ImageTag

func (s *SealosCmd) ImageTag(name, newName string) error

func (*SealosCmd) Reset

func (s *SealosCmd) Reset(args *ResetOptions) error

func (*SealosCmd) Run

func (s *SealosCmd) Run(args *RunOptions) error

func (*SealosCmd) SetCriBinPath

func (s *SealosCmd) SetCriBinPath() error

Jump to

Keyboard shortcuts

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