gitea: Index | Files

package private

import ""


Package Files

hook.go internal.go key.go serv.go


const (
    GitAlternativeObjectDirectories = "GIT_ALTERNATE_OBJECT_DIRECTORIES"
    GitObjectDirectory              = "GIT_OBJECT_DIRECTORY"
    GitQuarantinePath               = "GIT_QUARANTINE_PATH"

Git environment variables

func HookPostReceive Uses

func HookPostReceive(ownerName, repoName string, opts HookOptions) (map[string]interface{}, string)

HookPostReceive updates services and users

func HookPreReceive Uses

func HookPreReceive(ownerName, repoName string, opts HookOptions) (int, string)

HookPreReceive check whether the provided commits are allowed

func IsErrServCommand Uses

func IsErrServCommand(err error) bool

IsErrServCommand checks if an error is a ErrServCommand.

func ServNoCommand Uses

func ServNoCommand(keyID int64) (*models.PublicKey, *models.User, error)

ServNoCommand returns information about the provided key

func UpdatePublicKeyInRepo Uses

func UpdatePublicKeyInRepo(keyID, repoID int64) error

UpdatePublicKeyInRepo update public key and if necessary deploy key updates

type ErrServCommand Uses

type ErrServCommand struct {
    Results    ServCommandResults
    Type       string
    Err        string
    StatusCode int

ErrServCommand is an error returned from ServCommmand.

func (ErrServCommand) Error Uses

func (err ErrServCommand) Error() string

type HookOptions Uses

type HookOptions struct {
    OldCommitID                     string
    NewCommitID                     string
    RefFullName                     string
    UserID                          int64
    UserName                        string
    GitObjectDirectory              string
    GitAlternativeObjectDirectories string
    GitQuarantinePath               string
    ProtectedBranchID               int64
    IsDeployKey                     bool

HookOptions represents the options for the Hook calls

type KeyAndOwner Uses

type KeyAndOwner struct {
    Key   *models.PublicKey `json:"key"`
    Owner *models.User      `json:"user"`

KeyAndOwner is the response from ServNoCommand

type Response Uses

type Response struct {
    Err string `json:"err"`

Response internal request response

type ServCommandResults Uses

type ServCommandResults struct {
    IsWiki      bool
    IsDeployKey bool
    KeyID       int64
    KeyName     string
    UserName    string
    UserID      int64
    OwnerName   string
    RepoName    string
    RepoID      int64

ServCommandResults are the results of a call to the private route serv

func ServCommand Uses

func ServCommand(keyID int64, ownerName, repoName string, mode models.AccessMode, verbs ...string) (*ServCommandResults, error)

ServCommand preps for a serv call

Package private imports 9 packages (graph) and is imported by 6 packages. Updated 2019-12-07. Refresh now. Tools for package owners.