service

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsService

func IsService(v interface{}) bool

IsService service interface check

Types

type IService

type IService interface {
	Up() error
	Down() error
}

IService interface for services

func AsService

func AsService(v reflect.Value) (IService, bool)

AsService service interface check

type IServiceCtx

type IServiceCtx interface {
	Up(ctx ctx.Context) error
	Down(ctx ctx.Context) error
}

IServiceCtx interface for services with context

func AsServiceCtx

func AsServiceCtx(v reflect.Value) (IServiceCtx, bool)

AsServiceCtx service interface check

type Tree

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

Tree service initialization tree

func New

func New() *Tree

New tree constructor

func (*Tree) Add

func (s *Tree) Add(v interface{}) error

Add - add new service by interface

func (*Tree) Down

func (s *Tree) Down(ctx ctx.Context) (er error)

Down - stop all services

func (*Tree) IsUp

func (s *Tree) IsUp() bool

IsUp - mark that all services have started

func (*Tree) Up

func (s *Tree) Up(ctx ctx.Context) error

Up - start all services

Jump to

Keyboard shortcuts

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