health

package
v3.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2019 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectoryReader

func DirectoryReader(dir string)

DirectoryReader loads (and regularly re-loads) health .json files from the specified files into the default health registry.

Types

type HealthReference

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

func (*HealthReference) Name

func (hr *HealthReference) Name(record string) string

func (*HealthReference) String

func (hr *HealthReference) String() string

type HealthTester

type HealthTester interface {
	// Test(record string) bool
	Name(record string) string
	String() string
}

func NewReferenceFromMap

func NewReferenceFromMap(i map[string]interface{}) (HealthTester, error)

type Service

type Service struct {
	Status StatusType
}

func (*Service) UnmarshalJSON

func (srv *Service) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type Status

type Status interface {
	GetStatus(string) StatusType
	Reload() error
	Close() error
}

type StatusFile

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

func NewStatusFile

func NewStatusFile(filename string) *StatusFile

func (*StatusFile) Close

func (s *StatusFile) Close() error

func (*StatusFile) GetStatus

func (s *StatusFile) GetStatus(check string) StatusType

func (*StatusFile) Load

func (s *StatusFile) Load(filename string) error

Load imports the data atomically into the status map. If there's a JSON error the old data is preserved.

func (*StatusFile) Reload

func (s *StatusFile) Reload() error

type StatusFileData

type StatusFileData map[string]*Service

type StatusType

type StatusType uint8
const (
	StatusUnknown StatusType = iota
	StatusUnhealthy
	StatusHealthy
)

func GetStatus

func GetStatus(name string) StatusType

func (StatusType) String

func (st StatusType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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