gitscm

package
v1.6.7-0...-b28dd99 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HookForm

type HookForm struct {
	Branch      bool `json:"branch" valid:"required"`
	Push        bool `json:"push" valid:"required"`
	PullRequest bool `json:"pullRequest" valid:"required"`
	Tag         bool `json:"tag" valid:"required"`
}

HookForm struct for saving webhooks.

type SCM

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

SCM represents source code management instance.

func New

func New(ctx context.Context, provider, url, token string) (SCM, error)

New returns new instance of SCM.

func (SCM) Client

func (s SCM) Client() *scm.Client

Client returns underlying scm client.

func (SCM) CreateHook

func (s SCM) CreateHook(repo, target, secret, provider string, data HookForm) (*scm.Hook, error)

CreateHook creates hook for specified repository.

func (SCM) CreateStatus

func (s SCM) CreateStatus(repo, sha, url string, state scm.State) error

CreateStatus sends build status to SCM provider.

func (SCM) DeleteHook

func (s SCM) DeleteHook(repo string, ID string) error

DeleteHook deletes webhook by ID.

func (SCM) FindBranch

func (s SCM) FindBranch(repo, name string) (*scm.Reference, error)

FindBranch finds a git branch by name.

func (SCM) FindCommit

func (s SCM) FindCommit(repo, ref string) (*scm.Commit, error)

FindCommit finds commit.

func (SCM) FindContent

func (s SCM) FindContent(repo, ref, path string) (*scm.Content, error)

FindContent finds content of a repository file.

func (SCM) FindRepo

func (s SCM) FindRepo(name string) (*scm.Repository, error)

FindRepo finds repository.

func (SCM) FindTag

func (s SCM) FindTag(repo, name string) (*scm.Reference, error)

FindTag finds a git tag by name.

func (SCM) LastCommit

func (s SCM) LastCommit(repo, branch string) (*scm.Commit, error)

LastCommit returns last commit.

func (SCM) ListCommits

func (s SCM) ListCommits(repo, branch string) ([]*scm.Commit, error)

ListCommits returns list of commits.

func (SCM) ListContent

func (s SCM) ListContent(repo, ref, path string) ([]*scm.Content, error)

ListContent returns a list of contents in a repo directory by path.

func (SCM) ListHooks

func (s SCM) ListHooks(repo string) ([]*scm.Hook, error)

ListHooks returns webhooks applied for the repository.

func (SCM) ListRepos

func (s SCM) ListRepos(page, size int) ([]*scm.Repository, error)

ListRepos returns list of repositories.

func (SCM) RefType

func (s SCM) RefType(ref string) string

RefType returns reference type.

Jump to

Keyboard shortcuts

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