server

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterNone   = ""
	ClusterStatic = "static"
	ClusterGossip = "gossip"
)

Cluster types.

View Source
const DefaultDiagnosticsInterval = time.Duration(0)

DefaultDiagnosticsInterval is the default sync frequency diagnostic metrics. A value of 0 disables diagnostics.

Variables

This section is empty.

Functions

func GetHTTPClient added in v0.9.0

func GetHTTPClient(t *tls.Config) *http.Client

func NewStatsClient added in v0.4.0

func NewStatsClient(name string, host string) (pilosa.StatsClient, error)

NewStatsClient creates a stats client from the config

Types

type Command

type Command struct {
	Server *pilosa.Server

	// Configuration.
	Config *Config

	// Gossip transport
	GossipTransport *gossip.Transport

	// Standard input/output
	*pilosa.CmdIO

	// Started will be closed once Command.Run is finished.
	Started chan struct{}
	// Done will be closed when Command.Close() is called
	Done chan struct{}
	// contains filtered or unexported fields
}

Command represents the state of the pilosa server command.

func NewCommand

func NewCommand(stdin io.Reader, stdout, stderr io.Writer) *Command

NewCommand returns a new instance of Main.

func (*Command) Close

func (m *Command) Close() error

Close shuts down the server.

func (*Command) SetupNetworking added in v0.9.0

func (m *Command) SetupNetworking() error

SetupNetworking sets up internode communication based on the configuration.

func (*Command) SetupServer

func (m *Command) SetupServer() error

SetupServer uses the cluster configuration to set up this server.

func (*Command) Start added in v0.9.0

func (m *Command) Start() (err error)

Start starts the pilosa server - it returns once the server is running.

func (*Command) Wait added in v0.9.0

func (m *Command) Wait() error

Wait waits for the server to be closed or interrupted.

type Config added in v0.9.0

type Config struct {
	// DataDir is the directory where Pilosa stores both indexed data and
	// running state such as cluster topology information.
	DataDir string `toml:"data-dir"`
	// Bind is the host:port on which Pilosa will listen.
	Bind string `toml:"bind"`

	// MaxWritesPerRequest limits the number of mutating commands that can be in
	// a single request to the server. This includes SetBit, ClearBit,
	// SetRowAttrs & SetColumnAttrs.
	MaxWritesPerRequest int `toml:"max-writes-per-request"`

	// LogPath configures where Pilosa will write logs.
	LogPath string `toml:"log-path"`

	// Verbose toggles verbose logging which can be useful for debugging.
	Verbose bool `toml:"verbose"`

	// TLS
	TLS TLSConfig

	Cluster struct {
		// Disabled controls whether clustering functionality is enabled.
		Disabled      bool          `toml:"disabled"`
		Coordinator   bool          `toml:"coordinator"`
		ReplicaN      int           `toml:"replicas"`
		Hosts         []string      `toml:"hosts"`
		LongQueryTime toml.Duration `toml:"long-query-time"`
	} `toml:"cluster"`

	// Gossip config is based around memberlist.Config.
	Gossip gossip.Config `toml:"gossip"`

	AntiEntropy struct {
		Interval toml.Duration `toml:"interval"`
	} `toml:"anti-entropy"`

	Metric struct {
		// Service can be statsd, expvar, or none.
		Service string `toml:"service"`
		// Host tells the statsd client where to write.
		Host         string        `toml:"host"`
		PollInterval toml.Duration `toml:"poll-interval"`
		// Diagnostics toggles sending some limited diagnostic information to
		// Pilosa's developers.
		Diagnostics bool `toml:"diagnostics"`
	} `toml:"metric"`
}

Config represents the configuration for the command.

func NewConfig added in v0.9.0

func NewConfig() *Config

NewConfig returns an instance of Config with default options.

type TLSConfig added in v0.9.0

type TLSConfig struct {
	// CertificatePath contains the path to the certificate (.crt or .pem file)
	CertificatePath string `toml:"certificate-path"`
	// CertificateKeyPath contains the path to the certificate key (.key file)
	CertificateKeyPath string `toml:"certificate-key-path"`
	// SkipVerify disables verification for self-signed certificates
	SkipVerify bool `toml:"skip-verify"`
}

TLSConfig contains TLS configuration

Jump to

Keyboard shortcuts

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