Documentation ¶
Index ¶
- type Database
- type PaginationOptions
- type Postgres
- func (d *Postgres) Add(entries ...*entry.Entry) error
- func (d *Postgres) Been() ([]string, error)
- func (d *Postgres) ByDate(opts *QueryOptions, year, month, day int) ([]string, error)
- func (d *Postgres) ByProperty(opts *QueryOptions, property, value string) ([]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) GetAll(opts *QueryOptions) ([]string, error)
- func (d *Postgres) GetDeleted(opts *PaginationOptions) ([]string, error)
- func (d *Postgres) GetDrafts(opts *PaginationOptions) ([]string, error)
- func (d *Postgres) GetPrivate(opts *PaginationOptions, audience string) ([]string, error)
- func (d *Postgres) GetTags() ([]string, error)
- func (d *Postgres) GetUnlisted(opts *PaginationOptions) ([]string, error)
- func (d *Postgres) ReadsSummary() (*entry.ReadsSummary, error)
- func (d *Postgres) Remove(id string)
- func (d *Postgres) Search(opts *QueryOptions, query string) ([]string, error)
- func (d *Postgres) SectionsCount() (map[string]int, error)
- func (d *Postgres) WatchesSummary() (*entry.WatchesSummary, 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) GetDeleted(opts *PaginationOptions) ([]string, error) GetDrafts(opts *PaginationOptions) ([]string, error) GetUnlisted(opts *PaginationOptions) ([]string, error) GetPrivate(opts *PaginationOptions, audience string) ([]string, error) GetAll(opts *QueryOptions) ([]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) ByProperty(opts *QueryOptions, property, value string) ([]string, error) ReadsSummary() (*entry.ReadsSummary, error) WatchesSummary() (*entry.WatchesSummary, error) Been() ([]string, error) SectionsCount() (map[string]int, error) }
func NewDatabase ¶
func NewDatabase(cfg *config.PostgreSQL) (Database, error)
type PaginationOptions ¶
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)
func (*Postgres) ByProperty ¶
func (d *Postgres) ByProperty(opts *QueryOptions, property, value string) ([]string, error)
func (*Postgres) BySection ¶
func (d *Postgres) BySection(opts *QueryOptions, sections ...string) ([]string, error)
func (*Postgres) GetDeleted ¶
func (d *Postgres) GetDeleted(opts *PaginationOptions) ([]string, error)
func (*Postgres) GetDrafts ¶
func (d *Postgres) GetDrafts(opts *PaginationOptions) ([]string, error)
func (*Postgres) GetPrivate ¶
func (d *Postgres) GetPrivate(opts *PaginationOptions, audience string) ([]string, error)
func (*Postgres) GetUnlisted ¶
func (d *Postgres) GetUnlisted(opts *PaginationOptions) ([]string, error)
func (*Postgres) ReadsSummary ¶
func (d *Postgres) ReadsSummary() (*entry.ReadsSummary, error)
func (*Postgres) Search ¶
func (d *Postgres) Search(opts *QueryOptions, query string) ([]string, error)
func (*Postgres) WatchesSummary ¶
func (d *Postgres) WatchesSummary() (*entry.WatchesSummary, error)
type QueryOptions ¶
type QueryOptions struct { PaginationOptions WithDrafts bool WithDeleted bool // Empty matches all visibilities. Visibility []entry.Visibility // Empty matches all audiences. Audience string }
Click to show internal directories.
Click to hide internal directories.