server

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Components

type Components struct {
	Authenticator pa.Authenticator
	Limiter       pl.Limiter
	Logger        gsl.Log
	Listener      net.Listener
	TLSCertFile   string
	TLSKeyFile    string
}

Components contains the necessary server components.

func (*Components) CopyWithListener

func (components *Components) CopyWithListener(listener net.Listener) Components

CopyWithListener attaches a listner to the associated server and returns a new copy.

type GRPCOptions

type GRPCOptions struct {
	Interceptors []grpc.UnaryServerInterceptor
}

GRPCOptions are gRPC optional server components.

type GRPCServer

type GRPCServer struct {
	Components
	psc.OsirisServer
	Options *GRPCOptions
}

GRPCServer is a gRCP implementation of Server.

func (GRPCServer) CheckStates

func (server GRPCServer) CheckStates(ctx context.Context, in *psc.LimitIDsByKeys) (*psc.StatesByKeysWithRequest, error)

CheckStates implements limiter.CheckStates

func (GRPCServer) FinishRequest

func (server GRPCServer) FinishRequest(ctx context.Context, in *psc.ResourcesWithRequest) (*empty.Empty, error)

FinishRequest implements limiter.FinishRequest

func (GRPCServer) GetLimits

func (server GRPCServer) GetLimits(ctx context.Context, in *psc.LimitIDs) (*psc.Limits, error)

GetLimits implements limiter.GetLimits

func (GRPCServer) GetLimitsAll

func (server GRPCServer) GetLimitsAll(ctx context.Context, in *empty.Empty) (*psc.Limits, error)

GetLimitsAll implements limiter.GetLimitsAll

func (GRPCServer) PeekStates

func (server GRPCServer) PeekStates(ctx context.Context, in *psc.LimitIDsByKeys) (*psc.StatesByKeysWithRequest, error)

PeekStates implements limiter.PeekStates

func (GRPCServer) RemoveLimits

func (server GRPCServer) RemoveLimits(ctx context.Context, in *psc.LimitIDs) (*empty.Empty, error)

RemoveLimits implements limiter.RemoveLimits

func (GRPCServer) RemoveLimitsAll

func (server GRPCServer) RemoveLimitsAll(ctx context.Context, in *empty.Empty) (*empty.Empty, error)

RemoveLimitsAll implements limiter.RemoveLimitsAll

func (*GRPCServer) Serve

func (server *GRPCServer) Serve() error

Serve will run the edge in gRPC mode.

func (GRPCServer) SetLimits

func (server GRPCServer) SetLimits(ctx context.Context, in *psc.Limits) (*emptypb.Empty, error)

SetLimits implements limiter.SetLimits

type HTTPOptions

type HTTPOptions struct {
	Middlewares []func(http.Handler) http.Handler
}

HTTPOptions are gRPC optional server components.

type HTTPServer

type HTTPServer struct {
	Components
	Options *HTTPOptions
}

HTTPServer is an HTTP implementation of Server.

func (HTTPServer) Serve

func (server HTTPServer) Serve() error

Serve will run the edge in HTTP mode.

type MuxServer

type MuxServer struct {
	Port        string
	Components  *Components
	GRPCOptions *GRPCOptions
	HTTPOptions *HTTPOptions
}

MuxServer is a multiplexed implementation of Server.

func (*MuxServer) Serve

func (server *MuxServer) Serve() error

Serve will run the multiplexed TCP port serving both gRPC and HTTP.

Jump to

Keyboard shortcuts

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