cluster

package
v0.0.0-...-1b5f0b1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2017 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServerInterceptor

func ServerInterceptor() grpc.ServerOption

Types

type Addresses

type Addresses struct {
	Lan string `json:"lan"`
	Wan string `json:"wan"`
}

type Check

type Check struct {
	Node        string `json:"Node"`
	CheckID     string `json:"CheckID"`
	Name        string `json:"Name"`
	Status      string `json:"Status"`
	Notes       string `json:"Notes"`
	Output      string `json:"Output"`
	ServiceID   string `json:"ServiceID"`
	ServiceName string `json:"ServiceName"`
	CreateIndex int    `json:"CreateIndex"`
	ModifyIndex int    `json:"ModifyIndex"`
}

type Client

type Client interface {
	Write(pts []*pb.Point) error
	Read(ksid, tsid string, start, end int64) ([]*pb.Point, gobol.Error)
	Meta(metas []*pb.Meta) error
	Address() string
	Port() int
}

type Cluster

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

func New

func New(
	log *zap.Logger,
	sts *tsstats.StatsTS,
	sto gorilla.Gorilla,
	m meta.MetaData,
	conf *Config,
) (*Cluster, gobol.Error)

func (*Cluster) Classifier

func (c *Cluster) Classifier(ksid []byte) ([]string, gobol.Error)

func (*Cluster) Meta

func (c *Cluster) Meta(nodeID string, metas []*pb.Meta) error

func (*Cluster) MetaClassifier

func (c *Cluster) MetaClassifier(ksid []byte) (string, gobol.Error)

func (*Cluster) Read

func (c *Cluster) Read(ksid, tsid string, start, end int64) ([]*pb.Point, gobol.Error)

func (*Cluster) SelfID

func (c *Cluster) SelfID() string

func (*Cluster) Stop

func (c *Cluster) Stop()

Stop cluster

func (*Cluster) Write

func (c *Cluster) Write(nodes []string, pts []*pb.Point)

type Conf

type Conf struct {
	NodeID string `json:"NodeID"`
}

type Config

type Config struct {
	Consul ConsulConfig
	//gRPC port
	Port int
	//Ticker interval to check cluster changes
	CheckInterval string
	//Time, in seconds, to wait before applying cluster changes to consistency hashing
	ApplyWait int64

	GrpcWriteTimeout    string
	GrpcReadTimeout     string
	GrpcMetaTimeout     string
	GrpcMaxServerConn   int64
	GrpcBurstServerConn int
	MaxListenerConn     int

	LogPath string
}

type Consul

type Consul interface {
	Nodes() ([]Health, gobol.Error)
	Self() (string, gobol.Error)
	Uptime(node string) (int64, error)
}

type ConsulConfig

type ConsulConfig struct {
	//Consul agent adrress without the scheme
	Address string
	//Consul agent port
	Port int
	//Location of consul agent cert file
	Cert string
	//Location of consul agent key file
	Key string
	//Location of consul agent CA file
	CA string
	//Name of the service to be probed on consul
	Service string
	//Tag of the service
	Tag string
	// Token of the service
	Token string
	// Protocol of the service
	Protocol string
}

type GrpcServer

type GrpcServer interface {
	Write(stream pb.Timeseries_WriteServer) error
	Read(q *pb.Query, stream pb.Timeseries_ReadServer) error
	WriteMeta(stream pb.Timeseries_WriteMetaServer) error
	Stop()
}

type Health

type Health struct {
	Node    Node    `json:"Node"`
	Service Service `json:"Service"`
	Checks  []Check `json:"Checks"`
}

type KV

type KV struct {
	Value string `json:"Value"`
}

type Local

type Local struct {
	Config Conf `json:"Config"`
}

type Node

type Node struct {
	ID              string            `json:"ID"`
	Node            string            `json:"Node"`
	Address         string            `json:"Address"`
	TaggedAddresses TagAddr           `json:"TaggedAddresses"`
	Meta            map[string]string `json:"Meta"`
	CreateIndex     int               `json:"CreateIndex"`
	ModifyIndex     int               `json:"ModifyIndex"`
}

type Service

type Service struct {
	ID                string   `json:"ID"`
	Service           string   `json:"Service"`
	Tags              []string `json:"Tags"`
	Address           string   `json:"Address"`
	Port              int      `json:"Port"`
	EnableTagOverride bool     `json:"EnableTagOverride"`
	CreateIndex       int      `json:"CreateIndex"`
	ModifyIndex       int      `json:"ModifyIndex"`
}

type TagAddr

type TagAddr struct {
	Lan string `json:"lan"`
	Wan string `json:"wan"`
}

Jump to

Keyboard shortcuts

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