server

package
v0.0.0-...-40b2247 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGRPCServer

func NewGRPCServer(config *Config, grpcOpts ...grpc.ServerOption) (*grpc.Server, error)

NewGRPCServer instantiates service, create gRPC server, and register service to the server (gives user a server that just needs a listener for it to accept incoming connections) authenticate intercepter added to id the subject of each rpc and init authorization process

Types

type Authorizer

type Authorizer interface {
	Authorize(subject, object, action string) error
}

type CommitLog

type CommitLog interface {
	Append(*api.Record) (uint64, error)
	Read(uint64) (*api.Record, error)
}

CommitLog allows for the service to use any log implementation.

type Config

type Config struct {
	CommitLog   CommitLog
	Authorizer  Authorizer
	GetServerer GetServerer
}

type GetServerer

type GetServerer interface {
	GetServers() ([]*api.Server, error)
}

Jump to

Keyboard shortcuts

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