gitlab

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TokenEnvKey is the default GitLab token environment variable key
	TokenEnvKey = "GITLAB_TOKEN"
	// PrivateTokenEnvKey is the private GitLab token environment variable key
	PrivateTokenEnvKey = "GITLAB_PRIVATE_TOKEN"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	ListProjects(
		opt *gitlab.ListProjectsOptions,
	) ([]*gitlab.Project, *gitlab.Response, error)
	ListReleases(
		string, string, *gitlab.ListReleasesOptions,
	) ([]*gitlab.Release, *gitlab.Response, error)
	ListBranches(
		string, string, *gitlab.ListBranchesOptions,
	) ([]*gitlab.Branch, *gitlab.Response, error)
	ListTags(
		string, string, *gitlab.ListTagsOptions,
	) ([]*gitlab.Tag, *gitlab.Response, error)
}

type GitLab

type GitLab struct {
	// contains filtered or unexported fields
}

GitLab is a wrapper around GitLab related functionality

func New

func New() *GitLab

New creates a new default GitLab client. Tokens set via the $GITLAB_TOKEN environment variable will result in an authenticated client. If the $GITLAB_TOKEN is not set, then it will return a nil client. GitLab requires autenticated users.

func NewPrivate

func NewPrivate(baseURL string) *GitLab

func (*GitLab) Branches added in v0.2.0

func (g *GitLab) Branches(owner, repo string) ([]*gitlab.Branch, error)

func (*GitLab) Client

func (g *GitLab) Client() Client

Client can be used to retrieve the Client type

func (*GitLab) GetRepository added in v0.3.1

func (g *GitLab) GetRepository(owner, repo string) (*gitlab.Project, error)

GetRepository returns the Repository information for the provided `owner` and `repo`.

func (*GitLab) ListTags added in v0.3.1

func (g *GitLab) ListTags(owner, repo string) ([]*gitlab.Tag, error)

ListTags returns a list of GitLab tags for the provided `owner` and `repo`.

func (*GitLab) Releases

func (g *GitLab) Releases(owner, repo string) ([]*gitlab.Release, error)

Releases returns a list of GitLab releases for the provided `owner` and `repo`.

func (*GitLab) SetClient

func (g *GitLab) SetClient(client Client)

SetClient can be used to manually set the internal GitLab client

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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