Documentation
¶
Index ¶
- func NewPostgresDB(cfg Config) (*sqlx.DB, error)
- type Config
- type CsvRaw
- type Repository
- type Segment
- type SegmentPostgres
- type User
- type UserPostgres
- func (r *UserPostgres) AddSegmentRecord(userId int, segmentId int, ttl string, actionType string) error
- func (r *UserPostgres) GetSegmentId(title string) (int, error)
- func (r *UserPostgres) GetUsersCurrentSegments(userId int) ([]string, error)
- func (r *UserPostgres) GetUsersSegmentsHistory(fromDate string, toDate string) ([]CsvRaw, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Repository ¶
func NewRepository ¶
func NewRepository(db *sqlx.DB) *Repository
type SegmentPostgres ¶
type SegmentPostgres struct {
// contains filtered or unexported fields
}
func NewSegmentPostgres ¶
func NewSegmentPostgres(db *sqlx.DB) *SegmentPostgres
func (*SegmentPostgres) CreateSegment ¶
func (r *SegmentPostgres) CreateSegment(title string) error
func (*SegmentPostgres) DeleteSegment ¶
func (r *SegmentPostgres) DeleteSegment(title string) error
type UserPostgres ¶
type UserPostgres struct {
// contains filtered or unexported fields
}
func NewUserPostgres ¶
func NewUserPostgres(db *sqlx.DB) *UserPostgres
func (*UserPostgres) AddSegmentRecord ¶
func (*UserPostgres) GetSegmentId ¶
func (r *UserPostgres) GetSegmentId(title string) (int, error)
func (*UserPostgres) GetUsersCurrentSegments ¶
func (r *UserPostgres) GetUsersCurrentSegments(userId int) ([]string, error)
func (*UserPostgres) GetUsersSegmentsHistory ¶
func (r *UserPostgres) GetUsersSegmentsHistory(fromDate string, toDate string) ([]CsvRaw, error)
Click to show internal directories.
Click to hide internal directories.