models

package
v0.0.0-...-e666526 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BroadCastMessage

type BroadCastMessage struct {
	Message  string
	ClientID string
}

type Metadata

type Metadata struct {
}

type PollData

type PollData struct {
	FlatVotes   int
	RoundVotes  int
	TotalVotes  int
	RecentPolls []string
	LatestPun   string
}

type VoteRow

type VoteRow struct {
	ID        *int64          `json:"id"`
	Vote      VoteType        `json:"vote"`
	Metadata  json.RawMessage `json:"metadata"`
	CreatedAt *time.Time      `json:"created_at"`
	SessionID string          `json:"session_id"`
}

type VoteTotalResult

type VoteTotalResult struct {
	Vote  VoteType `json:"vote"`
	Total int      `json:"total"`
}

type VoteType

type VoteType int

VoteType is a custom type to represent the enum

const (
	Flat VoteType = iota
	Round
)

func ParseStringToVoteType

func ParseStringToVoteType(value string) (VoteType, error)

ParseStringToVoteType converts a string to the corresponding VoteType

func ParseVoteType

func ParseVoteType(value int) (VoteType, error)

ParseVoteType converts an integer to the corresponding VoteType

func (*VoteType) Scan

func (v *VoteType) Scan(value interface{}) error

func (VoteType) String

func (v VoteType) String() string

String method to convert VoteType to its string representation

func (VoteType) ToInt

func (v VoteType) ToInt() int

ToInt converts the VoteType back to an integer representation

func (VoteType) Value

func (v VoteType) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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