Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TransactionMetadataKey is the key used to store transaction // information in the gRPC metadata. TransactionMetadataKey = "gitaly-reference-transaction" )
Variables ¶
View Source
var ( // ErrTransactionNotFound indicates the transaction metadata could not // be found ErrTransactionNotFound = errors.New("transaction not found") )
Functions ¶
Types ¶
type Transaction ¶
type Transaction struct { // BackchannelID is the ID of the backchannel that corresponds to the Praefect // that is handling the transaction. This field is filled in by the Gitaly. BackchannelID backchannel.ID `json:"backchannel_id,omitempty"` // ID is the unique identifier of a transaction ID uint64 `json:"id"` // Node is the name used to cast a vote Node string `json:"node"` // Primary identifies the node's role in this transaction Primary bool `json:"primary"` }
Transaction stores parameters required to identify a reference transaction.
func TransactionFromContext ¶
func TransactionFromContext(ctx context.Context) (Transaction, error)
TransactionFromContext extracts `Transaction` from an incoming context. In case the metadata key is not set, the function will return `ErrTransactionNotFound`.
Click to show internal directories.
Click to hide internal directories.