Documentation ¶
Index ¶
- Constants
- func AddBranchPrefix(branch string) string
- func CheckResponseStatusWithBody(resp *http.Response, expectedStatusCodes ...int) error
- func CreateDotGitFolderWithRemote(path, remoteName, remoteUrl string) error
- func CreateToken() string
- func DefaultIfNotNil[T any](val *T) T
- func DiscardResponseBody(resp *http.Response) error
- func GenerateResponseError(status, body string) error
- func GetGenericGitRemoteUrl(apiEndpoint, owner, repo string) string
- func GetZeroValue[T any]() T
- func PointerOf[T any](v T) *T
- func Untar(destDir string, reader io.Reader, shouldRemoveBaseDir bool) (err error)
- func Unzip(zipFileContent []byte, destinationToUnzip string) (err error)
- type VcsProvider
- type WebhookEvent
Constants ¶
View Source
const RemoteName = "origin"
Variables ¶
This section is empty.
Functions ¶
func AddBranchPrefix ¶ added in v1.4.0
AddBranchPrefix adds a branchPrefix to a branch name if it is not already present.
func CheckResponseStatusWithBody ¶ added in v1.5.0
func CreateDotGitFolderWithRemote ¶ added in v1.5.0
CreateDotGitFolderWithRemote creates a .git folder inside path with remote details of remoteName and remoteUrl
func DefaultIfNotNil ¶ added in v1.4.0
func DefaultIfNotNil[T any](val *T) T
DefaultIfNotNil checks: 1. If the pointer is nil, return the zero value of the type 2. If the pointer isn't nil, return the value of the pointer.
func DiscardResponseBody ¶ added in v1.1.0
DiscardResponseBody prepare http response body for closing
func GenerateResponseError ¶ added in v1.5.0
func GetGenericGitRemoteUrl ¶ added in v1.6.2
func GetZeroValue ¶ added in v1.4.0
func GetZeroValue[T any]() T
GetZeroValue returns the zero value of type T
func PointerOf ¶ added in v1.6.0
func PointerOf[T any](v T) *T
PointerOf returns pointer to the provided value if it is not nil.
Types ¶
type VcsProvider ¶
type VcsProvider int
VcsProvider is an enum represents the VCS provider type
const ( // GitHub VCS provider GitHub VcsProvider = iota // GitLab VCS provider GitLab // BitbucketServer VCS provider BitbucketServer // BitbucketCloud VCS provider BitbucketCloud // AzureRepos VCS provider AzureRepos )
func (VcsProvider) String ¶ added in v1.1.0
func (v VcsProvider) String() string
String representation of the VcsProvider
type WebhookEvent ¶
type WebhookEvent string
WebhookEvent is the event type of the incoming webhook
const ( // PrRejected the pull request is rejected PrRejected WebhookEvent = "PrRejected" // PrEdited the pull request is edited PrEdited WebhookEvent = "PrEdited" // PrMerged the pull request is merged PrMerged WebhookEvent = "PrMerged" // PrOpened a pull request is opened PrOpened WebhookEvent = "PrOpened" // Push a commit is pushed to the source branch Push WebhookEvent = "Push" )
Click to show internal directories.
Click to hide internal directories.