client

package
v0.1.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Package client contains interface for github client.

Index

Constants

View Source
const (
	// EnvGitProvider is the provider name.
	EnvGitProvider = "GIT_PROVIDER"

	// EnvGitOrgName is the git org name.
	EnvGitOrgName = "GIT_ORG_NAME"

	// EnvGitRepositoryName is the repository name.
	EnvGitRepositoryName = "GIT_REPOSITORY_NAME"

	// EnvGitAccessToken used for accessing private repositories.
	EnvGitAccessToken = "GIT_ACCESS_TOKEN"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	DownloadReleaseAssets(ctx context.Context, release *github.RepositoryRelease, path string, assetlist []string) error
	GetReleaseByTag(ctx context.Context, tag string) (*github.RepositoryRelease, *github.Response, error)
	ListRelease(ctx context.Context) ([]*github.RepositoryRelease, *github.Response, error)
}

Client contains all functions to talk to Github API.

type Factory

type Factory interface {
	NewClient(ctx context.Context) (Client, error)
}

Factory is a factory to generate Github clients.

func NewFactory

func NewFactory() Factory

NewFactory returns a new factory for Github clients.

type GitConfig

type GitConfig struct {
	GitProvider    string
	GitOrgName     string
	GitRepoName    string
	GitAccessToken string
}

GitConfig contains necessary data to connect to github.

func NewGitConfig

func NewGitConfig() (GitConfig, error)

NewGitConfig ensures the environment variables required for the operator to run are set. Returns false if any of the required environment variables are not set.

Directories

Path Synopsis
Package fake defines a fake Gitub client.
Package fake defines a fake Gitub client.
Package mocks implement important mocking interface of packer.
Package mocks implement important mocking interface of packer.

Jump to

Keyboard shortcuts

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