server

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2019 License: Apache-2.0, Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitServer

func InitServer() error

func InitStore

func InitStore(storeDBPath string) error

func NewInsecureGrpcServer

func NewInsecureGrpcServer(host string, port string) (*grpc.Server, chan error)

Creates a new server with mandatory mutual-TLS authentication

func NewMutualTLSGrpcServer

func NewMutualTLSGrpcServer(host string, port string, certFile string, keyFile string, caCertFile string) (*grpc.Server, chan error)

Creates a new server with mandatory mutual-TLS authentication

func PprintMeta

func PprintMeta(md metadata.MD)

Pretty-print the metadata from a request

func ShutdownServer

func ShutdownServer() error

Types

type Error

type Error struct {
	// Code is the canonical error code for describing the nature of a
	// particular error.
	Code codes.Code
	// Desc explains more details of the error.
	Desc string
}

Error is the structured error returned from the server

func (*Error) Error

func (e *Error) Error() string

type Server

type Server struct{}

func (*Server) CreateItem

func (*Server) GetItem

func (*Server) GetServerInfo

func (s *Server) GetServerInfo(ctx context.Context, in *go_ltp.Empty) (*go_ltp.ServerInfoResponse, error)

Provide some diagnostic information (items stored, etc)

func (*Server) GetType

Return the Type objects for a given item

func (*Server) GetVersion

func (s *Server) GetVersion(ctx context.Context, in *go_ltp.Empty) (*go_ltp.VersionResponse, error)

Return a version string to the user

Jump to

Keyboard shortcuts

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