models

package
v0.0.0-...-dafb618 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliasContext

type AliasContext struct {
	ChannelID  string
	UserID     string
	Args       []string
	ArgsString string
}

AliasContext objects are passed into an alias's value template when the alias is executed

type Aliases

type Aliases map[string]string

The Aliases object is used to manage aliases in a db.Store

func (Aliases) Apply

func (a Aliases) Apply(m *slack.MessageEvent) error

Apply will update the MessageEvent's text if it matches any of the Aliases' patterns

type Candidate

type Candidate struct {
	Name      string
	ManagerID string
	Meta      map[string]string
}

Candidate models hold information about a specific candidate

type Candidates

type Candidates []Candidate

The Candidates object is used to manage Candidate instances in a db.Store by using the Candidates' names as keys

func (Candidates) Get

func (c Candidates) Get(name string) (Candidate, bool)

Get will return the candidate with the matching name. The name is not case sensitive. A bool is also returned denoting if the candidate exists or not.

func (Candidates) Len

func (c Candidates) Len() int

Len is a method to satisfy sort.Interface

func (Candidates) Less

func (c Candidates) Less(i, j int) bool

Less is a method to satisfy sort.Interface

func (Candidates) Sort

func (c Candidates) Sort(ascending bool)

Sort will sort the candidates by their name. If ascending is true, names are sorted by alphabetical order. If ascending is false, names are sorted by reverse alphabetical order.

func (Candidates) Swap

func (c Candidates) Swap(i, j int)

Swap is a method to satisfy sort.Interface

type Glossary

type Glossary map[string]string

The Glossary object is used to manage a Glossary in a db.Store

func (Glossary) SortKeys

func (g Glossary) SortKeys(ascending bool) []string

SortKeys will return a slice of alphabetically ordered keys. If ascending is true, keys are returned in alphabetical order. If ascending is false, keys are returned in reverse alphabetical order.

type Interview

type Interview struct {
	Candidate      string
	InterviewerIDs []string
	Time           time.Time
}

Interview models hold information about a single interview instance

func (Interview) Equals

func (i Interview) Equals(other Interview) bool

type Interviews

type Interviews []Interview

The Interviews object is used to manage Interview instances in a db.Store

func (Interviews) Len

func (n Interviews) Len() int

Len is a method to satisfy sort.Interface

func (Interviews) Less

func (n Interviews) Less(i, j int) bool

Less is a method to satisfy sort.Interface

func (Interviews) Sort

func (n Interviews) Sort(ascending bool)

Sort will sort the interviews by their time. If ascending is true, names are sorted in chronological order. If ascending is false, names are sorted by reverse chronological order.

func (Interviews) Swap

func (n Interviews) Swap(i, j int)

Swap is a method to satisfy sort.Interface

type Karma

type Karma struct {
	Upvotes   int
	Downvotes int
}

Karma models hold information about a specific karma instance

func (Karma) String

func (k Karma) String() string

String returns a string representation of a Karma

type Karmas

type Karmas map[string]Karma

The Karmas object is used to manage Karma instances in a db.Store

func (Karmas) SortKeys

func (k Karmas) SortKeys(ascending bool) []string

SortKeys will return a slice of ordered keys. If ascending is true, keys with the lowest karma are returned first. If ascending is false, keys with the highest karma are returned first.

type TriviaQuestion

type TriviaQuestion struct {
	Question         string
	CorrectAnswer    string
	IncorrectAnswers []string
}

Trivia models hold information about a specific trivia question

func (TriviaQuestion) String

func (t TriviaQuestion) String() string

String will return a string representation of the question and all possible answers

Jump to

Keyboard shortcuts

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