Documentation ¶
Index ¶
- type Competition
- type Database
- func (db *Database) GetCompetitionByID(id int64) (*Competition, error)
- func (db *Database) GetCompetitions(rangeID int64, activeOnly bool) ([]Competition, error)
- func (db *Database) GetRangeByID(id int64) (*Range, error)
- func (db *Database) GetRanges(activeOnly bool) ([]Range, error)
- func (db *Database) GetUserByID(id int64) (*User, error)
- func (db *Database) GetUserByLogin(login string, activeOly bool) (*User, error)
- func (db *Database) InvalidateToken(login, token string, validTo time.Time) error
- func (db *Database) IsTokenInvalid(login, token string) bool
- type InvalidToken
- type Range
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Competition ¶
type Competition struct { ID int64 `db:"ID"` Name string `db:"NAME"` EventDate time.Time `db:"EVENT_DATE"` RangeID int64 `db:"RANGE_ID"` CategoryID int64 `db:"CATEGORY_ID"` TypeID int64 `db:"TYPE_ID"` Active bool `db:"ACTIVE"` Created time.Time `db:"CREATED_TS"` CategoryCode string `db:"CATEGORY_CODE"` CategoryName string `db:"CATEGORY_NAME"` TypeCode string `db:"TYPE_CODE"` TypeName string `db:"TYPE_NAME"` RangeName string `db:"RANGE_NAME"` }
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database is wrapper around database connection
func NewMysqlDatabase ¶
func (*Database) GetCompetitionByID ¶
func (db *Database) GetCompetitionByID(id int64) (*Competition, error)
func (*Database) GetCompetitions ¶
func (db *Database) GetCompetitions(rangeID int64, activeOnly bool) ([]Competition, error)
func (*Database) GetUserByLogin ¶
func (*Database) InvalidateToken ¶
func (*Database) IsTokenInvalid ¶
type InvalidToken ¶
type Range ¶
type Range struct { ID int64 `db:"ID"` Name string `db:"NAME"` Latitude float64 `db:"LATITUDE"` Longitude float64 `db:"LONGITUDE"` URL string `db:"URL"` Active bool `db:"ACTIVE"` Created time.Time `db:"CREATED_TS"` }
Range represents records in ranges table
type User ¶
type User struct { ID int64 `db:"ID"` Login string `db:"LOGIN"` Password string `db:"PASSWORD"` RoleCompetitor bool `db:"ROLE_COMPETITOR"` RoleJudge bool `db:"ROLE_JUDGE"` RoleDirector bool `db:"ROLE_DIRECTOR"` RoleAdmin bool `db:"ROLE_ADMIN"` Active bool `db:"ACTIVE"` Created time.Time `db:"CREATED_TS"` }
User represents records in users table
Click to show internal directories.
Click to hide internal directories.