Documentation
¶
Index ¶
- Variables
- func GetLastSeen(service string) time.Time
- func NewMonitor(r routes.Route) health.HealthMonCheck
- 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) MarshalMap() map[string]any
- 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() *url.URL
- func (mon AgentProxiedMonitor) UpdateURL(url *url.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) MarshalMap() map[string]any
- 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() *url.URL
- func (mon DockerHealthMonitor) UpdateURL(url *url.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) MarshalMap() map[string]any
- 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() *url.URL
- func (mon FileServerHealthMonitor) UpdateURL(url *url.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) MarshalMap() map[string]any
- 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() *url.URL
- func (mon HTTPHealthMonitor) UpdateURL(url *url.URL)
- func (mon HTTPHealthMonitor) Uptime() time.Duration
- type HealthCheckFunc
- 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) MarshalMap() map[string]any
- 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() *url.URL
- func (mon RawHealthMonitor) UpdateURL(url *url.URL)
- func (mon RawHealthMonitor) Uptime() time.Duration
Constants ¶
This section is empty.
Variables ¶
var ErrNegativeInterval = errors.New("negative interval")
Functions ¶
func GetLastSeen ¶
func NewMonitor ¶ added in v0.11.0
func NewMonitor(r routes.Route) health.HealthMonCheck
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 *url.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) MarshalMap ¶ added in v0.11.0
MarshalMap implements health.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) MarshalMap ¶ added in v0.11.0
MarshalMap implements health.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) MarshalMap ¶ added in v0.11.0
MarshalMap implements health.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 *url.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) MarshalMap ¶ added in v0.11.0
MarshalMap implements health.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 RawHealthMonitor ¶
type RawHealthMonitor struct {
// contains filtered or unexported fields
}
func NewRawHealthMonitor ¶
func NewRawHealthMonitor(url *url.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) MarshalMap ¶ added in v0.11.0
MarshalMap implements health.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.