utils

package
v1.19.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 15 Imported by: 155

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOrgHook

func AddOrgHook(ctx *context.APIContext, form *api.CreateHookOption)

AddOrgHook add a hook to an organization. Writes to `ctx` accordingly

func AddRepoHook

func AddRepoHook(ctx *context.APIContext, form *api.CreateHookOption)

AddRepoHook add a hook to a repo. Writes to `ctx` accordingly

func AddSystemHook added in v1.19.0

func AddSystemHook(ctx *context.APIContext, form *api.CreateHookOption)

AddSystemHook add a system hook

func CheckCreateHookOption

func CheckCreateHookOption(ctx *context.APIContext, form *api.CreateHookOption) bool

CheckCreateHookOption check if a CreateHookOption form is valid. If invalid, write the appropriate error to `ctx`. Return whether the form is valid

func ConvertToSHA1 added in v1.18.0

func ConvertToSHA1(ctx *context.Context, commitID string) (git.SHA1, error)

ConvertToSHA1 returns a full-length SHA1 from a potential ID string

func EditOrgHook

func EditOrgHook(ctx *context.APIContext, form *api.EditHookOption, hookID int64)

EditOrgHook edit webhook `w` according to `form`. Writes to `ctx` accordingly

func EditRepoHook

func EditRepoHook(ctx *context.APIContext, form *api.EditHookOption, hookID int64)

EditRepoHook edit webhook `w` according to `form`. Writes to `ctx` accordingly

func EditSystemHook added in v1.19.0

func EditSystemHook(ctx *context.APIContext, form *api.EditHookOption, hookID int64)

EditSystemHook edit system webhook `w` according to `form`. Writes to `ctx` accordingly

func GetGitRefs added in v1.15.0

func GetGitRefs(ctx *context.APIContext, filter string) ([]*git.Reference, string, error)

GetGitRefs return git references based on filter

func GetListOptions added in v1.12.0

func GetListOptions(ctx *context.APIContext) db.ListOptions

GetListOptions returns list options using the page and limit parameters

func GetOrgHook

func GetOrgHook(ctx *context.APIContext, orgID, hookID int64) (*webhook.Webhook, error)

GetOrgHook get an organization's webhook. If there is an error, write to `ctx` accordingly and return the error

func GetRepoHook

func GetRepoHook(ctx *context.APIContext, repoID, hookID int64) (*webhook.Webhook, error)

GetRepoHook get a repo's webhook. If there is an error, write to `ctx` accordingly and return the error

func MustConvertToSHA1 added in v1.18.0

func MustConvertToSHA1(ctx *context.Context, commitID string) string

MustConvertToSHA1 returns a full-length SHA1 string from a potential ID string, or returns origin input if it can't convert to SHA1

func ResolveRefOrSha added in v1.15.0

func ResolveRefOrSha(ctx *context.APIContext, ref string) string

ResolveRefOrSha resolve ref to sha if exist

Types

This section is empty.

Jump to

Keyboard shortcuts

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