Documentation ¶
Index ¶
Constants ¶
View Source
const (
// TypePostgres holder for postgres database.
TypePostgres = "POSTGRES"
)
Variables ¶
This section is empty.
Functions ¶
func NewErrAlreadyExists ¶
NewErrAlreadyExists wraps a message in an AlreadyExistsError object.
Types ¶
type AcceptedTermsURL ¶
type Account ¶
type Account interface { CreateAccount(ctx context.Context, account *models.Account) Error // ReadAccountByToken(ctx context.Context, token string) (*models.Account, Error) ReadAccountByUserID(ctx context.Context, userID string) (*models.Account, Error) UpdateAccount(ctx context.Context, account *models.Account) Error }
type AlreadyExistsError ¶
type AlreadyExistsError struct {
// contains filtered or unexported fields
}
AlreadyExistsError is returned when a caller tries to insert a database entry that already exists in the db.
func (*AlreadyExistsError) Error ¶
func (e *AlreadyExistsError) Error() string
Error returns the error message as a string.
type DB ¶
type DB interface { AcceptedTermsURL Account EphemeralPublicKey Token // Close closes the db connections Close(ctx context.Context) Error // DoMigration runs database migrations DoMigration(ctx context.Context) Error }
DB represents a database client.
type EphemeralPublicKey ¶
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") )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.