status

package module
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: MIT Imports: 8 Imported by: 1

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)
}

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 Plugin

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

func (*Plugin) CollectCheckerImpls

func (c *Plugin) CollectCheckerImpls(name endure.Named, r Checker) error

CollectCheckerImpls collects services which can provide Status.

func (*Plugin) CollectReadinessImpls

func (c *Plugin) CollectReadinessImpls(name endure.Named, r Readiness) error

CollectReadinessImpls collects services which can provide Readiness check.

func (*Plugin) Collects

func (c *Plugin) Collects() []any

Collects declares services to be collected.

func (*Plugin) Init

func (c *Plugin) Init(log *zap.Logger, cfg Configurer) 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() error

type Plugins

type Plugins struct {
	Plugins []string `query:"plugin"`
}

type Readiness

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

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

Jump to

Keyboard shortcuts

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