rate

package
v0.0.0-...-cbaa3f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WilsonSum

func WilsonSum(sum, num int64) int64

Types

type Rate

type Rate struct {
	Id       int64
	ItemType int64
	ItemId   int64

	Rate        int64
	Title       string
	Description string
	Behind      int64
	Against     int64
	Abstained   int64

	Votes  []Vote  `db:"-"`
	Wilson float64 `db:"-"`
}

func (Rate) Create

func (r Rate) Create(Db *gorp.DbMap, itemType int64, itemId int64) Rate

func (Rate) GetRate

func (r Rate) GetRate(Db *gorp.DbMap, itemType int64, itemId int64) Rate

func (Rate) GetRateById

func (r Rate) GetRateById(Db *gorp.DbMap, id int64) Rate

func (Rate) GetVotes

func (r Rate) GetVotes(Db *gorp.DbMap) []Vote

func (Rate) String

func (r Rate) String() string

func (Rate) Vote

func (r Rate) Vote(Db *gorp.DbMap, v string, u int64) (Rate, error)

type Vote

type Vote struct {
	RateId int64

	Value  int64
	UserId int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL