server

package
v3.35.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0, Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Copyright 2021 Molecula Corp. All rights reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {

	// Configuration.
	Config *Config

	Handler featurebase.HandlerI
	// contains filtered or unexported fields
}

Command represents the state of the dax server command.

func NewCommand

func NewCommand(stderr io.Writer, opts ...CommandOption) *Command

NewCommand returns a new instance of Command.

func (*Command) Address

func (m *Command) Address() dax.Address

Address returns the advertise address at which the command can be reached.

func (*Command) Close

func (m *Command) Close() error

Close shuts down the server.

func (*Command) Start

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

Start starts the DAX server.

func (*Command) URI

func (m *Command) URI() *fbnet.URI

URI returns the advertise URI at which the command can be reached.

func (*Command) Wait

func (m *Command) Wait() error

Wait waits for the server to be closed or interrupted.

type CommandOption

type CommandOption func(c *Command) error

func OptCommandConfig

func OptCommandConfig(config *Config) CommandOption

func OptCommandServiceManager

func OptCommandServiceManager(svcmgr *dax.ServiceManager) CommandOption

OptCommandServiceManager allows the ability to pass in a ServiceManage that has been initialized outside of the Command. This is useful for testing where we want to control the service manager during a test run.

type ComputerOptions

type ComputerOptions struct {
	Run    bool            `toml:"run"`
	N      int             `toml:"n"`
	Config fbserver.Config `toml:"config"`
}

type Config

type Config struct {
	// Bind is the host:port on which Pilosa will listen.
	Bind string `toml:"bind"`

	// Advertise is the address advertised by the server to other nodes
	// in the cluster. It should be reachable by all other nodes and should
	// route to an interface that Bind is listening on.
	Advertise string `toml:"advertise"`

	// Seed is used to seed the default rand.Source. If Seed is 0 (i.e. not set)
	// the default rand.Source will be seeded using the current time. Note: this
	// is not very useful at the moment because Table.CreateID() uses package
	// crypto/rand which doesn't honor this seed.
	Seed int64 `toml:"seed"`

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

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

	Controller ControllerOptions `toml:"controller"`
	Queryer    QueryerOptions    `toml:"queryer"`
	Computer   ComputerOptions   `toml:"computer"`
}

Config represents the configuration for the command.

func NewConfig

func NewConfig() *Config

NewConfig returns an instance of Config with default options.

func (*Config) MustValidate

func (c *Config) MustValidate()

MustValidate is carried over from server/config.go; it's just a stubbed out no-op for now.

type ControllerOptions added in v3.30.0

type ControllerOptions struct {
	Run    bool              `toml:"run"`
	Config controller.Config `toml:"config"`
}

type QueryerOptions

type QueryerOptions struct {
	Run    bool           `toml:"run"`
	Config queryer.Config `toml:"config"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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