cli

package
v0.0.71 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FLAG_NAME_CLUSTER            = "cluster"
	FLAG_NAME_SERVICE            = "service"
	FLAG_NAME_SERVICE_GOSSIP     = "gossip"
	FLAG_NAME_SERVICE_GOSSIP_RPC = "gossip_rpc"
)

Variables

View Source
var BuiltVersion = "snapshot"

Functions

func AddClusterFlags

func AddClusterFlags(root *cobra.Command)

func AddServiceFlags added in v0.0.64

func AddServiceFlags(root *cobra.Command, name string)

func JoinConsulPeers added in v0.0.64

func JoinConsulPeers(api *consul.Client, service string, selfAddress string, selfPort int, mesh cluster.Mesh, logger *zap.Logger) error

func Version added in v0.0.64

func Version() string

Version returns the version variable, overriden at build

Types

type Context added in v0.0.64

type Context struct {
	ID          string
	Logger      *zap.Logger
	Discovery   cluster.DiscoveryLayer
	MeshNetConf *network.Configuration
	Services    []*serviceRunConfig
}

func Bootstrap added in v0.0.64

func Bootstrap(cmd *cobra.Command) *Context

func (*Context) AddService added in v0.0.64

func (ctx *Context) AddService(cmd *cobra.Command, name string, f func(id string, logger *zap.Logger, mesh cluster.DiscoveryLayer) Service)

func (*Context) Run added in v0.0.64

func (ctx *Context) Run() error

type HealthReport added in v0.0.65

type HealthReport struct {
	Timestamp    time.Time             `json:"timestamp"`
	GlobalHealth string                `json:"global_health"`
	Services     []ServiceHealthReport `json:"services"`
}

type Service

type Service interface {
	Serve(port int) net.Listener
	Shutdown()
	JoinServiceLayer(string, *zap.Logger, cluster.ServiceConfig, cluster.ServiceConfig, cluster.DiscoveryLayer)
	Health() string
}

type ServiceHealthReport added in v0.0.65

type ServiceHealthReport struct {
	ServiceName string `json:"service_name"`
	Health      string `json:"health"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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