github

package
v0.0.0-...-ce22054 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package github is used to access GitHub to find latest version in repositories

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	Username string `koanf:"username"`
	Password string `koanf:"password"`
	Token    string `koanf:"token"`
}

Credentials contains access details for GitHub

type Repo

type Repo struct {
	Repo    string `koanf:"repo"`
	Version string `koanf:"version"`
	UseTag  bool   `koanf:"useTag"`
}

Repo contains repositories that need to be checked for a new version

type RepoVersionGetter

type RepoVersionGetter interface {
	GetLatestVersion(ctx context.Context, gitRepo Repo) (string, error)
	GetLatestVersionFromRelease(ctx context.Context, owner string, repo string) (string, error)
	GetLatestVersionFromTag(ctx context.Context, owner string, repo string) (string, error)
}

RepoVersionGetter is an interface that wraps calls to GitHub

func NewRepoVersionGetter

func NewRepoVersionGetter(ctx context.Context, credentials Credentials) RepoVersionGetter

NewRepoVersionGetter is used to construct authenticated or unauthenticated access to GitHub It returns an implementation of the GitHub client represented as the RepoVersionGetter interface

type Repos

type Repos struct {
	Credentials Credentials `koanf:"credentials"`
	Repos       []Repo      `koanf:"repos"`
}

Repos contains all the GitHub repositories and security information to watch for new versions on GitHub

Jump to

Keyboard shortcuts

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