Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Datastore ¶
type Datastore[R, W any] interface { // Read starts a read only transaction. Read(context.Context, func(context.Context, R) error) error // ReadWriteTx starts a read write transaction. ReadWrite(context.Context, func(context.Context, W) error) error }
Datastore provides methods for transactional operations.
func NewDatastore ¶
func NewDatastore[R, W any](client client.SdkClient, r ReadFactory[R], rw ReadWriteFactory[W]) (Datastore[R, W], error)
NewDatastore returns a new instance of db.
type DatastoreError ¶
type DatastoreError struct { // Details are details to the operation Details string // Err is the error that occurred. Err error }
DatastoreError is an error that occurred while executing a operation.
func NewDatastoreError ¶
func NewDatastoreError(details string, err error) *DatastoreError
NewDatastoreError returns a new QueryError.
func (*DatastoreError) Error ¶
func (e *DatastoreError) Error() string
Error implements the error interface.
func (*DatastoreError) Unwrap ¶
func (e *DatastoreError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type ReadFactory ¶
ReadFactory is a function that creates a new instance of Datastore.
Click to show internal directories.
Click to hide internal directories.