github

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Github

type Github struct {
	// Spec contains inputs coming from updatecli configuration
	Spec Spec
	// contains filtered or unexported fields
}

GitHub contains settings to interact with GitHub

func New

func New(s interface{}) (*Github, error)

New returns a new valid GitHub object.

func (Github) Run

func (g Github) Run() ([]changelog.Spec, error)

Run retrieves the changelog from GitHub.

type PageInfo

type PageInfo struct {
	HasNextPage     bool
	HasPreviousPage bool
	EndCursor       string
	StartCursor     string
}

PageInfo is used for Graphql queries to iterate over pagination

type RateLimit

type RateLimit struct {
	Cost      int
	Remaining int
	ResetAt   string
}

RateLimit is a struct that contains GitHub Api limit information

func (*RateLimit) Show

func (a *RateLimit) Show()

Show display GitHub Api limit usage

type ReleaseType

type ReleaseType struct {
	/*
		"Draft" enable/disable GitHub draft release
	*/
	Draft bool
	/*
		"PreRelease" enable/disable GitHub PreRelease
	*/
	PreRelease bool
	/*
		"Release" enable/disable GitHub release
	*/
	Release bool
	/*
		"Latest" if set to true will only filter the release flag as latest.
	*/
	Latest bool
}

ReleaseType specifies accepted GitHub Release type

func (*ReleaseType) Init

func (r *ReleaseType) Init()

Init will set default value if none are set

type Spec

type Spec struct {
	/*
		owner specifies the name of a GitHub user or organization.
	*/
	Owner string `yaml:",omitempty" jsonschema:"required"`
	/*
		repository specifies the name of a repository for a specific owner.
	*/
	Repository string `yaml:",omitempty" jsonschema:"required"`
	/*
		TypeFilter specifies the GitHub Release type to retrieve.
	*/
	TypeFilter *ReleaseType `yaml:",omitempty"`
	/*
		"token" specifies the credential used to authenticate with GitHub API.
	*/
	Token string `yaml:",omitempty" jsonschema:"required"`
	/*
		url specifies the default github url in case of GitHub enterprise

		default:
			github.com
	*/
	URL string `yaml:",omitempty"`
	/*
		"username" specifies the username used to authenticate with GitHub API.

		remark:
			the token is usually enough to authenticate with GitHub API.
	*/
	Username string `yaml:",omitempty"`
}

Spec represents the configuration input

Jump to

Keyboard shortcuts

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