git

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BITBUCKET_CLOUD_DOMAIN               = "bitbucket.org"
	BITBUCKET_REST_ENDPOINT              = "/api/2.0"
	BITBUCKET               ProviderType = "bitbucket"
)
View Source
const (
	GITHUB_CLOUD_DOMAIN               = "github.com"
	GITHUB_CLOUD_API_URL              = "https://api.github.com"
	GITHUB_REST_ENDPOINT              = "/api/v3"
	GITHUB               ProviderType = "github"
	GITHUB_ENT           ProviderType = "github-enterpeise" // for backward compatability
)
View Source
const (
	GITLAB_CLOUD_DOMAIN               = "gitlab.com"
	GITLAB_REST_ENDPOINT              = "/api/v4"
	GITLAB               ProviderType = "gitlab"
)

Variables

View Source
var (
	CYAN        = "\033[36m"
	COLOR_RESET = "\033[0m"

	GetProvider = getProvider
)

Functions

func DefaultTransportWithCa

func DefaultTransportWithCa(certFile string) (*http.Transport, error)

Types

type Auth

type Auth struct {
	Username string
	Password string
	CertFile string
}

func (*Auth) GetCertificate

func (a *Auth) GetCertificate() ([]byte, error)

type Provider

type Provider interface {
	ApiURL() string
	IsCloud() bool
	Type() ProviderType
	VerifyRuntimeToken(ctx context.Context, auth Auth) error
}

Provider represents a git provider

func NewBitbucketProvider

func NewBitbucketProvider(baseURL string, client *http.Client) (Provider, error)

func NewBitbucketServerProvider

func NewBitbucketServerProvider(baseURL string, client *http.Client) (Provider, error)

func NewGithubProvider

func NewGithubProvider(baseURL string, client *http.Client) (Provider, error)

func NewGitlabProvider

func NewGitlabProvider(baseURL string, client *http.Client) (Provider, error)

type ProviderType

type ProviderType string
const (
	BITBUCKET_SERVER_REST_ENDPOINT              = "/rest/api/1.0"
	BITBUCKET_SERVER               ProviderType = "bitbucket-server"
)

func (*ProviderType) Set

func (pt *ProviderType) Set(s string) error

func (*ProviderType) String

func (pt *ProviderType) String() string

func (*ProviderType) Type

func (pt *ProviderType) Type() string

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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