Documentation
¶
Index ¶
- type Postgres
- func (p *Postgres) DefaultWasSet(chatID int64) (bool, error)
- func (p *Postgres) DeleteBucket(chatID int64, bucketName string) error
- func (p *Postgres) DeleteOption(chatID int64, bucketName string, optionIdx int64) ([]domain.Option, error)
- func (p *Postgres) Exists(chatID int64, bucketName string) (bool, error)
- func (p *Postgres) GetAllBuckets(chatID int64) ([]domain.Bucket, error)
- func (p *Postgres) GetDefaultBucket(chatID int64) (string, error)
- func (p *Postgres) InsertBucket(chatID int64, name string) error
- func (p *Postgres) InsertOption(chatID int64, bucketName string, option domain.Option) error
- func (p *Postgres) ReadAllOptions(chatID int64, bucketName string) ([]domain.Option, error)
- func (p *Postgres) UpdateDefaultBucket(chatID int64, bucketName string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Postgres ¶
Postgres abstraction for Postgresql database
func NewInstance ¶
NewInstance create new connection to Postgres DB this initialization also attempts to migrate the DB to latest version
func (*Postgres) DefaultWasSet ¶
DefaultWasSet check if a default bucket set for a chat
func (*Postgres) DeleteBucket ¶
DeleteBucket remove a bucket from database
func (*Postgres) DeleteOption ¶
func (p *Postgres) DeleteOption(chatID int64, bucketName string, optionIdx int64) ([]domain.Option, error)
DeleteOption remove an option from a bucket
func (*Postgres) GetAllBuckets ¶
GetAllBuckets get all buckets in a chat
func (*Postgres) GetDefaultBucket ¶
GetDefaultBucket get the default bucket of current chat
func (*Postgres) InsertBucket ¶
InsertBucket create a new options bucket
func (*Postgres) InsertOption ¶
InsertOption put an option inside a bucket
func (*Postgres) ReadAllOptions ¶
ReadAllOptions query all options inside a bucket
Click to show internal directories.
Click to hide internal directories.