Documentation ¶
Index ¶
- type Database
- func (d *Database) Connect() error
- func (d *Database) CreateNote(ctx context.Context) (model.Note, error)
- func (d *Database) DeleteNote(ctx context.Context, id model.ID) error
- func (d *Database) GetNote(ctx context.Context, id model.ID) (model.Note, error)
- func (d *Database) GetNotes(ctx context.Context) ([]model.Note, error)
- func (d *Database) MigrateDown(ctx context.Context) error
- func (d *Database) MigrateUp(ctx context.Context) error
- func (d *Database) Ping(ctx context.Context) error
- func (d *Database) SaveNote(ctx context.Context, n model.Note) error
- type NewDatabaseOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
func NewDatabase ¶
func NewDatabase(opts NewDatabaseOptions) *Database
NewDatabase with the given options. If no logger is provided, logs are discarded.
func (*Database) CreateNote ¶
type NewDatabaseOptions ¶
Click to show internal directories.
Click to hide internal directories.