cmdlib

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MPL-2.0-no-copyleft-exception Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCServer

type GRPCServer struct {
	Name            string
	Description     string
	DefaultService  config.ServiceAddress
	RegisterService func(*grpc.Server, *handler.H) error
	UseDB           bool
	UseSessions     bool
}

GRPCServer is the server to run

func (*GRPCServer) Make

func (s *GRPCServer) Make(commands []*cli.Command) []*cli.Command

Make makes a command-line server out of the provided parameters

func (*GRPCServer) MakeHandlerFunc added in v0.3.0

func (s *GRPCServer) MakeHandlerFunc(configFile string) (HandlerFunc, error)

MakeHandlerFunc returns a function with a channel to close to stop it, or any error it received while trying to create the server. It accepts a string to get the configuration filename.

type HandlerFunc added in v0.3.0

type HandlerFunc func() (*ServerStatus, error)

HandlerFunc is a function that launches a service

type ServerStatus added in v0.3.0

type ServerStatus struct {
	// Alive is for closing when you want the server to stop.
	Alive chan struct{}
	// Finished is closed when the server has gracefully stopped.
	Finished chan struct{}
	// TracingCloser is the io.Closer that controls tracing.
	TracingCloser io.Closer
}

ServerStatus represents multiple states within the server

Jump to

Keyboard shortcuts

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