Documentation ¶
Index ¶
- func GetDbPool() *sql.DB
- type Channel
- type ChannelRepository
- type Channels
- type MysqlChannelRepository
- type MysqlPhrasesRepository
- func (r MysqlPhrasesRepository) Create(phrase *Phrase) (*Phrase, error)
- func (r MysqlPhrasesRepository) Get(id int) (*Phrase, error)
- func (r *MysqlPhrasesRepository) GetByOffset(offset int, limit int) (*Phrases, error)
- func (r MysqlPhrasesRepository) GetPhrasesByUserId(senderId string) (*Phrases, error)
- func (r MysqlPhrasesRepository) GetTop(channelId string, count int) ([]*TopElement, error)
- type MysqlUserWisdomRepository
- type Phrase
- type PhraseRepository
- type Phrases
- type TopElement
- type WisdomPhrase
- type WisdomPhrases
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChannelRepository ¶
type MysqlChannelRepository ¶
type MysqlChannelRepository struct {
// contains filtered or unexported fields
}
func NewMysqlChannelRepository ¶
func NewMysqlChannelRepository(ctx context.Context, db *sql.DB) *MysqlChannelRepository
func (*MysqlChannelRepository) Create ¶
func (r *MysqlChannelRepository) Create(channel *Channel) (*Channel, error)
func (*MysqlChannelRepository) GetByOffset ¶
func (r *MysqlChannelRepository) GetByOffset(offset int, limit int) (*Channels, error)
type MysqlPhrasesRepository ¶
type MysqlPhrasesRepository struct {
// contains filtered or unexported fields
}
func NewMysqlPhrasesRepository ¶
func NewMysqlPhrasesRepository(ctx context.Context, db *sql.DB) *MysqlPhrasesRepository
func (MysqlPhrasesRepository) Create ¶
func (r MysqlPhrasesRepository) Create(phrase *Phrase) (*Phrase, error)
func (*MysqlPhrasesRepository) GetByOffset ¶
func (r *MysqlPhrasesRepository) GetByOffset(offset int, limit int) (*Phrases, error)
func (MysqlPhrasesRepository) GetPhrasesByUserId ¶
func (r MysqlPhrasesRepository) GetPhrasesByUserId(senderId string) (*Phrases, error)
func (MysqlPhrasesRepository) GetTop ¶
func (r MysqlPhrasesRepository) GetTop(channelId string, count int) ([]*TopElement, error)
type MysqlUserWisdomRepository ¶
type MysqlUserWisdomRepository struct {
// contains filtered or unexported fields
}
func UserWisdomRepository ¶
func UserWisdomRepository(ctx context.Context, db *sql.DB) *MysqlUserWisdomRepository
func (MysqlUserWisdomRepository) Create ¶
func (r MysqlUserWisdomRepository) Create(phrase *WisdomPhrase) (*WisdomPhrase, error)
func (MysqlUserWisdomRepository) Get ¶
func (r MysqlUserWisdomRepository) Get(authorId string, count int) ([]*WisdomPhrase, error)
type Phrase ¶
type Phrase struct { ID int `json:"id,omitempty"` SenderChannelId string `json:"sender_chan_id,omitempty"` SenderId string `json:"sender_id,omitempty"` SenderName string `json:"sender_name,omitempty"` PhraseText string `json:"phrase,omitempty"` Reply string `json:"reply_id,omitempty"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
type PhraseRepository ¶
type TopElement ¶
type WisdomPhrase ¶
type WisdomPhrases ¶
type WisdomPhrases map[int]*WisdomPhrase
Click to show internal directories.
Click to hide internal directories.