lister

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Endpoint = "/v1/releases/"
	Name     = "release/lister"
)

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

Types

type Changelog

type Changelog struct {
	Component   string `json:"component"`
	Description string `json:"description"`
}

type Component

type Component struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type Config

type Config struct {
	Logger     micrologger.Logger
	RestClient *resty.Client

	URL *url.URL
}

func DefaultConfig

func DefaultConfig() Config

type Lister

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

func New

func New(config Config) (*Lister, error)

func (*Lister) List

func (l *Lister) List(ctx context.Context) ([]Response, error)

type Response

type Response struct {
	Active     bool                `json:"active"`
	Apps       []versionbundle.App `json:"apps"`
	Changelogs []Changelog         `json:"changelogs"`
	Components []Component         `json:"components"`
	Timestamp  time.Time           `json:"timestamp"`
	Version    string              `json:"version"`
}

Response is the return value of the service action.

func DefaultResponse

func DefaultResponse() []Response

DefaultResponse provides a default response by best effort.

Jump to

Keyboard shortcuts

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