source

package
v0.0.0-...-e5227d7 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package source is used to fetch the latest version information from upstream

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterTmplData

type FilterTmplData struct {
	Key   string
	Value string
	Meta  interface{}
}

type GHAsset

type GHAsset struct {
	URL           string `json:"url"`
	ID            int64  `json:"id"`
	Name          string `json:"name"`
	ContentType   string `json:"content_type"`
	State         string `json:"state"`
	Size          uint64 `json:"size"`
	DownloadCount uint64 `json:"download_count"`
	DownloadURL   string `json:"browser_download_url"`
	CreatedAt     GHTime `json:"created_at"`
	UpdatedAt     GHTime `json:"updated_at"`
}

type GHRelease

type GHRelease struct {
	URL             string     `json:"url"`
	HTMLURL         string     `json:"html_url"`
	ID              int64      `json:"id"`
	TagName         string     `json:"tag_name"`
	TargetCommitish string     `json:"target_commitish"`
	Name            string     `json:"name"`
	Draft           bool       `json:"draft"`
	Prerelease      bool       `json:"prerelease"`
	CreatedAt       GHTime     `json:"created_at"`
	PublishedAt     GHTime     `json:"published_at"`
	Assets          []*GHAsset `json:"assets"`
}

type GHTime

type GHTime time.Time

func (*GHTime) UnmarshalJSON

func (t *GHTime) UnmarshalJSON(data []byte) (err error)

type Source

type Source interface {
	// Get returns the version from upstream
	Get(data config.SourceTmplData) (string, error)
	Key(data config.SourceTmplData) (string, error)
}

func Get

func Get(confSrc config.Source) (Source, error)

Get a named source

type VersionTmplData

type VersionTmplData struct {
	VerMap  map[string]string      // map of all matching versions, key is for sorting, value is the returned version
	VerList []string               // sorted list of valid keys in VerMap, generated by procResult
	Version string                 // selected version after sorting and offset, this is overwritten if len(Versions) > 0
	VerMeta map[string]interface{} // additional metadata
}

VersionTmplData is used by source to output the version

Jump to

Keyboard shortcuts

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