server

package
v0.0.0-...-61eb987 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Address for the server to listen on. The format is "host:port". Defaults
	// to ":9900".
	Address string
	// ReadTimeout is the maximum duration for reading the entire request,
	// including the body. Defaults to 5s.
	ReadTimeout time.Duration
	// WriteTimeout is the maximum duration before timing out writes of the
	// response. It is reset whenever a new request's header is read. Defaults
	// to 10s.
	WriteTimeout time.Duration
}

type Option

type Option func(*Server)

func WithLogger

func WithLogger(l loglib.Logger) Option

type Server

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

func New

func New(cfg *Config, store store.Store, opts ...Option) *Server

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) Start

func (s *Server) Start() error

Start will start the subscription server. This call is blocking.

Jump to

Keyboard shortcuts

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