gitea: Index | Files

package private

import ""


Package Files

hook.go internal.go key.go mail.go manager.go serv.go


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

Git environment variables

const (
    GitPushOptionRepoPrivate  = "repo.private"
    GitPushOptionRepoTemplate = "repo.template"

GitPushOptions keys

func AddLogger Uses

func AddLogger(group, name, mode string, config map[string]interface{}) (int, string)

AddLogger adds a logger

func AuthorizedPublicKeyByContent Uses

func AuthorizedPublicKeyByContent(content string) (string, error)

AuthorizedPublicKeyByContent searches content as prefix (leak e-mail part) and returns public key found.

func FlushQueues Uses

func FlushQueues(timeout time.Duration, nonBlocking bool) (int, string)

FlushQueues calls the internal flush-queues function

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 PauseLogging Uses

func PauseLogging() (int, string)

PauseLogging pauses logging

func ReleaseReopenLogging Uses

func ReleaseReopenLogging() (int, string)

ReleaseReopenLogging releases and reopens logging files

func RemoveLogger Uses

func RemoveLogger(group, name string) (int, string)

RemoveLogger removes a logger

func Restart Uses

func Restart() (int, string)

Restart calls the internal restart function

func ResumeLogging Uses

func ResumeLogging() (int, string)

ResumeLogging resumes logging

func SendEmail Uses

func SendEmail(subject, message string, to []string) (int, string)

SendEmail calls the internal SendEmail function

It accepts a list of usernames. If DB contains these users it will send the email to them.

If to list == nil its supposed to send an email to every user present in DB

func ServNoCommand Uses

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

ServNoCommand returns information about the provided key

func SetDefaultBranch Uses

func SetDefaultBranch(ownerName, repoName, branch string) error

SetDefaultBranch will set the default branch to the provided branch for the provided repository

func Shutdown Uses

func Shutdown() (int, string)

Shutdown calls the internal shutdown function

func UpdatePublicKeyInRepo Uses

func UpdatePublicKeyInRepo(keyID, repoID int64) error

UpdatePublicKeyInRepo update public key and if necessary deploy key updates

type Email Uses

type Email struct {
    Subject string
    Message string
    To      []string

Email structure holds a data for sending general emails

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 FlushOptions Uses

type FlushOptions struct {
    Timeout     time.Duration
    NonBlocking bool

FlushOptions represents the options for the flush call

type GitPushOptions Uses

type GitPushOptions map[string]string

GitPushOptions is a wrapper around a map[string]string

func (GitPushOptions) Bool Uses

func (g GitPushOptions) Bool(key string, def bool) bool

Bool checks for a key in the map and parses as a boolean

type HookOptions Uses

type HookOptions struct {
    OldCommitIDs                    []string
    NewCommitIDs                    []string
    RefFullNames                    []string
    UserID                          int64
    UserName                        string
    GitObjectDirectory              string
    GitAlternativeObjectDirectories string
    GitQuarantinePath               string
    GitPushOptions                  GitPushOptions
    ProtectedBranchID               int64
    IsDeployKey                     bool

HookOptions represents the options for the Hook calls

type HookPostReceiveBranchResult Uses

type HookPostReceiveBranchResult struct {
    Message bool
    Create  bool
    Branch  string
    URL     string

HookPostReceiveBranchResult represents an individual branch result from PostReceive

type HookPostReceiveResult Uses

type HookPostReceiveResult struct {
    Results      []HookPostReceiveBranchResult
    RepoWasEmpty bool
    Err          string

HookPostReceiveResult represents an individual result from PostReceive

func HookPostReceive Uses

func HookPostReceive(ownerName, repoName string, opts HookOptions) (*HookPostReceiveResult, string)

HookPostReceive updates services and users

type KeyAndOwner Uses

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

KeyAndOwner is the response from ServNoCommand

type LoggerOptions Uses

type LoggerOptions struct {
    Group  string
    Name   string
    Mode   string
    Config map[string]interface{}

LoggerOptions represents the options for the add logger call

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
    UserEmail   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 12 packages (graph) and is imported by 9 packages. Updated 2020-12-12. Refresh now. Tools for package owners.