apiserver

package
v11.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServer

type APIServer struct {
	Config
	// contains filtered or unexported fields
}

Server is a combination of the underlying grpc.Server and its RuntimeOpts.

func New

func New(cfg Config) (*APIServer, error)

New creates an instance of API Server

func (*APIServer) Serve

func (s *APIServer) Serve() error

Serve starts accepting incoming connections

func (*APIServer) Stop

func (s *APIServer) Stop()

Stop stops the server and closes all listeners

type Config

type Config struct {
	// HostAddr is the APIServer host address
	HostAddr string
	// Daemon is the terminal daemon service
	Daemon *daemon.Service
	// Log is a component logger
	Log             logrus.FieldLogger
	TshdServerCreds grpc.ServerOption
	// ListeningC propagates the address on which the gRPC server listens. Mostly useful in tests, as
	// the Electron app gets the server port from stdout.
	ListeningC chan<- utils.NetAddr
}

Config is the APIServer configuration

func (*Config) CheckAndSetDefaults

func (c *Config) CheckAndSetDefaults() error

CheckAndSetDefaults checks and sets default config values.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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