Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewErrAlreadyExists ¶
NewErrAlreadyExists wraps a message in an ErrAlreadyExists object.
Types ¶
type DB ¶
type DB interface { GeminiIdentity Instance Close(ctx context.Context) Error DoMigration(ctx context.Context) Error TxNew(ctx context.Context) (TxID, Error) TxCommit(ctx context.Context, id TxID) Error TxRollback(ctx context.Context, id TxID) Error }
DB represents a database client.
type ErrAlreadyExists ¶
type ErrAlreadyExists struct {
// contains filtered or unexported fields
}
ErrAlreadyExists is returned when a caller tries to insert a database entry that already exists in the db.
func (*ErrAlreadyExists) Error ¶
func (e *ErrAlreadyExists) Error() string
Error returns the error message as a string.
type Error ¶
type Error error
Error represents a database specific error.
var ( // ErrGenID is returned when creating a new ID can't be generated for a new model. ErrGenID Error = fmt.Errorf("can't generate id") // ErrNoEntries is returned when a caller expected an entry for a query, but none was found. ErrNoEntries Error = fmt.Errorf("no entries") // ErrMultipleEntries is returned when a caller expected ONE entry for a query, but multiples were found. ErrMultipleEntries Error = fmt.Errorf("multiple entries") // ErrUnknown denotes an unknown database error. ErrUnknown Error = fmt.Errorf("unknown error") )
type GeminiIdentity ¶
Click to show internal directories.
Click to hide internal directories.