github

package
v0.0.0-...-5f25c38 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InvalidGitHubProjectURLError       InvalidGitHubProjectURL       = errors.New("Invalid GitHub project URL")
	InvalidGitHubProjectReferenceError InvalidGitHubProjectReference = errors.New("Invalid GitHub project reference")
)

Functions

This section is empty.

Types

type Error

type Error struct {
	Code   int
	Status string
	Body   []byte
	URL    string
}

func (*Error) Error

func (ge *Error) Error() string

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message"`
	Doc     string `json:"documentation_url"`
}

type InvalidGitHubProjectReference

type InvalidGitHubProjectReference = error

func NewInvalidGitHubProjectReferenceError

func NewInvalidGitHubProjectReferenceError(reference string) InvalidGitHubProjectReference

type InvalidGitHubProjectURL

type InvalidGitHubProjectURL = error

func NewInvalidGitHubProjectURLError

func NewInvalidGitHubProjectURLError(URL string) InvalidGitHubProjectURL

type RateLimit

type RateLimit struct {
	Limit     int
	Remaining int
	Reset     int64
	ResetsAt  time.Time
}

func FetchRateLimit

func FetchRateLimit(client download.ClientContract) (*RateLimit, error)

func (RateLimit) ResetTime

func (r RateLimit) ResetTime() time.Time

func (RateLimit) String

func (r RateLimit) String() string

type RateLimitJSON

type RateLimitJSON struct {
	Resources map[string]RateLimit
}

type Release

type Release struct {
	Assets      []ReleaseAsset `json:"assets"`
	Prerelease  bool           `json:"prerelease"`
	Tag         string         `json:"tag_name"`
	CreatedAt   time.Time      `json:"created_at"`
	PublishedAt time.Time      `json:"published_at"`
}

A Release matches the Assets portion of Github's release API json.

func (*Release) ProcessReleaseAssets

func (r *Release) ProcessReleaseAssets()

type ReleaseAsset

type ReleaseAsset struct {
	Release       *Release
	Name          string `json:"name"`
	URL           string `json:"url"`
	DownloadURL   string `json:"browser_download_url"`
	Size          int64  `json:"size"`
	DownloadCount int64  `json:"download_count"`
	ContentType   string `json:"content_type"`
}

func (*ReleaseAsset) CopyToNewAsset

func (ra *ReleaseAsset) CopyToNewAsset() assets.Asset

Jump to

Keyboard shortcuts

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