manager

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ForceStrategy added in v0.3.1

type ForceStrategy int

ForceStrategy is an enum for the force strategy. It implements https://pkg.go.dev/github.com/spf13/pflag#Value.

const (
	// ForceApply forces the application of the ruleset on all notifications,
	// even the ones marked as Done.
	ForceApply ForceStrategy = 1 << iota

	// ForceNoop prevents any Action from being executed.
	ForceNoop

	// ForceApply forces the enrichment of all notifications, even the ones
	// marked as Done.
	ForceEnrich
)

func (*ForceStrategy) Allowed added in v0.3.1

func (*ForceStrategy) Allowed() string

func (*ForceStrategy) Has added in v0.3.1

func (r *ForceStrategy) Has(s ForceStrategy) bool

func (*ForceStrategy) Set added in v0.3.1

func (r *ForceStrategy) Set(value string) error

func (*ForceStrategy) String added in v0.3.1

func (r *ForceStrategy) String() string

func (*ForceStrategy) Type added in v0.3.1

func (*ForceStrategy) Type() string

type Manager

type Manager struct {
	Notifications notifications.Notifications
	Cache         cache.RefreshReadWriter

	Actions actions.Map

	RefreshStrategy RefreshStrategy
	ForceStrategy   ForceStrategy
	// contains filtered or unexported fields
}

func New

func New(c *config.Data) *Manager

func (*Manager) Apply

func (m *Manager) Apply() error

func (*Manager) Enrich added in v0.3.1

func (*Manager) Load

func (m *Manager) Load() error

func (*Manager) Refresh added in v0.3.1

func (m *Manager) Refresh() error

func (*Manager) Save

func (m *Manager) Save() error

func (*Manager) SetCaller added in v0.3.2

func (m *Manager) SetCaller(caller api.Requestor)

type RefreshStrategy added in v0.1.1

type RefreshStrategy int

RefreshStrategy is an enum for the refresh strategy. It implements https://pkg.go.dev/github.com/spf13/pflag#Value.

const (
	// AutoRefresh refreshes the notifications if the cache is expired.
	AutoRefresh RefreshStrategy = iota

	// ForceRefresh always refreshes the notifications.
	ForceRefresh

	// PreventRefresh never refreshes the notifications.
	PreventRefresh
)

func (*RefreshStrategy) Allowed added in v0.3.0

func (*RefreshStrategy) Allowed() string

func (*RefreshStrategy) Set added in v0.3.0

func (r *RefreshStrategy) Set(value string) error

func (*RefreshStrategy) ShouldRefresh added in v0.3.2

func (r *RefreshStrategy) ShouldRefresh(expired bool) bool

func (*RefreshStrategy) String added in v0.3.0

func (r *RefreshStrategy) String() string

func (*RefreshStrategy) Type added in v0.3.0

func (*RefreshStrategy) Type() string

Jump to

Keyboard shortcuts

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