bootstrap

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminConfig

type AdminConfig struct {
	Enabled     bool
	IP          string
	Port        int
	ServiceName string
	EnablePprof bool
}

func NewAdminConfig

func NewAdminConfig(serviceName string, serverType int, enabled, enablePprof bool, ip string, port int) AdminConfig

type AdminServer

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

func StartAdminServer

func StartAdminServer(cfg AdminConfig, state AdminState) (*AdminServer, error)

func (*AdminServer) Shutdown

func (s *AdminServer) Shutdown(ctx context.Context) error

type AdminState

type AdminState struct {
	IsAlive func() bool
	IsReady func() bool
}

type LoggerConfig

type LoggerConfig struct {
	Dir   string
	Level string
	Name  string
}

type Options

type Options struct {
	ServiceName      string
	LoadConfig       func() error
	LoggerConfig     func() LoggerConfig
	AdminConfig      func() AdminConfig
	InitDeps         func() error
	RegisterHandlers func() error
	StartRuntime     func() error
	OnProc           func() bool
	OnTick           func(lastMs, nowMs int64)
	OnExit           func()
}

type ServiceApp

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

func NewServiceApp

func NewServiceApp(opts Options) *ServiceApp

func (*ServiceApp) OnExit

func (a *ServiceApp) OnExit()

func (*ServiceApp) OnInit

func (a *ServiceApp) OnInit() error

func (*ServiceApp) OnProc

func (a *ServiceApp) OnProc() bool

func (*ServiceApp) OnReload

func (a *ServiceApp) OnReload() error

func (*ServiceApp) OnTick

func (a *ServiceApp) OnTick(lastMs, nowMs int64)

Jump to

Keyboard shortcuts

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