Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultHeartbeatInterval = DefaultTTL / 3
View Source
const DefaultInitialDelay = 1500 * time.Millisecond
View Source
const DefaultTTL = 30 * time.Second
View Source
const ReapMultiple = 3
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
InstanceID string `json:"instanceId"`
Kind Kind `json:"kind"`
PID int `json:"pid"`
Host string `json:"host,omitempty"`
StartedAt time.Time `json:"startedAt"`
LastSeen time.Time `json:"lastSeen"`
Cwd string `json:"cwd,omitempty"`
Address string `json:"address,omitempty"`
SessionCount int `json:"sessionCount"`
ClientName string `json:"clientName,omitempty"`
}
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
func StartReporter ¶
func StartReporter(ctx context.Context, store ReporterStore, rec Record, opts ...ReporterOption) *Reporter
func (*Reporter) InstanceID ¶
type ReporterOption ¶
type ReporterOption func(*Reporter)
func WithInitialDelay ¶
func WithInitialDelay(d time.Duration) ReporterOption
func WithInterval ¶
func WithInterval(d time.Duration) ReporterOption
func WithLogger ¶
func WithLogger(l *slog.Logger) ReporterOption
type ReporterStore ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStore ¶
func NewStore(kv libkvstore.KVManager, opts ...StoreOption) *Store
func (*Store) Deregister ¶
type StoreOption ¶
type StoreOption func(*Store)
func WithClock ¶
func WithClock(now func() time.Time) StoreOption
func WithHardTTL ¶
func WithHardTTL(d time.Duration) StoreOption
func WithStaleTTL ¶
func WithStaleTTL(d time.Duration) StoreOption
Click to show internal directories.
Click to hide internal directories.