service

package
v0.0.0-...-4d895cd Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(appName, env string, opts ...Option)

func IsAlive

func IsAlive() bool

func IsReady

func IsReady() bool

func Run

func Run(services ...StartStopper)

func RunWait

func RunWait(services ...StartStopper) *sync.WaitGroup

func SetAlive

func SetAlive(state bool)

func SetInfo

func SetInfo(info map[string]string)

func SetReady

func SetReady(state bool)

func StartDiagnosticsServer

func StartDiagnosticsServer(addr string)

func StartDiagnosticsServerWithConfig

func StartDiagnosticsServerWithConfig(addr string, cfg DiagnosticServerConfig)

func Wait

func Wait(signals []os.Signal) os.Signal

Types

type DiagnosticServerConfig

type DiagnosticServerConfig struct {
	DocsDir             string
	ConfigClientHandler http.HandlerFunc
	StateHandler        http.HandlerFunc
}

type HTTPServer

type HTTPServer struct {
	Server *http.Server
	// contains filtered or unexported fields
}

func NewHTTPServer

func NewHTTPServer(addr string, shutdownTimeout time.Duration, router http.Handler) *HTTPServer

func (*HTTPServer) Start

func (s *HTTPServer) Start()

func (*HTTPServer) Stop

func (s *HTTPServer) Stop()

type LeaderElection

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

func NewLeaderElection

func NewLeaderElection(etcdHosts []string, etcdPrefix string) (*LeaderElection, error)

func (*LeaderElection) Start

func (l *LeaderElection) Start()

func (*LeaderElection) Stop

func (l *LeaderElection) Stop()

type Option

type Option func(*Service)

func WithDiagnosticsServer

func WithDiagnosticsServer(addr string) Option

type Service

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

type StartStopper

type StartStopper interface {
	Start()
	Stop()
}

Jump to

Keyboard shortcuts

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