pkg: istio.io/pkg/probe Index | Files

package probe

import "istio.io/pkg/probe"

Package probe provides liveness / readiness probe.

Index

Package Files

client.go controller.go option.go probe.go

type Client Uses

type Client interface {
    GetStatus() error
}

Client is the interface to check the status of a probe controller.

func NewFileClient Uses

func NewFileClient(opt *Options) Client

NewFileClient creates an instance of Client based on the file status specified in the path. The specified period is the interval of the probe, so if this

type Controller Uses

type Controller interface {
    io.Closer
    Start()
    // contains filtered or unexported methods
}

Controller provides the internal interface to handle events coming from Emitters. Individual controller implementation will update its prober status.

func NewFileController Uses

func NewFileController(opt *Options) Controller

NewFileController creates a new Controller implementation which creates a file at the specified path only when the registered emitters are all available.

type Options Uses

type Options struct {
    // Path defines the path to the file used for the existence.
    Path string

    // UpdateInterval defines the interval for updating the file's last modified
    // time.
    UpdateInterval time.Duration
}

Options customizes the parameters of a probe.

func (*Options) IsValid Uses

func (o *Options) IsValid() bool

IsValid returns true if some values are filled into the options.

type Probe Uses

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

Probe manages the availability status used by Controller. Probe also implements SupportsProbe by itself, therefore a struct which embeds this can be registered.

func NewProbe Uses

func NewProbe() *Probe

NewProbe creates a new Emitter instance.

func (*Probe) IsAvailable Uses

func (p *Probe) IsAvailable() error

IsAvailable returns the current status.

func (*Probe) RegisterProbe Uses

func (p *Probe) RegisterProbe(c Controller, name string)

RegisterProbe implements SupportsProbe interface.

func (*Probe) SetAvailable Uses

func (p *Probe) SetAvailable(newStatus error)

SetAvailable sets the new status, and notifies the controller.

func (*Probe) String Uses

func (p *Probe) String() string

String implements fmt.Stringer interface.

type SupportsProbe Uses

type SupportsProbe interface {
    RegisterProbe(c Controller, name string)
}

SupportsProbe provides the interface to register itself to a controller.

Package probe imports 9 packages (graph) and is imported by 20 packages. Updated 2019-05-13. Refresh now. Tools for package owners.