prize

package
v0.0.0-...-7f26107 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrizeCount

func PrizeCount() int

Types

type Prize

type Prize struct {
	ID           int               `json:"id"`
	Title        string            `json:"title"`
	Part         int               `json:"-"`
	Description  string            `json:"description"`
	Image        *url.URL          `json:"image"`
	Winner       survey.SurveyUser `json:"winner"`
	DateAdded    time.Time         `json:"date_added"`
	DateModified time.Time         `json:"date_modified"`
	UserID       int               `json:"-"`
	Deleted      bool              `json:"-"`
	Current      bool              `json:"current"`
	Revisions    []PrizeRevision   `json:"revisions"`
}

func All

func All(skip, take int) ([]Prize, error)

func Current

func Current() (Prize, error)

func (*Prize) Delete

func (p *Prize) Delete() error

func (*Prize) Get

func (p *Prize) Get() error

func (*Prize) PickWinner

func (p *Prize) PickWinner(start, end time.Time) (survey.SurveyUser, error)

func (*Prize) Save

func (p *Prize) Save() error

type PrizeRevision

type PrizeRevision struct {
	ID             int                 `json:"id"`
	NewTitle       *string             `json:"new_title"`
	OldTitle       *string             `json:"old_title"`
	NewDescription *string             `json:"new_description"`
	OldDescription *string             `json:"old_description"`
	NewImage       *url.URL            `json:"new_image"`
	OldImage       *url.URL            `json:"old_image"`
	Date           time.Time           `json:"date"`
	ChangeType     string              `json:"change_type"`
	User           survey.RevisionUser `json:"user"`
}

Jump to

Keyboard shortcuts

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