gitprovider

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CheckoutDefault = CheckoutOption{Title: "Clone the default branch", Id: "default"}
	CheckoutBranch  = CheckoutOption{Title: "Branches", Id: "branch"}
	CheckoutPR      = CheckoutOption{Title: "Pull/Merge requests", Id: "pullrequest"}
)

Functions

func GetGitProviderFromHost added in v0.8.0

func GetGitProviderFromHost(url string, gitProviders []serverapiclient.GitProvider) *serverapiclient.GitProvider

func GetUsernameFromToken

func GetUsernameFromToken(providerId string, gitProviders []config.GitProvider, token string, baseApiUrl string) (string, error)

Types

type BitbucketGitProvider

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

func (*BitbucketGitProvider) GetNamespaces

func (g *BitbucketGitProvider) GetNamespaces() ([]GitNamespace, error)

func (*BitbucketGitProvider) GetRepoBranches

func (g *BitbucketGitProvider) GetRepoBranches(repo types.Repository, namespaceId string) ([]GitBranch, error)

func (*BitbucketGitProvider) GetRepoPRs

func (g *BitbucketGitProvider) GetRepoPRs(repo types.Repository, namespaceId string) ([]GitPullRequest, error)

func (*BitbucketGitProvider) GetRepositories

func (g *BitbucketGitProvider) GetRepositories(namespace string) ([]types.Repository, error)

func (*BitbucketGitProvider) GetUserData

func (g *BitbucketGitProvider) GetUserData() (GitUser, error)

type BranchResponse

type BranchResponse struct {
	Name   string `json:"name"`
	Target struct {
		Hash string `json:"hash"`
	} `json:"target"`
}

type BranchesResponse

type BranchesResponse struct {
	Values []BranchResponse `json:"values"`
}

type CheckoutOption

type CheckoutOption struct {
	Title string
	Id    string
}

type GitBranch

type GitBranch struct {
	Name string
	SHA  string
}

type GitHubGitProvider

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

func (*GitHubGitProvider) GetNamespaces

func (g *GitHubGitProvider) GetNamespaces() ([]GitNamespace, error)

func (*GitHubGitProvider) GetRepoBranches

func (g *GitHubGitProvider) GetRepoBranches(repo types.Repository, namespaceId string) ([]GitBranch, error)

func (*GitHubGitProvider) GetRepoPRs

func (g *GitHubGitProvider) GetRepoPRs(repo types.Repository, namespaceId string) ([]GitPullRequest, error)

func (*GitHubGitProvider) GetRepositories

func (g *GitHubGitProvider) GetRepositories(namespace string) ([]types.Repository, error)

func (*GitHubGitProvider) GetUserData

func (g *GitHubGitProvider) GetUserData() (GitUser, error)

type GitLabGitProvider

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

func (*GitLabGitProvider) GetNamespaces

func (g *GitLabGitProvider) GetNamespaces() ([]GitNamespace, error)

func (*GitLabGitProvider) GetRepoBranches

func (g *GitLabGitProvider) GetRepoBranches(repo types.Repository, namespaceId string) ([]GitBranch, error)

func (*GitLabGitProvider) GetRepoPRs

func (g *GitLabGitProvider) GetRepoPRs(repo types.Repository, namespaceId string) ([]GitPullRequest, error)

func (*GitLabGitProvider) GetRepositories

func (g *GitLabGitProvider) GetRepositories(namespace string) ([]types.Repository, error)

func (*GitLabGitProvider) GetUserData

func (g *GitLabGitProvider) GetUserData() (GitUser, error)

type GitNamespace

type GitNamespace struct {
	Id   string
	Name string
}

type GitProvider

type GitProvider interface {
	GetNamespaces() ([]GitNamespace, error)
	GetRepositories(namespace string) ([]types.Repository, error)
	GetUserData() (GitUser, error)
	GetRepoBranches(types.Repository, string) ([]GitBranch, error)
	GetRepoPRs(types.Repository, string) ([]GitPullRequest, error)
}

func GetGitProvider

func GetGitProvider(providerId string, gitProviders []types.GitProvider) GitProvider

type GitPullRequest

type GitPullRequest struct {
	Name   string
	Branch string
}

type GitUser

type GitUser struct {
	Id       string
	Username string
	Name     string
	Email    string
}

type GiteaGitProvider added in v0.4.0

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

func (*GiteaGitProvider) GetNamespaces added in v0.4.0

func (g *GiteaGitProvider) GetNamespaces() ([]GitNamespace, error)

func (*GiteaGitProvider) GetRepoBranches added in v0.4.0

func (g *GiteaGitProvider) GetRepoBranches(repo types.Repository, namespaceId string) ([]GitBranch, error)

func (*GiteaGitProvider) GetRepoPRs added in v0.4.0

func (g *GiteaGitProvider) GetRepoPRs(repo types.Repository, namespaceId string) ([]GitPullRequest, error)

func (*GiteaGitProvider) GetRepositories added in v0.4.0

func (g *GiteaGitProvider) GetRepositories(namespace string) ([]types.Repository, error)

func (*GiteaGitProvider) GetUserData added in v0.4.0

func (g *GiteaGitProvider) GetUserData() (GitUser, error)

Jump to

Keyboard shortcuts

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