Documentation ¶
Index ¶
- type CCServer
- func (cc *CCServer) Exit(c context.Context, r *pb.EmptyMsg) (*pb.StatusMsg, error)
- func (cc *CCServer) HealthCheck(c context.Context, r *pb.EmptyMsg) (*pb.HealthCheckMsg, error)
- func (cc *CCServer) Reload(c context.Context, r *pb.EmptyMsg) (*pb.StatusMsg, error)
- func (cc *CCServer) Restart(c context.Context, r *pb.EmptyMsg) (*pb.StatusMsg, error)
- func (cc *CCServer) RingUpdate(c context.Context, r *pb.Ring) (*pb.RingUpdateResult, error)
- func (cc *CCServer) SelfUpgrade(c context.Context, r *pb.SelfUpgradeMsg) (*pb.StatusMsg, error)
- func (cc *CCServer) Serve() error
- func (cc *CCServer) SoftwareVersion(c context.Context, r *pb.EmptyMsg) (*pb.SoftwareVersionMsg, error)
- func (cc *CCServer) Start(c context.Context, r *pb.EmptyMsg) (*pb.StatusMsg, error)
- func (cc *CCServer) Stats(c context.Context, r *pb.EmptyMsg) (*pb.StatsMsg, error)
- func (cc *CCServer) Stop(c context.Context, r *pb.EmptyMsg) (*pb.StatusMsg, error)
- type CmdCtrl
- type ConfigOpts
- type GithubUpdater
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) HealthCheck ¶
func (*CCServer) RingUpdate ¶
func (*CCServer) SelfUpgrade ¶
SelfUpgrade will have the instance upgrade to the provided version via the cmdctrl.GithubUpdater
func (*CCServer) SoftwareVersion ¶
func (cc *CCServer) SoftwareVersion(c context.Context, r *pb.EmptyMsg) (*pb.SoftwareVersionMsg, error)
SoftwareVersion returns the currently running version
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 GithubUpdater ¶
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.
Click to show internal directories.
Click to hide internal directories.