server

package
v0.3.0-docs.0...-f96dd80 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package server implements the server initialization for the api.apihttp and balloon tree structure against a storage engine.

Index

Constants

This section is empty.

Variables

View Source
var (
	QedSenderInstancesCount = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "qed_sender_instances_count",
			Help: "Number of sender agents running",
		},
	)
	QedSenderBatchesSentTotal = prometheus.NewCounter(
		prometheus.CounterOpts{
			Name: "qed_sender_batches_sent_total",
			Help: "Number of batches sent by the sender.",
		},
	)
)

Functions

This section is empty.

Types

type Config

type Config struct {
	//Log level
	Log string

	// Unique identifier to allow connections
	APIKey string

	// Unique name for this node. It identifies itself both in raft and
	// gossip clusters. If not set, fallback to hostname.
	NodeID string

	// TLS server bind address/port.
	HTTPAddr string

	// Raft communication bind address/port.
	RaftAddr string

	// Raft management server bind address/port. Useful to join the cluster
	// and get cluster information.
	MgmtAddr string

	// Metrics bind address/port.
	MetricsAddr string

	// List of raft nodes, through which a cluster can be joined
	// (protocol://host:port).
	RaftJoinAddr []string

	// Path to storage directory.
	DBPath string

	// Path to Raft storage directory.
	RaftPath string

	// Gossip management server bind address/port.
	GossipAddr string

	// List of nodes, through which a gossip cluster can be joined (protocol://host:port).
	GossipJoinAddr []string

	// Path to the private key file used to sign snapshots.
	PrivateKeyPath string

	// Enable TLS service
	EnableTLS bool

	// Enable Pprof prifiling server
	EnableProfiling bool

	// Profiling server address/port
	ProfilingAddr string

	// TLS server cerificate
	SSLCertificate string

	// TLS server cerificate key
	SSLCertificateKey string

	// DB WAL TTL
	DbWalTtl time.Duration
}

func DefaultConfig

func DefaultConfig() *Config

type Sender

type Sender struct {
	Interval   time.Duration
	BatchSize  int
	NumSenders int
	TTL        int
	// contains filtered or unexported fields
}

func NewSender

func NewSender(a *gossip.Agent, s sign.Signer, size, ttl, n int) *Sender

func (Sender) RegisterMetrics

func (s Sender) RegisterMetrics(srv *metrics.Server)

func (Sender) Start

func (s Sender) Start(ch chan *protocol.Snapshot)

Start NumSenders concurrent senders and waits for them to finish

func (Sender) Stop

func (s Sender) Stop()

type Server

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

Server encapsulates the data and login to start/stop a QED server

func NewServer

func NewServer(conf *Config) (*Server, error)

NewServer creates a new Server based on the parameters it receives.

func (*Server) RegisterMetrics

func (s *Server) RegisterMetrics(registry metrics.Registry)

func (*Server) Start

func (s *Server) Start() error

Start will start the server in a non-blockable fashion.

func (*Server) Stop

func (s *Server) Stop() error

Stop will close all the channels from the mux servers.

Jump to

Keyboard shortcuts

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