monitor

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

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

Monitor tracks authentication status and invokes a callback when it changes.

func NewMonitor

func NewMonitor(cfg *config.API) *Monitor

NewMonitor creates a new authentication monitor with the given change callback.

func (*Monitor) Check

func (m *Monitor) Check(ctx context.Context)

Check verifies the current authentication status and invokes the onChange callback if the status has changed since the last check.

func (*Monitor) Run

func (m *Monitor) Run(ctx context.Context, checkInterval time.Duration)

Run begins monitoring authentication status. It performs an initial check and then checks periodically at the specified interval until the context is cancelled.

func (*Monitor) SetCallback

func (m *Monitor) SetCallback(onChange MonitorOnChangeFunc)

type MonitorOnChangeFunc

type MonitorOnChangeFunc func(ctx context.Context, authenticated bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL