server

package
v0.0.0-20200206 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2020 License: Apache-2.0 Imports: 18 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartMetrics

func StartMetrics(addr string, l logger.Logger) *http.Server

StartMetrics listens and servers the HTTP metrics server in a new goroutine. The server is then returned and can be stopped using Close().

Types

type ImmuServer

type ImmuServer struct {
	Store      *store.Store
	Logger     logger.Logger
	Options    Options
	GrpcServer *grpc.Server
	// contains filtered or unexported fields
}

func DefaultServer

func DefaultServer() *ImmuServer

func (*ImmuServer) ByIndex

func (s *ImmuServer) ByIndex(ctx context.Context, index *schema.Index) (*schema.Item, error)

func (*ImmuServer) Consistency

func (s *ImmuServer) Consistency(ctx context.Context, index *schema.Index) (*schema.ConsistencyProof, error)

func (*ImmuServer) Count

func (s *ImmuServer) Count(ctx context.Context, prefix *schema.KeyPrefix) (*schema.ItemsCount, error)

func (*ImmuServer) CurrentRoot

func (s *ImmuServer) CurrentRoot(context.Context, *empty.Empty) (*schema.Root, error)

func (*ImmuServer) Get

func (s *ImmuServer) Get(ctx context.Context, k *schema.Key) (*schema.Item, error)

func (*ImmuServer) GetBatch

func (s *ImmuServer) GetBatch(ctx context.Context, kl *schema.KeyList) (*schema.ItemList, error)

func (*ImmuServer) Health

func (*ImmuServer) History

func (s *ImmuServer) History(ctx context.Context, key *schema.Key) (*schema.ItemList, error)

func (*ImmuServer) Inclusion

func (s *ImmuServer) Inclusion(ctx context.Context, index *schema.Index) (*schema.InclusionProof, error)

func (*ImmuServer) SafeGet

func (s *ImmuServer) SafeGet(ctx context.Context, opts *schema.SafeGetOptions) (*schema.SafeItem, error)

func (*ImmuServer) SafeSet

func (s *ImmuServer) SafeSet(ctx context.Context, opts *schema.SafeSetOptions) (*schema.Proof, error)

func (*ImmuServer) Scan

func (s *ImmuServer) Scan(ctx context.Context, opts *schema.ScanOptions) (*schema.ItemList, error)

func (*ImmuServer) Set

func (s *ImmuServer) Set(ctx context.Context, kv *schema.KeyValue) (*schema.Index, error)

func (*ImmuServer) SetBatch

func (s *ImmuServer) SetBatch(ctx context.Context, kvl *schema.KVList) (*schema.Index, error)

func (*ImmuServer) Start

func (s *ImmuServer) Start() (err error)

func (*ImmuServer) Stop

func (s *ImmuServer) Stop() error

func (*ImmuServer) WithLogger

func (s *ImmuServer) WithLogger(logger logger.Logger) *ImmuServer

func (*ImmuServer) WithOptions

func (s *ImmuServer) WithOptions(options Options) *ImmuServer

func (*ImmuServer) WithStore

func (s *ImmuServer) WithStore(st *store.Store) *ImmuServer

type Options

type Options struct {
	Dir         string
	Network     string
	Address     string
	Port        int
	MetricsPort int
	DbName      string
}

func DefaultOptions

func DefaultOptions() Options

func (Options) Bind

func (o Options) Bind() string

func (Options) FromEnvironment

func (o Options) FromEnvironment() Options

func (Options) MetricsBind

func (o Options) MetricsBind() string

func (Options) String

func (o Options) String() string

func (Options) WithAddress

func (o Options) WithAddress(address string) Options

func (Options) WithDbName

func (o Options) WithDbName(dbName string) Options

func (Options) WithDir

func (o Options) WithDir(dir string) Options

func (Options) WithNetwork

func (o Options) WithNetwork(network string) Options

func (Options) WithPort

func (o Options) WithPort(port int) Options

Jump to

Keyboard shortcuts

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