scm

package
v1.9.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SupportedClients

func SupportedClients() []string

SupportedClients return list of all supported clients

Types

type Bitbucket

type Bitbucket struct {
	// extend the bitbucket client
	*bitbucket.Client
}

func (Bitbucket) GetOrgRepos

func (c Bitbucket) GetOrgRepos(targetOrg string) ([]Repo, error)

GetOrgRepos gets org repos

func (Bitbucket) GetType

func (_ Bitbucket) GetType() string

func (Bitbucket) GetUserRepos

func (c Bitbucket) GetUserRepos(targetUser string) ([]Repo, error)

GetUserRepos gets user repos from bitbucket

func (Bitbucket) NewClient

func (_ Bitbucket) NewClient() (Client, error)

NewClient create new bitbucket scm client

type Client

type Client interface {
	NewClient() (Client, error)

	GetUserRepos(targetUsername string) ([]Repo, error)
	GetOrgRepos(targetOrg string) ([]Repo, error)

	GetType() string
}

Client define the interface a scm client has to have

func GetClient

func GetClient(cType string) (Client, error)

type Gitea

type Gitea struct {
	// extend the gitea client
	*gitea.Client
	// contains filtered or unexported fields
}

func (Gitea) GetOrgRepos

func (c Gitea) GetOrgRepos(targetOrg string) ([]Repo, error)

GetOrgRepos fetches repo data from a specific group

func (Gitea) GetType

func (_ Gitea) GetType() string

func (Gitea) GetUserRepos

func (c Gitea) GetUserRepos(targetUsername string) ([]Repo, error)

GetUserRepos gets all of a users gitlab repos

func (Gitea) NewClient

func (_ Gitea) NewClient() (Client, error)

NewClient create new gitea scm client

type Github

type Github struct {
	// extend the github client
	*github.Client
	// contains filtered or unexported fields
}

func (Github) GetOrgRepos

func (c Github) GetOrgRepos(targetOrg string) ([]Repo, error)

GetOrgRepos gets org repos

func (Github) GetType

func (_ Github) GetType() string

func (Github) GetUserRepos

func (c Github) GetUserRepos(targetUser string) ([]Repo, error)

GetUserRepos gets user repos

func (Github) NewClient

func (_ Github) NewClient() (Client, error)

NewClient create new github scm client

func (Github) SetTokensUsername added in v1.9.4

func (c Github) SetTokensUsername()

Sets the GitHub username tied to the github token to the package variable tokenUsername Then if https clone method is used the clone url will be https://username:token@github.com/org/repo.git The username is now needed when using the new fine-grained tokens for github

type Gitlab

type Gitlab struct {
	// extend the gitlab client
	*gitlab.Client
}

func (Gitlab) GetGroupRepos added in v1.7.1

func (c Gitlab) GetGroupRepos(targetGroup string) ([]Repo, error)

GetGroupRepos fetches repo data from a specific group

func (Gitlab) GetOrgRepos

func (c Gitlab) GetOrgRepos(targetOrg string) ([]Repo, error)

GetOrgRepos fetches repo data from a specific group

func (Gitlab) GetTopLevelGroups added in v1.7.1

func (c Gitlab) GetTopLevelGroups() ([]string, error)

GetTopLevelGroups all top level org groups

func (Gitlab) GetType

func (_ Gitlab) GetType() string

func (Gitlab) GetUserRepos

func (c Gitlab) GetUserRepos(targetUsername string) ([]Repo, error)

GetUserRepos gets all of a users gitlab repos

func (Gitlab) NewClient

func (_ Gitlab) NewClient() (Client, error)

NewClient create new gitlab scm client

type Repo

type Repo struct {
	Name        string
	HostPath    string
	Path        string
	URL         string
	CloneURL    string
	CloneBranch string
	IsWiki      bool
}

Repo represents an SCM repo

Jump to

Keyboard shortcuts

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