Documentation ¶
Index ¶
- type Database
- type Postgres
- func (d *Postgres) Add(entries ...*entry.Entry) error
- func (d *Postgres) ByDate(opts *QueryOptions, year, month, day int) ([]string, error)
- func (d *Postgres) BySection(opts *QueryOptions, sections ...string) ([]string, error)
- func (d *Postgres) ByTag(opts *QueryOptions, tag string) ([]string, error)
- func (d *Postgres) Close()
- func (d *Postgres) GetTags() ([]string, error)
- func (d *Postgres) Remove(id string)
- func (d *Postgres) Search(opts *QueryOptions, query string) ([]string, error)
- type QueryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface { Close() Remove(id string) Add(...*entry.Entry) error GetTags() ([]string, error) Search(opt *QueryOptions, query string) ([]string, error) ByTag(opt *QueryOptions, tag string) ([]string, error) BySection(opt *QueryOptions, sections ...string) ([]string, error) ByDate(opts *QueryOptions, year, month, day int) ([]string, error) }
func NewDatabase ¶
func NewDatabase(cfg *config.PostgreSQL) (Database, error)
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func (*Postgres) ByDate ¶
func (d *Postgres) ByDate(opts *QueryOptions, year, month, day int) ([]string, error)
Click to show internal directories.
Click to hide internal directories.