server

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRules

func CheckRules(ctx context.Context, state *State, checkers map[string]checker.Checker, act map[string]action.Action)

CheckRules checks all watching rules once (used by tests).

func NewHandler

func NewHandler(state *State) http.Handler

func Run

func Run(ctx context.Context, addr string, port int) error

Types

type State

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

func NewState

func NewState(port int) *State

func (*State) AddRule

func (s *State) AddRule(r *rule.WatchRule)

func (*State) Load

func (s *State) Load() error

func (*State) MarkTriggered

func (s *State) MarkTriggered(id string)

func (*State) RemoveRule

func (s *State) RemoveRule(id string) bool

func (*State) Rules

func (s *State) Rules() []*rule.WatchRule

func (*State) Save

func (s *State) Save() error

func (*State) StartAllRuleLoops added in v0.10.0

func (s *State) StartAllRuleLoops()

StartAllRuleLoops starts a polling goroutine for each existing watching rule.

func (*State) UpdateRule

func (s *State) UpdateRule(r *rule.WatchRule)

func (*State) WatchingRules

func (s *State) WatchingRules() []*rule.WatchRule

Jump to

Keyboard shortcuts

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