server

package
v0.0.0-...-ebc5b54 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGRPCServer

func NewGRPCServer(options ...grpcOption) *grpc.Server

func WithGRPCServerOptions

func WithGRPCServerOptions(options ...grpc.ServerOption) grpcOption

func WithGRPCTLSConfig

func WithGRPCTLSConfig(tlsConfig *tls.Config) grpcOption

func WithStreamInterceptor

func WithStreamInterceptor(interceptor grpc.StreamServerInterceptor) grpcOption

func WithUnaryInterceptor

func WithUnaryInterceptor(interceptor grpc.UnaryServerInterceptor) grpcOption

Types

type Option

type Option func(*Options)

func WithAddr

func WithAddr(addr string) Option

func WithId

func WithId(id string) Option

func WithPort

func WithPort(port int) Option

func WithPrometheusAddr

func WithPrometheusAddr(addr string) Option

func WithPrometheusPort

func WithPrometheusPort(port int) Option

func WithStoragePath

func WithStoragePath(path string) Option

func WithTLSConfig

func WithTLSConfig(config *tls.Config) Option

type Options

type Options struct {
	Id             string
	Addr           string
	Port           int
	TLSConfig      *tls.Config
	StoragePath    string
	PrometheusAddr string
	PrometheusPort int
}

func (*Options) Apply

func (o *Options) Apply(options ...Option)

Apply calls each option on o in turn

type Server

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

func New

func New(options ...Option) (*Server, error)

func (*Server) Serve

func (s *Server) Serve() error

func (*Server) Stop

func (s *Server) Stop() error

type StorageService

type StorageService struct {
	api.UnimplementedStorageServer
	// contains filtered or unexported fields
}

func NewStorageService

func NewStorageService(store storage.Storage) *StorageService

func (*StorageService) List

func (*StorageService) Read

func (s *StorageService) Read(req *api.ReadRequest, stream api.Storage_ReadServer) error

func (*StorageService) Remove

func (*StorageService) Rename

func (*StorageService) Stat

func (*StorageService) Write

func (s *StorageService) Write(stream api.Storage_WriteServer) error

Jump to

Keyboard shortcuts

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