Documentation
¶
Index ¶
- func CreateRPCExternalWriteParams(ctx context.Context, urlProvider url.Provider, session *auth.Session, ...) (git.WriteParams, error)
- func CreateRPCInternalWriteParams(ctx context.Context, urlProvider url.Provider, session *auth.Session, ...) (git.WriteParams, error)
- func MapCommit(c *git.Commit) (*types.Commit, error)
- func MapRenameDetails(c *git.RenameDetails) *types.RenameDetails
- func MapSignature(s *git.Signature) (*types.Signature, error)
- func TxOptLock(ctx context.Context, tx dbtx.Transactor, txFn func(ctx context.Context) error, ...) (err error)
- type TxOptionResetFunc
- type TxOptionRetryCount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRPCExternalWriteParams ¶
func CreateRPCExternalWriteParams( ctx context.Context, urlProvider url.Provider, session *auth.Session, repo *types.Repository, ) (git.WriteParams, error)
CreateRPCExternalWriteParams creates base write parameters for git external write operations. External write operations are direct git pushes.
func CreateRPCInternalWriteParams ¶
func CreateRPCInternalWriteParams( ctx context.Context, urlProvider url.Provider, session *auth.Session, repo *types.Repository, ) (git.WriteParams, error)
CreateRPCInternalWriteParams creates base write parameters for git internal write operations. Internal write operations are git pushes that originate from the Gitness server.
func MapRenameDetails ¶
func MapRenameDetails(c *git.RenameDetails) *types.RenameDetails
func TxOptLock ¶
func TxOptLock(ctx context.Context, tx dbtx.Transactor, txFn func(ctx context.Context) error, opts ...interface{}, ) (err error)
TxOptLock runs the provided function inside a database transaction. If optimistic lock error occurs during the operation, the function will retry the whole transaction again (to the maximum of 5 times, but this can be overridden by providing an additional TxOptionRetryCount option).
Types ¶
type TxOptionResetFunc ¶
type TxOptionResetFunc func()
TxOptionResetFunc transaction provides a function that will be executed before the transaction retry. A transaction started with TxOptLock will be automatically retried in case of version conflict error.
type TxOptionRetryCount ¶
type TxOptionRetryCount int
TxOptionRetryCount transaction option allows setting number of transaction executions reties. A transaction started with TxOptLock will be automatically retried in case of version conflict error.