Documentation ¶
Overview ¶
Package transaction provides a reusable component for creating and closing a request scope in gRPC.
Index ¶
Constants ¶
View Source
const ( // ErrNotEnoughTime is returned as a gRPC error message. ErrNotEnoughTime = "Not enough time in context" // ErrDB is returned as a gRPC error message. ErrDB = "Database error" // ErrAuth is returned as a gRPC error message. ErrAuth = "Authentication server error" // ErrGroup is returned as a gRPC error message. ErrGroup = "User not in required group" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { Ctx context.Context Tx boil.ContextTransactor Log *logrus.Entry ReadOnly bool Claims *jwt.Claims // contains filtered or unexported fields }
Request holds a database transaction, request context and a logrus entry.
func New ¶
func New(ctx context.Context, log *logrus.Entry, mdb *multidb.MultiDB, readOnly bool, routines ...int) (*Request, error)
New Request opens a transaction on mdb. If the transaction is readonly, routines amount of Nodes will be requested.
type Verificator ¶ added in v0.2.0
type Verificator struct {
verify.Verificator
}
Verificator can be used to open authenticated transactions.
func NewVerificator ¶ added in v0.2.0
func NewVerificator(ctx context.Context, entry *logrus.Entry, target string, audiences ...string) (*Verificator, error)
NewVerificator dials the target authentication gRPC server and keeps retrying untill the context expires.
Click to show internal directories.
Click to hide internal directories.