status

package module
v4.6.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: MIT Imports: 13 Imported by: 2

README

Documentation

Index

Constants

View Source
const (
	// PluginName declares public plugin name.
	PluginName = "status"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	Status() (*status.Status, error)
	Name() string
}

Checker interface used to get latest status from plugin

type Config

type Config struct {
	// Address of the http server
	Address string
	// Status code returned in case of fail, 503 by default
	UnavailableStatusCode int `mapstructure:"unavailable_status_code"`
}

Config is the configuration reference for the Status plugin

func (*Config) InitDefaults

func (c *Config) InitDefaults()

InitDefaults configuration options

type Configurer

type Configurer interface {
	// UnmarshalKey takes a single key and unmarshal it into a Struct.
	UnmarshalKey(name string, out any) error
	// Has checks if config section exists.
	Has(name string) bool
}

type Health added in v4.1.0

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

func NewHealthHandler added in v4.1.0

func NewHealthHandler(sr map[string]Checker, log *zap.Logger, usc int) *Health

func (*Health) ServeHTTP added in v4.1.0

func (rd *Health) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Jobs added in v4.1.0

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

func NewJobsHandler added in v4.1.0

func NewJobsHandler(jc JobsChecker, log *zap.Logger, usc int) *Jobs

func (*Jobs) ServeHTTP added in v4.1.0

func (jb *Jobs) ServeHTTP(w http.ResponseWriter, _ *http.Request)

type JobsChecker added in v4.1.0

type JobsChecker interface {
	JobsState(ctx context.Context) ([]*jobsApi.State, error)
	Name() string
}

type Logger

type Logger interface {
	NamedLogger(name string) *zap.Logger
}

type Plugin

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

func (*Plugin) Collects

func (c *Plugin) Collects() []*dep.In

Collects declares services to be collected.

func (*Plugin) Init

func (c *Plugin) Init(cfg Configurer, log Logger) error

func (*Plugin) Name

func (c *Plugin) Name() string

Name of the service.

func (*Plugin) RPC

func (c *Plugin) RPC() any

RPC returns associated rpc service.

func (*Plugin) Serve

func (c *Plugin) Serve() chan error

func (*Plugin) Stop

func (c *Plugin) Stop(ctx context.Context) error

type Readiness

type Readiness interface {
	Ready() (*status.Status, error)
	Name() string
}

Readiness interface used to get readiness status from the plugin that means, that worker poll inside the plugin has 1+ plugins which are ready to work at the particular moment

type Ready added in v4.1.0

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

func NewReadyHandler added in v4.1.0

func NewReadyHandler(sr map[string]Readiness, log *zap.Logger, usc int) *Ready

func (*Ready) ServeHTTP added in v4.1.0

func (rd *Ready) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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