cmdctrl

package module
v0.0.0-...-62a5e22 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2016 License: Apache-2.0 Imports: 13 Imported by: 3

README

cmdctrl

GoDoc - An interface for command and control...stuff...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CCServer

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

func NewCCServer

func NewCCServer(c CmdCtrl, cfg *ConfigOpts) *CCServer

func (*CCServer) Exit

func (cc *CCServer) Exit(c context.Context, r *pb.EmptyMsg) (*pb.StatusMsg, error)

func (*CCServer) HealthCheck

func (cc *CCServer) HealthCheck(c context.Context, r *pb.EmptyMsg) (*pb.HealthCheckMsg, error)

func (*CCServer) Reload

func (cc *CCServer) Reload(c context.Context, r *pb.EmptyMsg) (*pb.StatusMsg, error)

func (*CCServer) Restart

func (cc *CCServer) Restart(c context.Context, r *pb.EmptyMsg) (*pb.StatusMsg, error)

func (*CCServer) RingUpdate

func (cc *CCServer) RingUpdate(c context.Context, r *pb.Ring) (*pb.RingUpdateResult, error)

func (*CCServer) SelfUpgrade

func (cc *CCServer) SelfUpgrade(c context.Context, r *pb.SelfUpgradeMsg) (*pb.StatusMsg, error)

SelfUpgrade will have the instance upgrade to the provided version via the cmdctrl.GithubUpdater

func (*CCServer) Serve

func (cc *CCServer) Serve() error

func (*CCServer) SoftwareVersion

func (cc *CCServer) SoftwareVersion(c context.Context, r *pb.EmptyMsg) (*pb.SoftwareVersionMsg, error)

SoftwareVersion returns the currently running version

func (*CCServer) Start

func (cc *CCServer) Start(c context.Context, r *pb.EmptyMsg) (*pb.StatusMsg, error)

func (*CCServer) Stats

func (cc *CCServer) Stats(c context.Context, r *pb.EmptyMsg) (*pb.StatsMsg, error)

func (*CCServer) Stop

func (cc *CCServer) Stop(c context.Context, r *pb.EmptyMsg) (*pb.StatusMsg, error)

type CmdCtrl

type CmdCtrl interface {
	Start() (err error)
	Stop() (err error)
	Exit() (err error)
	Reload() (err error)
	Restart() (err error)
	RingUpdate(version int64, ringBytes []byte) (newversion int64)
	SelfUpgrade(version string, bindiff []byte, hash []byte) (status bool, msg string)
	Stats() (encoded []byte)
	HealthCheck() (status bool, msg string)
	SoftwareVersion() (version string)
}

type ConfigOpts

type ConfigOpts struct {
	ListenAddress      string
	CAFile             string
	CertFile           string
	KeyFile            string
	UseTLS             bool
	Enabled            bool
	MutualTLS          bool
	InsecureSkipVerify bool
}

type GithubUpdater

type GithubUpdater struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewGithubUpdater

func NewGithubUpdater(repo, org, binName, target, canaryFile, currentVersion string) *GithubUpdater

func (*GithubUpdater) CanaryCheck

func (g *GithubUpdater) CanaryCheck() error

CanaryCheck check's to see if the canary file exists. If it does not we'll try to roll back.

func (*GithubUpdater) Downgrade

func (g *GithubUpdater) Downgrade(version string) error

Downgrade technically identical to upgrade

func (*GithubUpdater) GetCurrentVersion

func (g *GithubUpdater) GetCurrentVersion() string

GetCurrentVersion returns the current version string

func (*GithubUpdater) RemoveCanary

func (g *GithubUpdater) RemoveCanary() error

RemoveCanary removes the canary file so future instances of the application know the upgrade is broken and the binary should roll back.

func (*GithubUpdater) Upgrade

func (g *GithubUpdater) Upgrade(version string) error

Upgrade to a new version

func (*GithubUpdater) WriteCanary

func (g *GithubUpdater) WriteCanary() error

WriteCanary writes out the canary file so future instances know we're currently running a working instance.

Directories

Path Synopsis
Package cmdctrlsvc is a generated protocol buffer package.
Package cmdctrlsvc is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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