Documentation ¶
Index ¶
- Constants
- func AddLogger(ctx context.Context, group, name, mode string, config map[string]interface{}) (int, string)
- func AuthorizedPublicKeyByContent(ctx context.Context, content string) (string, error)
- func FlushQueues(ctx context.Context, timeout time.Duration, nonBlocking bool) (int, string)
- func HookPreReceive(ctx context.Context, ownerName, repoName string, opts HookOptions) (int, string)
- func IsErrServCommand(err error) bool
- func PauseLogging(ctx context.Context) (int, string)
- func ReleaseReopenLogging(ctx context.Context) (int, string)
- func RemoveLogger(ctx context.Context, group, name string) (int, string)
- func Restart(ctx context.Context) (int, string)
- func RestoreRepo(ctx context.Context, repoDir, ownerName, repoName string, units []string) (int, string)
- func ResumeLogging(ctx context.Context) (int, string)
- func SSHLog(ctx context.Context, isErr bool, msg string) error
- func SendEmail(ctx context.Context, subject, message string, to []string) (int, string)
- func ServNoCommand(ctx context.Context, keyID int64) (*asymkey_model.PublicKey, *user_model.User, error)
- func SetDefaultBranch(ctx context.Context, ownerName, repoName, branch string) error
- func Shutdown(ctx context.Context) (int, string)
- func UpdatePublicKeyInRepo(ctx context.Context, keyID, repoID int64) error
- type Email
- type ErrServCommand
- type FlushOptions
- type GitPushOptions
- type HookOptions
- type HookPostReceiveBranchResult
- type HookPostReceiveResult
- type HookProcReceiveRefResult
- type HookProcReceiveResult
- type KeyAndOwner
- type LoggerOptions
- type Response
- type RestoreParams
- type SSHLogOption
- type ServCommandResults
Constants ¶
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
Variables ¶
This section is empty.
Functions ¶
func AddLogger ¶ added in v1.13.0
func AddLogger(ctx context.Context, group, name, mode string, config map[string]interface{}) (int, string)
AddLogger adds a logger
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(ctx context.Context, 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 PauseLogging ¶ added in v1.13.0
PauseLogging pauses logging
func ReleaseReopenLogging ¶ added in v1.13.0
ReleaseReopenLogging releases and reopens logging files
func RemoveLogger ¶ added in v1.13.0
RemoveLogger removes a logger
func RestoreRepo ¶ added in v1.14.3
func RestoreRepo(ctx context.Context, repoDir, ownerName, repoName string, units []string) (int, string)
RestoreRepo calls the internal RestoreRepo function
func ResumeLogging ¶ added in v1.13.0
ResumeLogging resumes logging
func SendEmail ¶ added in v1.14.0
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 ¶ added in v1.9.0
func ServNoCommand(ctx context.Context, keyID int64) (*asymkey_model.PublicKey, *user_model.User, error)
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
Types ¶
type ErrServCommand ¶ added in v1.9.0
type ErrServCommand struct { Results ServCommandResults 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 GitPushOptions ¶ added in v1.13.0
GitPushOptions is a wrapper around a map[string]string
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 GitPushOptions GitPushOptions PullRequestID int64 IsDeployKey bool IsWiki 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(ctx context.Context, ownerName, repoName string, opts HookOptions) (*HookPostReceiveResult, string)
HookPostReceive updates services and users
type HookProcReceiveRefResult ¶ added in v1.16.0
type HookProcReceiveRefResult struct { OldOID string NewOID string Ref string OriginalRef string IsForcePush bool IsNotMatched bool Err string }
HookProcReceiveRefResult represents an individual result from ProcReceive
type HookProcReceiveResult ¶ added in v1.16.0
type HookProcReceiveResult struct { Results []HookProcReceiveRefResult Err string }
HookProcReceiveResult represents an individual result from ProcReceive
func HookProcReceive ¶ added in v1.16.0
func HookProcReceive(ctx context.Context, ownerName, repoName string, opts HookOptions) (*HookProcReceiveResult, error)
HookProcReceive proc-receive hook
type KeyAndOwner ¶ added in v1.9.0
type KeyAndOwner struct { Key *asymkey_model.PublicKey `json:"key"` Owner *user_model.User `json:"user"` }
KeyAndOwner is the response from ServNoCommand
type LoggerOptions ¶ added in v1.13.0
LoggerOptions represents the options for the add logger call
type RestoreParams ¶ added in v1.14.3
RestoreParams structure holds a data for restore repository
type SSHLogOption ¶ added in v1.15.0
SSHLogOption ssh log options
type ServCommandResults ¶ added in v1.9.0
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 ¶ added in v1.9.0
func ServCommand(ctx context.Context, keyID int64, ownerName, repoName string, mode perm.AccessMode, verbs ...string) (*ServCommandResults, error)
ServCommand preps for a serv call