controller

package
v1.0.1-gitspaces-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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 MapCommit

func MapCommit(c *git.Commit) (*types.Commit, error)

func MapRenameDetails

func MapRenameDetails(c *git.RenameDetails) *types.RenameDetails

func MapSignature

func MapSignature(s *git.Signature) (*types.Signature, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL