service

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: Apache-2.0 Imports: 60 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSutureServiceBuilder

func NewSutureServiceBuilder(f func(context.Context, *occfg.Config) error) func(*occfg.Config) suture.Service

NewSutureServiceBuilder creates a new suture service

func Start

func Start(ctx context.Context, o ...Option) error

Start a rpc service. By default, the package scope Start will run all default services to provide with a working OpenCloud instance.

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 WithConfig

func WithConfig(cfg *config.Config) Option

WithConfig sets Controller config.

func WithLogPretty

func WithLogPretty(pretty bool) Option

WithLogPretty sets Controller config.

type Options

type Options struct {
	Log    *Log
	Config *config.Config
}

Options are the configurable options for a Service.

func NewOptions

func NewOptions() *Options

NewOptions returns a new Options struct.

type Service

type Service struct {
	Supervisor *suture.Supervisor
	Services   []serviceFuncMap
	Additional serviceFuncMap
	Log        log.Logger
	// contains filtered or unexported fields
}

Service represents a RPC service.

func NewService

func NewService(ctx context.Context, options ...Option) (*Service, error)

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 OpenCloud services structured log.

func (*Service) List

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

List running processes for the Service Controller.

type SutureService

type SutureService struct {
	// contains filtered or unexported fields
}

SutureService allows for the settings command to be embedded and supervised by a suture supervisor tree.

func (SutureService) Serve

func (s SutureService) Serve(ctx context.Context) error

Serve to fullfil Server interface

Jump to

Keyboard shortcuts

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