Documentation ¶
Index ¶
- Constants
- func AuthorizedPublicKeyByContent(content string) (string, error)
- func FlushQueues(timeout time.Duration, nonBlocking bool) (int, string)
- func HookPreReceive(ownerName, repoName string, opts HookOptions) (int, string)
- func IsErrServCommand(err error) bool
- func Restart() (int, string)
- func ServNoCommand(keyID int64) (*models.PublicKey, *models.User, error)
- func SetDefaultBranch(ownerName, repoName, branch string) error
- func Shutdown() (int, string)
- func UpdatePublicKeyInRepo(keyID, repoID int64) error
- type ErrServCommand
- type FlushOptions
- type HookOptions
- type HookPostReceiveBranchResult
- type HookPostReceiveResult
- type KeyAndOwner
- type Response
- type ServCommandResults
Constants ¶
const ( GitAlternativeObjectDirectories = "GIT_ALTERNATE_OBJECT_DIRECTORIES" GitObjectDirectory = "GIT_OBJECT_DIRECTORY" GitQuarantinePath = "GIT_QUARANTINE_PATH" )
Git environment variables
Variables ¶
This section is empty.
Functions ¶
func AuthorizedPublicKeyByContent ¶ added in v1.11.0
AuthorizedPublicKeyByContent searches content as prefix (leak e-mail part) and returns public key found.
func FlushQueues ¶ added in v1.12.0
FlushQueues calls the internal flush-queues function
func HookPreReceive ¶ added in v1.9.0
func HookPreReceive(ownerName, repoName string, opts HookOptions) (int, string)
HookPreReceive check whether the provided commits are allowed
func IsErrServCommand ¶ added in v1.9.0
IsErrServCommand checks if an error is a ErrServCommand.
func ServNoCommand ¶ added in v1.9.0
ServNoCommand returns information about the provided key
func SetDefaultBranch ¶ added in v1.11.0
SetDefaultBranch will set the default branch to the provided branch for the provided repository
func UpdatePublicKeyInRepo ¶ added in v1.9.0
UpdatePublicKeyInRepo update public key and if necessary deploy key updates
Types ¶
type ErrServCommand ¶ added in v1.9.0
type ErrServCommand struct { Results ServCommandResults Type string Err string StatusCode int }
ErrServCommand is an error returned from ServCommmand.
func (ErrServCommand) Error ¶ added in v1.9.0
func (err ErrServCommand) Error() string
type FlushOptions ¶ added in v1.12.0
FlushOptions represents the options for the flush call
type HookOptions ¶ added in v1.9.0
type HookOptions struct { OldCommitIDs []string NewCommitIDs []string RefFullNames []string UserID int64 UserName string GitObjectDirectory string GitAlternativeObjectDirectories string GitQuarantinePath string ProtectedBranchID int64 IsDeployKey bool }
HookOptions represents the options for the Hook calls
type HookPostReceiveBranchResult ¶ added in v1.11.0
HookPostReceiveBranchResult represents an individual branch result from PostReceive
type HookPostReceiveResult ¶ added in v1.11.0
type HookPostReceiveResult struct { Results []HookPostReceiveBranchResult RepoWasEmpty bool Err string }
HookPostReceiveResult represents an individual result from PostReceive
func HookPostReceive ¶ added in v1.9.0
func HookPostReceive(ownerName, repoName string, opts HookOptions) (*HookPostReceiveResult, string)
HookPostReceive updates services and users
type KeyAndOwner ¶ added in v1.9.0
KeyAndOwner is the response from ServNoCommand
type ServCommandResults ¶ added in v1.9.0
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 ¶ added in v1.9.0
func ServCommand(keyID int64, ownerName, repoName string, mode models.AccessMode, verbs ...string) (*ServCommandResults, error)
ServCommand preps for a serv call