Documentation ¶
Index ¶
- func DeleteItemVotes(db *sql.DB, itemid []byte) *governor.Error
- func DeletePostVotes(db *sql.DB, postid []byte) *governor.Error
- func GetScoreByID(db *sql.DB, itemid []byte) (int32, int32, *governor.Error)
- func GetScoreByIDB64(db *sql.DB, itemid string) (int32, int32, *governor.Error)
- func ParseB64ToUID(idb64 string) (*uid.UID, *governor.Error)
- func ParseUIDToB64(postid []byte) (*uid.UID, *governor.Error)
- func Setup(db *sql.DB) *governor.Error
- type Model
- func GetByIDB64(db *sql.DB, itemid, userid string) (*Model, *governor.Error)
- func New(itemid, postid, group, userid string, score int16) (*Model, *governor.Error)
- func NewDown(itemid, postid, group, userid string) (*Model, *governor.Error)
- func NewDownPost(postid, group, userid string) (*Model, *governor.Error)
- func NewPost(postid, group, userid string, score int16) (*Model, *governor.Error)
- func NewUp(itemid, postid, group, userid string) (*Model, *governor.Error)
- func NewUpPost(postid, group, userid string) (*Model, *governor.Error)
- func (m *Model) Delete(db *sql.DB) *governor.Error
- func (m *Model) Down()
- func (m *Model) IDBase64() (string, *governor.Error)
- func (m *Model) Insert(db *sql.DB) *governor.Error
- func (m *Model) IsDown() bool
- func (m *Model) IsUp() bool
- func (m *Model) PostIDBase64() (string, *governor.Error)
- func (m *Model) Up()
- func (m *Model) Update(db *sql.DB) *governor.Error
- func (m *Model) Voteid() []byte
- type ModelInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteItemVotes ¶
DeleteItemVotes deletes all the votes of an item
func DeletePostVotes ¶
DeletePostVotes deletes all the votes of a post
func GetScoreByID ¶
GetScoreByID returns the score of an item
func GetScoreByIDB64 ¶
GetScoreByIDB64 returns the score of an item
func ParseB64ToUID ¶
ParseB64ToUID converts a base64 into a UID
func ParseUIDToB64 ¶
ParseUIDToB64 converts a UID into base64
Types ¶
type Model ¶
type Model struct { ModelInfo Postid []byte `json:"postid"` Group string `json:"group"` Time int64 `json:"time"` }
Model is the db Vote model
func GetByIDB64 ¶
GetByIDB64 returns a vote model with the given base64 ids
func NewDownPost ¶
NewDownPost creates a new downvote for a post
func (*Model) PostIDBase64 ¶
PostIDBase64 returns the post as a base64 encoded string
type ModelInfo ¶
type ModelInfo struct { Itemid []byte `json:"itemid"` Userid string `json:"userid"` Score int16 `json:"score"` }
ModelInfo is the core vote information
func GetVotesGroupByUser ¶
GetVotesGroupByUser returns the votes of a user for a group
func GetVotesThreadByUser ¶
GetVotesThreadByUser returns the votes of a user for a thread
Click to show internal directories.
Click to hide internal directories.