service

package
v0.0.0-...-7406747 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(o ...Option) error

Start an rpc service.

Types

type Log

type Log struct {
	Pretty bool
}

Log configures a structure logger.

type Option

type Option func(o *Options)

Option represents an option.

func WithLogPretty

func WithLogPretty(pretty bool) Option

WithLogPretty sets Controller config.

type Options

type Options struct {
	Log *Log
}

Options are the configurable options for a Service.

func NewOptions

func NewOptions() *Options

NewOptions returns a new Options struct.

type Service

type Service struct {
	Controller controller.Controller
	Log        zerolog.Logger
	// contains filtered or unexported fields
}

Service represents a RPC service.

func NewService

func NewService(options ...Option) *Service

NewService returns a configured service with a controller and a default logger. When used as a library, flags are not parsed, and in order to avoid introducing a global state with init functions calls are done explicitly to loadFromEnv(). Since this is the public constructor, options need to be added, at the moment only logging options are supported in order to match the running OwnCloud services structured log.

func (*Service) Kill

func (s *Service) Kill(args *string, reply *int) error

Kill a supervised process by subcommand name.

func (*Service) List

func (s *Service) List(args struct{}, reply *string) error

List running processes for the Service Controller.

func (*Service) Start

func (s *Service) Start(args process.ProcEntry, reply *int) error

Start indicates the Service Controller to start a new supervised service as an OS thread.

Jump to

Keyboard shortcuts

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