Documentation ¶
Index ¶
- Constants
- Variables
- func Run(ctx context.Context, cli *CLI) error
- type CLI
- type CheckConfig
- type Checker
- type CommandCheckConfig
- type CommandChecker
- type Config
- type Greenlight
- func (g *Greenlight) CheckRediness(ctx context.Context) error
- func (g *Greenlight) CheckStartUp(ctx context.Context) error
- func (g *Greenlight) Run(ctx context.Context) error
- func (g *Greenlight) RunChildCommand(ctx context.Context, wg *sync.WaitGroup, ch chan error)
- func (g *Greenlight) RunRedinessChecks(ctx context.Context, wg *sync.WaitGroup, ch chan error)
- func (g *Greenlight) RunResponder(ctx context.Context, wg *sync.WaitGroup, ch chan error)
- func (g *Greenlight) RunStartUpChecks(ctx context.Context, wg *sync.WaitGroup, ch chan error)
- func (g *Greenlight) Send(s Signal)
- type HTTPCheckConfig
- type HTTPChecker
- type PhaseConfig
- type Responder
- type ResponderConfig
- type Signal
- type State
- type TCPCheckConfig
- type TCPChecker
Constants ¶
View Source
const ( DefaultCheckInterval = 6 * time.Second DefaultCheckTimeout = 5 * time.Second DefaultListenAddr = ":8080" )
Variables ¶
View Source
var (
DefaultHTTPTimeout = 15 * time.Second
)
View Source
var (
DefaultTCPMaxBytes = 32 * 1024
)
View Source
var Version = ""
Functions ¶
Types ¶
type CheckConfig ¶
type CheckConfig struct { Name string `yaml:"name"` Timeout time.Duration `yaml:"timeout"` Command *CommandCheckConfig `yaml:"command"` TCP *TCPCheckConfig `yaml:"tcp"` HTTP *HTTPCheckConfig `yaml:"http"` }
type Checker ¶
func NewChecker ¶ added in v0.0.1
func NewChecker(cfg *CheckConfig) (Checker, error)
type CommandCheckConfig ¶ added in v0.0.1
type CommandCheckConfig struct {
Run string `yaml:"run"`
}
type CommandChecker ¶
type CommandChecker struct {
// contains filtered or unexported fields
}
func NewCommandChecker ¶
func NewCommandChecker(cfg *CheckConfig) (*CommandChecker, error)
func (*CommandChecker) Name ¶ added in v0.0.1
func (c *CommandChecker) Name() string
type Config ¶
type Config struct { Responder *ResponderConfig `yaml:"responder"` StartUp *PhaseConfig `yaml:"startup"` Readiness *PhaseConfig `yaml:"readiness"` }
type Greenlight ¶
type Greenlight struct { Config *Config // contains filtered or unexported fields }
func NewGreenlight ¶
func NewGreenlight(cfg *Config) (*Greenlight, error)
func (*Greenlight) CheckRediness ¶ added in v0.0.1
func (g *Greenlight) CheckRediness(ctx context.Context) error
func (*Greenlight) CheckStartUp ¶
func (g *Greenlight) CheckStartUp(ctx context.Context) error
func (*Greenlight) RunChildCommand ¶ added in v0.0.4
func (*Greenlight) RunRedinessChecks ¶ added in v0.0.1
func (*Greenlight) RunResponder ¶ added in v0.0.4
func (*Greenlight) RunStartUpChecks ¶ added in v0.0.1
func (*Greenlight) Send ¶ added in v0.0.1
func (g *Greenlight) Send(s Signal)
type HTTPCheckConfig ¶ added in v0.0.1
type HTTPChecker ¶ added in v0.0.1
type HTTPChecker struct { URL string Method string Headers map[string]string Body string ExpectCodeFunc func(code int) bool ExpectPattern *regexp.Regexp Timeout time.Duration NoCheckCertificate bool // contains filtered or unexported fields }
func NewHTTPChecker ¶ added in v0.0.1
func NewHTTPChecker(cfg *CheckConfig) (*HTTPChecker, error)
func (*HTTPChecker) Name ¶ added in v0.0.1
func (p *HTTPChecker) Name() string
type PhaseConfig ¶
type PhaseConfig struct { Checks []*CheckConfig `yaml:"checks"` Interval time.Duration `yaml:"interval"` GracePeriod time.Duration `yaml:"grace_period"` }
type Responder ¶ added in v0.0.1
type Responder struct {
// contains filtered or unexported fields
}
func NewResponder ¶ added in v0.0.1
func NewResponder(cfg *ResponderConfig) (*Responder, chan Signal)
type ResponderConfig ¶ added in v0.0.1
type ResponderConfig struct {
Addr string `yaml:"addr"`
}
type TCPCheckConfig ¶ added in v0.0.1
type TCPChecker ¶ added in v0.0.1
type TCPChecker struct { Host string Port string Send string Quit string MaxBytes int ExpectPattern *regexp.Regexp Timeout time.Duration TLS bool NoCheckCertificate bool // contains filtered or unexported fields }
func NewTCPChecker ¶ added in v0.0.1
func NewTCPChecker(cfg *CheckConfig) (*TCPChecker, error)
func (*TCPChecker) Name ¶ added in v0.0.1
func (p *TCPChecker) Name() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.