container

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StateStrings

func StateStrings() []string

StateStrings returns a slice of all String values of the enum

Types

type Client

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

func NewClient

func NewClient(cfg config.Settings, mapping []config.ImagesChangelog) *Client

func (*Client) DoUpdate

func (c *Client) DoUpdate()

func (*Client) GetLastUpdateTime

func (c *Client) GetLastUpdateTime() time.Time

func (*Client) GetStaleContainers

func (c *Client) GetStaleContainers() []Info

func (*Client) RefreshContainers

func (c *Client) RefreshContainers()

func (*Client) Update

func (c *Client) Update(ids []string)

type Info

type Info struct {
	ID          string
	Name        string
	ImageName   string
	State       State               // TODO: add message for Error state
	Changelog   template.HTML       `json:"-"`
	LatestImage string              `json:"-"`
	Container   container.Container `json:"-"`
}

type State

type State int
const (
	Stale State = iota
	RequestedUpdate
	Updating
	Error
	Fresh
)

func StateString

func StateString(s string) (State, error)

StateString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func StateValues

func StateValues() []State

StateValues returns all values of the enum

func (State) IsAState

func (i State) IsAState() bool

IsAState returns "true" if the value is listed in the enum definition. "false" otherwise

func (State) MarshalJSON

func (i State) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for State

func (State) String

func (i State) String() string

func (*State) UnmarshalJSON

func (i *State) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for State

Jump to

Keyboard shortcuts

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