models

package
v0.0.0-...-402bbba Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INCR = 1
)

Variables

This section is empty.

Functions

func CalculateResult

func CalculateResult()

func GetAllUsers

func GetAllUsers() ([]interface{}, error)

func GetJedi

func GetJedi() (interface{}, error)

func GetSith

func GetSith() (interface{}, error)

func GetVotes

func GetVotes() (interface{}, error)

func StoreCandidate

func StoreCandidate(ca Candidate)

func StoreUser

func StoreUser(opt UserOption) (interface{}, error)

func StoreVote

func StoreVote(cid string) (interface{}, error)

Types

type Candidate

type Candidate struct {
	Id          int    `redis:"Id"`
	Name        string `redis:"Name"`
	Description string `redis:"Description`
	Timestamp   string `redis:"Timestamp"`
}

func GetAllCandidates

func GetAllCandidates() ([]Candidate, error)

func GetCandidateById

func GetCandidateById(cid string) (Candidate, error)

type User

type User struct {
	Name      string    `redis:"Name" json:"Name"`
	Email     string    `redis:"Email" json:"Email"`
	Timestamp string    `redis:"Timestamp" json:"Timestamp"`
	Candidate Candidate `redis:"Candidate" json:"Candidate"`
}

type UserOption

type UserOption struct {
	Cid   string
	Name  string
	Email string
}

type VoteResult

type VoteResult struct {
	Id        int
	Label     string
	VoteCount string
	Pct       string
}

Jump to

Keyboard shortcuts

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