statetrack

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IndexTempl               = 0
	IndexGolangciLint        = 1
	IndexGo                  = 2
	IndexExit                = 3
	IndexOffsetCustomWatcher = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Tracker

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

func NewTracker

func NewTracker(numCustomWatchers int) *Tracker

func (*Tracker) AddListener

func (s *Tracker) AddListener(c chan<- struct{})

AddListener adds a listener channel. c will be written struct{}{} to when a state change happens.

func (*Tracker) ErrIndex

func (t *Tracker) ErrIndex() int

func (*Tracker) Get

func (t *Tracker) Get(index int) string

Get gets the current error message at index.

func (*Tracker) GetCustomWatcher

func (t *Tracker) GetCustomWatcher(index int) string

GetCustomWatcher gets the current error message for custom watcher at index.

func (*Tracker) NumListeners added in v0.6.0

func (s *Tracker) NumListeners() int

NumListeners returns the number of currently active listeners.

func (*Tracker) RemoveListener

func (s *Tracker) RemoveListener(c chan<- struct{})

RemoveListener removes a listener channel.

func (*Tracker) Reset

func (t *Tracker) Reset()

Reset resets the state and notifies all listeners.

func (*Tracker) Set

func (t *Tracker) Set(index int, msg string)

Set sets or resets (if msg == "") the current error message at index.

Jump to

Keyboard shortcuts

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