utils

package
v0.0.0-...-e61ee7f Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOwnerHook

func AddOwnerHook(ctx *context.APIContext, owner *user_model.User, form *api.CreateHookOption)

AddOwnerHook adds a hook to an user or organization

func AddRepoHook

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

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

func AddSystemHook

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

AddSystemHook add a system hook

func ConvertToObjectID

func ConvertToObjectID(ctx gocontext.Context, repo *context.Repository, commitID string) (git.ObjectID, error)

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

func DeleteOwnerHook

func DeleteOwnerHook(ctx *context.APIContext, owner *user_model.User, hookID int64)

DeleteOwnerHook deletes the hook owned by the owner.

func EditOwnerHook

func EditOwnerHook(ctx *context.APIContext, owner *user_model.User, form *api.EditHookOption, hookID int64)

EditOwnerHook updates a webhook of an user or organization

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

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

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

func GetGitRefs

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

GetGitRefs return git references based on filter

func GetListOptions

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

GetListOptions returns list options using the page and limit parameters

func GetOwnerHook

func GetOwnerHook(ctx *context.APIContext, ownerID, hookID int64) (*webhook.Webhook, error)

GetOwnerHook gets an user or organization webhook. Errors are written to ctx.

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 ListOwnerHooks

func ListOwnerHooks(ctx *context.APIContext, owner *user_model.User)

ListOwnerHooks lists the webhooks of the provided owner

func MustConvertToSHA1

func MustConvertToSHA1(ctx gocontext.Context, repo *context.Repository, 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

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