git

package
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRepoName

func GetRepoName(u *url.URL) (string, error)

TODO: this likely won't work for GitLab projects because it assumes that the path is always composed of two elements. GetRepoName takes a URL of the form https://github.com/my-org/my-repo.git and attempts to determine the name of the repo from this, i.e. "my-org/my-repo".

Types

type Repository

type Repository struct {
	*scm.Client
	// contains filtered or unexported fields
}

Repository represent a Git repository ofa specific Git repository URL

func NewRepository

func NewRepository(rawURL, token string) (*Repository, error)

NewRepository creates a new Git repository object

func (*Repository) CreateWebhook

func (r *Repository) CreateWebhook(listenerURL, secret string) (string, error)

CreateWebhook creates a new webhook in the repository It returns ID of the created webhook

func (*Repository) DeleteWebhooks

func (r *Repository) DeleteWebhooks(ids []string) ([]string, error)

DeleteWebhooks deletes all webhooks that associate with the given listener in this repository

func (*Repository) ListWebhooks

func (r *Repository) ListWebhooks(listenerURL string) ([]string, error)

ListWebhooks returns a list of webhook IDs of the given listener in this repository

Jump to

Keyboard shortcuts

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