updates

package
v0.0.0-...-e5c115e Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// Updates is the number of available updates.
	Updates int
	// PackageDetails are optional details for the packages that updates are
	// available for.
	PackageDetails PackageDetails
}

Info contains information about available updates.

type Module

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

Module is a module for displaying currently available updates in the bar.

func New

func New(provider Provider) *Module

New creates a new *Module with the given update count provider. By default, the module will refresh the update counts every hour. The refresh interval can be configured using `Every`.

func (*Module) Every

func (m *Module) Every(interval time.Duration) *Module

Every configures the refresh interval for the module. Passing a zero interval will disable refreshing.

func (*Module) Output

func (m *Module) Output(format func(Info) bar.Output) *Module

Output updates the output format func.

func (*Module) Refresh

func (m *Module) Refresh()

Refresh forces a refresh of the module output.

func (*Module) Stream

func (m *Module) Stream(s bar.Sink)

Stream implements bar.Module.

type PackageDetail

type PackageDetail struct {
	// PackageName is the name of the package.
	PackageName string
	// CurrentVersion is the currently installed package version.
	CurrentVersion string
	// TargetVersion is the version of the available package update.
	TargetVersion string
}

PackageDetail contains information about a single package update.

func (PackageDetail) String

func (d PackageDetail) String() string

String implements fmt.Stringer.

type PackageDetails

type PackageDetails []PackageDetail

PackageDetails contains details about package updates.

func (PackageDetails) String

func (d PackageDetails) String() string

String implements fmt.Stringer.

type Provider

type Provider interface {
	Updates() (Info, error)
}

Provider provides the count of currently available updates for the bar.

type ProviderFunc

type ProviderFunc func() (Info, error)

ProviderFunc is a func that satisfies the Provider interface.

func (ProviderFunc) Updates

func (f ProviderFunc) Updates() (Info, error)

Updates implements Provider.

Directories

Path Synopsis
Package yay contains an updates.Provider that uses `yay` to check for Arch Linux package updates.
Package yay contains an updates.Provider that uses `yay` to check for Arch Linux package updates.

Jump to

Keyboard shortcuts

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