Documentation
¶
Index ¶
- Variables
- func GetLastSeen(service string) time.Time
- func NewHTTPHealthChecker(url *types.URL, config *health.HealthCheckConfig) health.HealthChecker
- func NewRawHealthChecker(url *types.URL, config *health.HealthCheckConfig) health.HealthChecker
- func SetLastSeen(service string, lastSeen time.Time)
- func UpdateLastSeen(service string)
- type AgentCheckHealthTarget
- type AgentProxiedMonitor
- func (mon *AgentProxiedMonitor) CheckHealth() (result *health.HealthCheckResult, err error)
- func (mon AgentProxiedMonitor) Config() *health.HealthCheckConfig
- func (mon AgentProxiedMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)
- func (mon AgentProxiedMonitor) Finish(reason any)
- func (mon AgentProxiedMonitor) Latency() time.Duration
- func (mon AgentProxiedMonitor) MarshalJSON() ([]byte, error)
- func (mon AgentProxiedMonitor) Name() string
- func (mon AgentProxiedMonitor) Start(parent task.Parent) gperr.Error
- func (mon AgentProxiedMonitor) Status() health.Status
- func (mon AgentProxiedMonitor) String() string
- func (mon AgentProxiedMonitor) Task() *task.Task
- func (mon AgentProxiedMonitor) URL() *types.URL
- func (mon AgentProxiedMonitor) UpdateURL(url *types.URL)
- func (mon AgentProxiedMonitor) Uptime() time.Duration
- type DockerHealthMonitor
- func (mon *DockerHealthMonitor) CheckHealth() (result *health.HealthCheckResult, err error)
- func (mon DockerHealthMonitor) Config() *health.HealthCheckConfig
- func (mon DockerHealthMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)
- func (mon DockerHealthMonitor) Finish(reason any)
- func (mon DockerHealthMonitor) Latency() time.Duration
- func (mon DockerHealthMonitor) MarshalJSON() ([]byte, error)
- func (mon DockerHealthMonitor) Name() string
- func (mon DockerHealthMonitor) Start(parent task.Parent) gperr.Error
- func (mon DockerHealthMonitor) Status() health.Status
- func (mon DockerHealthMonitor) String() string
- func (mon DockerHealthMonitor) Task() *task.Task
- func (mon DockerHealthMonitor) URL() *types.URL
- func (mon DockerHealthMonitor) UpdateURL(url *types.URL)
- func (mon DockerHealthMonitor) Uptime() time.Duration
- type FileServerHealthMonitor
- func (s *FileServerHealthMonitor) CheckHealth() (*health.HealthCheckResult, error)
- func (mon FileServerHealthMonitor) Config() *health.HealthCheckConfig
- func (mon FileServerHealthMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)
- func (mon FileServerHealthMonitor) Finish(reason any)
- func (mon FileServerHealthMonitor) Latency() time.Duration
- func (mon FileServerHealthMonitor) MarshalJSON() ([]byte, error)
- func (mon FileServerHealthMonitor) Name() string
- func (mon FileServerHealthMonitor) Start(parent task.Parent) gperr.Error
- func (mon FileServerHealthMonitor) Status() health.Status
- func (mon FileServerHealthMonitor) String() string
- func (mon FileServerHealthMonitor) Task() *task.Task
- func (mon FileServerHealthMonitor) URL() *types.URL
- func (mon FileServerHealthMonitor) UpdateURL(url *types.URL)
- func (mon FileServerHealthMonitor) Uptime() time.Duration
- type HTTPHealthMonitor
- func (mon *HTTPHealthMonitor) CheckHealth() (result *health.HealthCheckResult, err error)
- func (mon HTTPHealthMonitor) Config() *health.HealthCheckConfig
- func (mon HTTPHealthMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)
- func (mon HTTPHealthMonitor) Finish(reason any)
- func (mon HTTPHealthMonitor) Latency() time.Duration
- func (mon HTTPHealthMonitor) MarshalJSON() ([]byte, error)
- func (mon HTTPHealthMonitor) Name() string
- func (mon HTTPHealthMonitor) Start(parent task.Parent) gperr.Error
- func (mon HTTPHealthMonitor) Status() health.Status
- func (mon HTTPHealthMonitor) String() string
- func (mon HTTPHealthMonitor) Task() *task.Task
- func (mon HTTPHealthMonitor) URL() *types.URL
- func (mon HTTPHealthMonitor) UpdateURL(url *types.URL)
- func (mon HTTPHealthMonitor) Uptime() time.Duration
- type HealthCheckFunc
- type JSONRepresentation
- type RawHealthMonitor
- func (mon *RawHealthMonitor) CheckHealth() (result *health.HealthCheckResult, err error)
- func (mon RawHealthMonitor) Config() *health.HealthCheckConfig
- func (mon RawHealthMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)
- func (mon RawHealthMonitor) Finish(reason any)
- func (mon RawHealthMonitor) Latency() time.Duration
- func (mon RawHealthMonitor) MarshalJSON() ([]byte, error)
- func (mon RawHealthMonitor) Name() string
- func (mon RawHealthMonitor) Start(parent task.Parent) gperr.Error
- func (mon RawHealthMonitor) Status() health.Status
- func (mon RawHealthMonitor) String() string
- func (mon RawHealthMonitor) Task() *task.Task
- func (mon RawHealthMonitor) URL() *types.URL
- func (mon RawHealthMonitor) UpdateURL(url *types.URL)
- func (mon RawHealthMonitor) Uptime() time.Duration
Constants ¶
This section is empty.
Variables ¶
var ErrNegativeInterval = errors.New("negative interval")
Functions ¶
func GetLastSeen ¶
func NewHTTPHealthChecker ¶
func NewHTTPHealthChecker(url *types.URL, config *health.HealthCheckConfig) health.HealthChecker
func NewRawHealthChecker ¶
func NewRawHealthChecker(url *types.URL, config *health.HealthCheckConfig) health.HealthChecker
func SetLastSeen ¶
func UpdateLastSeen ¶
func UpdateLastSeen(service string)
Types ¶
type AgentCheckHealthTarget ¶ added in v0.10.0
func AgentTargetFromURL ¶ added in v0.10.0
func AgentTargetFromURL(url *types.URL) *AgentCheckHealthTarget
type AgentProxiedMonitor ¶ added in v0.10.0
type AgentProxiedMonitor struct {
// contains filtered or unexported fields
}
func NewAgentProxiedMonitor ¶ added in v0.10.0
func NewAgentProxiedMonitor(agent *agentPkg.AgentConfig, config *health.HealthCheckConfig, target *AgentCheckHealthTarget) *AgentProxiedMonitor
func (*AgentProxiedMonitor) CheckHealth ¶ added in v0.10.0
func (mon *AgentProxiedMonitor) CheckHealth() (result *health.HealthCheckResult, err error)
func (AgentProxiedMonitor) Config ¶ added in v0.10.0
func (mon AgentProxiedMonitor) Config() *health.HealthCheckConfig
Config implements HealthChecker.
func (AgentProxiedMonitor) ContextWithTimeout ¶ added in v0.10.0
func (mon AgentProxiedMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)
func (AgentProxiedMonitor) Finish ¶ added in v0.10.0
func (mon AgentProxiedMonitor) Finish(reason any)
Finish implements task.TaskFinisher.
func (AgentProxiedMonitor) MarshalJSON ¶ added in v0.10.0
MarshalJSON implements json.Marshaler of HealthMonitor.
func (AgentProxiedMonitor) Name ¶ added in v0.10.0
func (mon AgentProxiedMonitor) Name() string
Name implements HealthMonitor.
func (AgentProxiedMonitor) String ¶ added in v0.10.0
func (mon AgentProxiedMonitor) String() string
String implements fmt.Stringer of HealthMonitor.
type DockerHealthMonitor ¶
type DockerHealthMonitor struct {
// contains filtered or unexported fields
}
func NewDockerHealthMonitor ¶
func NewDockerHealthMonitor(client *docker.SharedClient, containerID, alias string, config *health.HealthCheckConfig, fallback health.HealthChecker) *DockerHealthMonitor
func (*DockerHealthMonitor) CheckHealth ¶
func (mon *DockerHealthMonitor) CheckHealth() (result *health.HealthCheckResult, err error)
func (DockerHealthMonitor) Config ¶
func (mon DockerHealthMonitor) Config() *health.HealthCheckConfig
Config implements HealthChecker.
func (DockerHealthMonitor) ContextWithTimeout ¶
func (mon DockerHealthMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)
func (DockerHealthMonitor) Finish ¶
func (mon DockerHealthMonitor) Finish(reason any)
Finish implements task.TaskFinisher.
func (DockerHealthMonitor) MarshalJSON ¶
MarshalJSON implements json.Marshaler of HealthMonitor.
func (DockerHealthMonitor) Name ¶
func (mon DockerHealthMonitor) Name() string
Name implements HealthMonitor.
func (DockerHealthMonitor) String ¶
func (mon DockerHealthMonitor) String() string
String implements fmt.Stringer of HealthMonitor.
type FileServerHealthMonitor ¶
type FileServerHealthMonitor struct {
// contains filtered or unexported fields
}
func NewFileServerHealthMonitor ¶
func NewFileServerHealthMonitor(config *health.HealthCheckConfig, path string) *FileServerHealthMonitor
func (*FileServerHealthMonitor) CheckHealth ¶
func (s *FileServerHealthMonitor) CheckHealth() (*health.HealthCheckResult, error)
func (FileServerHealthMonitor) Config ¶
func (mon FileServerHealthMonitor) Config() *health.HealthCheckConfig
Config implements HealthChecker.
func (FileServerHealthMonitor) ContextWithTimeout ¶
func (mon FileServerHealthMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)
func (FileServerHealthMonitor) Finish ¶
func (mon FileServerHealthMonitor) Finish(reason any)
Finish implements task.TaskFinisher.
func (FileServerHealthMonitor) MarshalJSON ¶
MarshalJSON implements json.Marshaler of HealthMonitor.
func (FileServerHealthMonitor) Name ¶
func (mon FileServerHealthMonitor) Name() string
Name implements HealthMonitor.
func (FileServerHealthMonitor) String ¶
func (mon FileServerHealthMonitor) String() string
String implements fmt.Stringer of HealthMonitor.
type HTTPHealthMonitor ¶
type HTTPHealthMonitor struct {
// contains filtered or unexported fields
}
func NewHTTPHealthMonitor ¶
func NewHTTPHealthMonitor(url *types.URL, config *health.HealthCheckConfig) *HTTPHealthMonitor
func (*HTTPHealthMonitor) CheckHealth ¶
func (mon *HTTPHealthMonitor) CheckHealth() (result *health.HealthCheckResult, err error)
func (HTTPHealthMonitor) Config ¶
func (mon HTTPHealthMonitor) Config() *health.HealthCheckConfig
Config implements HealthChecker.
func (HTTPHealthMonitor) ContextWithTimeout ¶
func (mon HTTPHealthMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)
func (HTTPHealthMonitor) Finish ¶
func (mon HTTPHealthMonitor) Finish(reason any)
Finish implements task.TaskFinisher.
func (HTTPHealthMonitor) MarshalJSON ¶
MarshalJSON implements json.Marshaler of HealthMonitor.
func (HTTPHealthMonitor) Name ¶
func (mon HTTPHealthMonitor) Name() string
Name implements HealthMonitor.
func (HTTPHealthMonitor) String ¶
func (mon HTTPHealthMonitor) String() string
String implements fmt.Stringer of HealthMonitor.
type HealthCheckFunc ¶
type HealthCheckFunc func() (result *health.HealthCheckResult, err error)
type JSONRepresentation ¶
type JSONRepresentation struct { Name string Config *health.HealthCheckConfig Status health.Status Started time.Time Uptime time.Duration Latency time.Duration LastSeen time.Time Detail string URL *net.URL Extra map[string]any }
func (*JSONRepresentation) MarshalJSON ¶
func (jsonRepr *JSONRepresentation) MarshalJSON() ([]byte, error)
type RawHealthMonitor ¶
type RawHealthMonitor struct {
// contains filtered or unexported fields
}
func NewRawHealthMonitor ¶
func NewRawHealthMonitor(url *types.URL, config *health.HealthCheckConfig) *RawHealthMonitor
func (*RawHealthMonitor) CheckHealth ¶
func (mon *RawHealthMonitor) CheckHealth() (result *health.HealthCheckResult, err error)
func (RawHealthMonitor) Config ¶
func (mon RawHealthMonitor) Config() *health.HealthCheckConfig
Config implements HealthChecker.
func (RawHealthMonitor) ContextWithTimeout ¶
func (mon RawHealthMonitor) ContextWithTimeout(cause string) (ctx context.Context, cancel context.CancelFunc)
func (RawHealthMonitor) Finish ¶
func (mon RawHealthMonitor) Finish(reason any)
Finish implements task.TaskFinisher.
func (RawHealthMonitor) MarshalJSON ¶
MarshalJSON implements json.Marshaler of HealthMonitor.
func (RawHealthMonitor) Name ¶
func (mon RawHealthMonitor) Name() string
Name implements HealthMonitor.
func (RawHealthMonitor) String ¶
func (mon RawHealthMonitor) String() string
String implements fmt.Stringer of HealthMonitor.