xbspvs

package
v0.0.0-...-70497d9 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ExitCodeDefault = -1 + iota
	ExitCodeSuccess
	ExitCodeFailure
)
View Source
const (
	DefaultGracefulTimeout   = 30 * time.Second
	DefaultHeartbeatInterval = 5 * time.Minute
)

Variables

This section is empty.

Functions

func GetRootContext

func GetRootContext() context.Context

func GetWaitGroup

func GetWaitGroup() *sync.WaitGroup

func WithWaitGroup

func WithWaitGroup(operate Operate, args ...any)

Types

type Daemon

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

func (*Daemon) String

func (daemon *Daemon) String() string

type Operate

type Operate func(args ...any)

type Process

type Process interface {
	Setup() error
	Start(ctx context.Context) error
}

type ServerProcess

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

func (*ServerProcess) SetServer

func (process *ServerProcess) SetServer(server *http.Server)

func (*ServerProcess) Setup

func (process *ServerProcess) Setup() error

func (*ServerProcess) Start

func (process *ServerProcess) Start(ctx context.Context) error

type Supervisor

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

func GetSupervisor

func GetSupervisor(options *SupervisorOptions) *Supervisor

func (*Supervisor) Handle

func (supervisor *Supervisor) Handle(process Process)

func (*Supervisor) RunForever

func (supervisor *Supervisor) RunForever()

type SupervisorOptions

type SupervisorOptions struct {
	GracefulTimeout   *time.Duration
	HeartbeatInterval *time.Duration
}

Jump to

Keyboard shortcuts

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