gh

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Github-related configuration items
	Token        *string      `json:"token"` // Github token, optional
	StateFile    string       `json:"state_file"`
	Repositories []RepoConfig `json:"repositories"`
	Wait         bool         `json:"wait"`

	// Printer is optional and contains the default configuration for
	// the different printers (plaintext, template...).
	Printer *struct {
		DefaultOutput *string `json:"default_output"`

		PlainPrinter *struct {
			ShowBody *bool `json:"show_body"`
		} `json:"plain_printer"`
		TemplatePrinter *struct {
			Template  *string `json:"template"`
			ColorMode *string `json:"color_mode"`
		} `json:"template_printer"`
	}
	// contains filtered or unexported fields
}

Config contains the utility configuration details

func ReadConfig

func ReadConfig(filePath, token string) (*Config, error)

ReadConfig reads an YAML file containing the configuration If a token is provided, it overrides the one from the configuration file. This function returns the configuration details, or an error.

func (*Config) CheckReleases

func (c *Config) CheckReleases(readOnly bool) ([]ReleaseList, error)

CheckReleases checks all configured repositories for new releases

type Release

type Release struct {
	*RepoState
	Body *string `json:"body"`
}

Release contains a repository release

type ReleaseList added in v0.0.6

type ReleaseList []*Release

ReleaseList represents a list of new releases for a given project

type RepoConfig added in v0.0.2

type RepoConfig struct {
	Repo        string `json:"repo"`        // owner/repo_name
	Prereleases bool   `json:"prereleases"` // include prereleases
}

RepoConfig contains the user configuration for a single repository

type RepoState

type RepoState struct {
	Repo        string            `json:"repo"`
	Version     string            `json:"version"`
	Tag         *string           `json:"tag,omitempty"`
	PreRelease  *bool             `json:"prerelease,omitempty"`
	PublishDate *github.Timestamp `json:"publish_date,omitempty"`
	// contains filtered or unexported fields
}

RepoState contains the state of a given repository

type States

type States struct {
	Repositories map[string]RepoState `json:"repositories"`
}

States is a struct that contains the states of all checked releases

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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