checker

package
v0.0.0-...-cdc9c58 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToContext

func ToContext(c Setter, state *State)

ToContext adds the Store to this context if it supports the Setter interface.

Types

type Checker

type Checker struct {
	Remote remote.Remote
	Store  store.Store
	State  *State
}

Checker can check for package updates in repos.

func (*Checker) Run

func (c *Checker) Run()

Run runs the checker that checks for package updates in repos.

type Setter

type Setter interface {
	Set(string, interface{})
}

Setter defines a context that enables setting values.

type State

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

State defines a table of the packages for which an update/check request was made recently.

func FromContext

func FromContext(c context.Context) *State

FromContext returns the Store associated with this context.

func NewState

func NewState(ttl time.Duration) *State

NewState initializes a new state with the specified ttl.

func (*State) Add

func (s *State) Add(pkg, owner, repo string)

Add adds a package to the state table for the given repo.

func (*State) ClearExpired

func (s *State) ClearExpired()

ClearExpired clears all expired entries from the state table.

func (*State) ClearPkg

func (s *State) ClearPkg(pkg, owner, repo string)

ClearPkg clears a package from the state table.

func (*State) IsActive

func (s *State) IsActive(pkg, owner, repo string) (bool, *time.Time)

IsActive returns true (and add time) if a check/update request has recently been made for this package.

Jump to

Keyboard shortcuts

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