model

package
v0.0.0-...-658978e Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiCandidates

type ApiCandidates struct {
	Key   string  `json:"key"`
	Name  string  `json:"name"`
	Perks []*Perk `json:"perks"`
	Votes int     `json:"votes"`
}

type ApiElectionData

type ApiElectionData struct {
	Year       int              `json:"year"`
	Candidates []*ApiCandidates `json:"candidates"`
}

type ApiElectionResponse

type ApiElectionResponse struct {
	Success     bool            `json:"success"`
	LastUpdated int64           `json:"lastUpdated"`
	Mayor       ApiMayorData    `json:"mayor"`
	Current     ApiElectionData `json:"current"`
}

type ApiMayorData

type ApiMayorData struct {
	Key      string          `json:"key"`
	Name     string          `json:"name"`
	Perks    []*Perk         `json:"perks"`
	Election ApiElectionData `json:"election"`
}

type Candidate

type Candidate struct {
	Name  string  `bson:"name"`
	Key   string  `bson:"key"`
	Perks []*Perk `bson:"perks"`
}

type ElectionPeriod

type ElectionPeriod struct {
	ID         primitive.ObjectID `bson:"_id,omitempty"`
	Year       int                `bson:"year"`
	Start      time.Time          `bson:"start"`
	End        time.Time          `bson:"end"`
	Candidates []*Candidate       `bson:"candidates"`
	Winner     *Candidate         `bson:"winner"`
}

type Perk

type Perk struct {
	Name        string `bson:"name"`
	Description string `bson:"description"`
}

type Vote

type Vote struct {
	MayorKey string `bson:"key"`
	Votes    int    `bson:"votes"`
}

type Voting

type Voting struct {
	ID        primitive.ObjectID `bson:"_id,omitempty"`
	Year      int                `bson:"year"`
	Votes     []*Vote            `bson:"votes"`
	Timestamp time.Time          `bson:"timestamp"`
}

Jump to

Keyboard shortcuts

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