drone

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 31 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RetryInterval          = 3 * time.Second
	RetryCount             = 5
	DowloadPathPattern     = "/opt/openpitrix/bin/%s"
	DowloadFilePathPattern = "/opt/openpitrix/bin/%s/%s"
	PilotVersionFilePath   = "/opt/openpitrix/conf/pilot-version"
)

Functions

func NewDefaultConfig

func NewDefaultConfig() *pbtypes.DroneConfig

func NewDefaultConfigString

func NewDefaultConfigString() string

func Serve

func Serve(cfg *ConfigManager, confd *ConfdServer)

func WithCmdInfoLogPath

func WithCmdInfoLogPath(path string) func(opt *pbtypes.DroneConfig)

func WithDrondId

func WithDrondId(id string) func(opt *pbtypes.DroneConfig)

func WithListenPort

func WithListenPort(port int) func(opt *pbtypes.DroneConfig)

Types

type CmdStatus

type CmdStatus struct {
	UpTime    time.Time
	SubtaskId string
	Status    string // executing|successfully|failed
	ExitCode  int
	Cmd       string
}

func LoadLastCmdStatus

func LoadLastCmdStatus(filename string) (status *CmdStatus, isEmpty bool, err error)

type ConfdServer

type ConfdServer struct {
	// contains filtered or unexported fields
}

func NewConfdServer

func NewConfdServer(cfgpath string) *ConfdServer

func (*ConfdServer) Err

func (p *ConfdServer) Err() error

func (*ConfdServer) GetBackendClient

func (p *ConfdServer) GetBackendClient() libconfd.BackendClient

func (*ConfdServer) GetConfig

func (p *ConfdServer) GetConfig() *pbtypes.ConfdConfig

func (*ConfdServer) IsRunning

func (p *ConfdServer) IsRunning() bool

func (*ConfdServer) Save

func (p *ConfdServer) Save() error

func (*ConfdServer) SetConfig

func (p *ConfdServer) SetConfig(cfg *pbtypes.ConfdConfig, fnHookKeyAdjuster func(key string) (realKey string)) error

func (*ConfdServer) Start

func (p *ConfdServer) Start(opts ...libconfd.Options) error

func (*ConfdServer) Stop

func (p *ConfdServer) Stop() error

type ConfigManager

type ConfigManager struct {
	// contains filtered or unexported fields
}

func NewConfigManager

func NewConfigManager(path string, cfg *pbtypes.DroneConfig, opts ...Options) *ConfigManager

func (*ConfigManager) Get

func (p *ConfigManager) Get() (cfg *pbtypes.DroneConfig)

func (*ConfigManager) Save

func (p *ConfigManager) Save() error

func (*ConfigManager) Set

func (p *ConfigManager) Set(cfg *pbtypes.DroneConfig) error

type FrontgateController

type FrontgateController struct {
	// contains filtered or unexported fields
}

func NewFrontgateController

func NewFrontgateController() *FrontgateController

func (*FrontgateController) GetConfig

func (p *FrontgateController) GetConfig() (*pbtypes.FrontgateConfig, error)

func (*FrontgateController) ReportSubTaskStatus

func (p *FrontgateController) ReportSubTaskStatus(in *pbtypes.SubTaskStatus) error

func (*FrontgateController) SetConfig

func (p *FrontgateController) SetConfig(cfg *pbtypes.FrontgateConfig) error

type Options

type Options func(opt *pbtypes.DroneConfig)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg *ConfigManager, confd *ConfdServer) *Server

func (*Server) DistributeDrone added in v0.2.3

func (p *Server) DistributeDrone(ctx context.Context, req *pbtypes.DistributeDroneRequest) (*pbtypes.Empty, error)

func (*Server) GetConfdConfig

func (p *Server) GetConfdConfig(ctx context.Context, arg *pbtypes.Empty) (*pbtypes.ConfdConfig, error)

func (*Server) GetDroneConfig

func (p *Server) GetDroneConfig(context.Context, *pbtypes.Empty) (*pbtypes.DroneConfig, error)

func (*Server) GetDroneVersion added in v0.2.1

func (p *Server) GetDroneVersion(context.Context, *pbtypes.DroneEndpoint) (*pbtypes.Version, error)

func (*Server) GetFrontgateConfig

func (p *Server) GetFrontgateConfig(context.Context, *pbtypes.Empty) (*pbtypes.FrontgateConfig, error)

func (*Server) GetFrontgateVersion added in v0.2.1

func (p *Server) GetFrontgateVersion(context.Context, *pbtypes.Empty) (*pbtypes.Version, error)

func (*Server) GetPilotVersion added in v0.2.1

func (p *Server) GetPilotVersion(context.Context, *pbtypes.Empty) (*pbtypes.Version, error)

func (*Server) GetTemplateFiles

func (p *Server) GetTemplateFiles(ctx context.Context, arg *pbtypes.Empty) (*pbtypes.StringList, error)

func (*Server) GetValues

func (p *Server) GetValues(ctx context.Context, arg *pbtypes.StringList) (*pbtypes.StringMap, error)

func (*Server) IsConfdRunning

func (p *Server) IsConfdRunning(ctx context.Context, arg *pbtypes.Empty) (*pbtypes.Bool, error)

func (*Server) PingDrone

func (p *Server) PingDrone(ctx context.Context, arg *pbtypes.Empty) (*pbtypes.Empty, error)

func (*Server) PingFrontgate

func (p *Server) PingFrontgate(ctx context.Context, arg *pbtypes.FrontgateEndpoint) (*pbtypes.Empty, error)

func (*Server) PingMetadataBackend added in v0.2.1

func (p *Server) PingMetadataBackend(context.Context, *pbtypes.FrontgateEndpoint) (*pbtypes.Empty, error)

func (*Server) PingPilot

func (p *Server) PingPilot(ctx context.Context, arg *pbtypes.FrontgateEndpoint) (*pbtypes.Empty, error)

func (*Server) RunCommand

func (p *Server) RunCommand(ctx context.Context, arg *pbtypes.RunCommandOnDroneRequest) (*pbtypes.String, error)

func (*Server) SetConfdConfig

func (p *Server) SetConfdConfig(ctx context.Context, arg *pbtypes.ConfdConfig) (*pbtypes.Empty, error)

func (*Server) SetDroneConfig

func (p *Server) SetDroneConfig(ctx context.Context, cfg *pbtypes.DroneConfig) (*pbtypes.Empty, error)

func (*Server) SetFrontgateConfig

func (p *Server) SetFrontgateConfig(ctx context.Context, cfg *pbtypes.FrontgateConfig) (*pbtypes.Empty, error)

func (*Server) StartConfd

func (p *Server) StartConfd(ctx context.Context, arg *pbtypes.Empty) (*pbtypes.Empty, error)

func (*Server) StopConfd

func (p *Server) StopConfd(ctx context.Context, arg *pbtypes.Empty) (*pbtypes.Empty, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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