news

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GithubReleasesEndpoint string = "https://api.github.com/repos/xvello/letsblockit/releases?per_page=20"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Release

type Release struct {
	Id          int
	Link        string
	Description string
	CreatedAt   time.Time
	PublishedAt time.Time
	TagName     string
	GithubUrl   string
}

func (Release) Date

func (r Release) Date() string

type ReleaseClient

type ReleaseClient struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ReleaseClient fetches and parses the github releases for a repository. The parsed results are cached in memory until the next restart.

func NewReleaseClient

func NewReleaseClient(url string, cacheDir string, officialInstance bool, tp templateProvider) *ReleaseClient

func (*ReleaseClient) GetLatestAt

func (c *ReleaseClient) GetLatestAt() (time.Time, error)

func (*ReleaseClient) GetReleases

func (c *ReleaseClient) GetReleases() ([]*Release, string, error)

Jump to

Keyboard shortcuts

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