server

package
v0.0.0-...-be3b37f Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package server implements a metadata server, whose job is exposing a storage.VersionedStore via a TCP connection.

Index

Constants

This section is empty.

Variables

View Source
var ErrPasswordWithoutTLS = errors.New("must use TLS if authorization is required")

Functions

This section is empty.

Types

type Option

type Option func(*options)

func WithAuthHash

func WithAuthHash(value string) Option

func WithBind

func WithBind(bind string) Option

func WithKeyPair

func WithKeyPair(certFile, keyFile string) Option

func WithVersionedStore

func WithVersionedStore(value storage.VersionedStore) Option

type Server

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

func New

func New(opts ...Option) *Server

func (*Server) Listen

func (s *Server) Listen() (addr string, err error)

func (*Server) Serve

func (s *Server) Serve() error

Serve listens and spawns a server goroutine for each incoming connection. The function will return (some time after) shutdown is called.

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown instructs the server to shutdown. This method will return immediately, while the server will have to be considered shut down only when Serve returns.

Jump to

Keyboard shortcuts

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