db

package
v0.0.0-...-e9c67b5 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateProject

func CreateProject(p Project) error

func CreateTimer

func CreateTimer(user, name string) error

CreateTimer creates a new running timer

func CreateUser

func CreateUser(u User) error

func GormConn

func GormConn() (gorm.DB, error)

func HerokuConnection

func HerokuConnection() string

func RemoveSetting

func RemoveSetting(user string, name string) (bool, error)

func SaveUser

func SaveUser(u User) error

func SetSetting

func SetSetting(user string, name string, value string) error

func SetupDB

func SetupDB()

func StartPokerSession

func StartPokerSession(channel, title, users string) error

StartPokerSession starts a poker session for a given channel

func UpdateProject

func UpdateProject(p Project) error

func UpdateUser

func UpdateUser(u User) error

Types

type PokerSession

type PokerSession struct {
	ID         int
	Channel    string
	Title      string
	Users      string
	FinishedAt *time.Time
	Stories    []PokerStory
}

PokerSession is session of poker planning

func GetCurrentSession

func GetCurrentSession(channel string) (*PokerSession, error)

GetCurrentSession returns the current session for the given channel or nil if no current session for the channel

func (*PokerSession) Finish

func (s *PokerSession) Finish() error

Finish ends a PokerSession

func (*PokerSession) GetCurrentStory

func (s *PokerSession) GetCurrentStory() (*PokerStory, error)

GetCurrentStory returns the most recent story with no estimation (or assumed to be in the process of estimation)

func (*PokerSession) GetEstimatedStories

func (s *PokerSession) GetEstimatedStories() ([]PokerStory, error)

GetEstimatedStories returns all the stories for a given PokerSession that has not been estimated yet

func (*PokerSession) GetStories

func (s *PokerSession) GetStories() ([]PokerStory, error)

GetStories returns all stories for a given PokerSession in order of creation date

func (*PokerSession) StartPokerStory

func (s *PokerSession) StartPokerStory(title string) error

StartPokerStory creates a new PokerStory. This story will then be considered the "current" story of a poker planning session

type PokerStory

type PokerStory struct {
	ID         int
	Session    PokerSession
	SessionID  int
	Title      string
	Estimation *float32
}

PokerStory is a story within a PokerSession

func (*PokerStory) CastVote

func (s *PokerStory) CastVote(user, vote string) error

CastVote tracks a vote for a given user

func (*PokerStory) GetVotes

func (s *PokerStory) GetVotes() ([]PokerVote, error)

GetVotes returns all votes for a given PokerStory

func (*PokerStory) UpdateEstimation

func (s *PokerStory) UpdateEstimation(estimation string) error

UpdateEstimation sets the estimation of a given PokerStory

type PokerVote

type PokerVote struct {
	ID      int
	Story   PokerStory
	StoryID int
	User    string
	Vote    float32
}

PokerVote is a user's vote for a story

type Project

type Project struct {
	Id               int
	Name             string
	Channel          string
	PivotalId        int64
	MavenlinkId      int64
	MvnSprintStoryId string
	CreatedBy        string
}

func GetProject

func GetProject(id int64) (*Project, error)

func GetProjectBy

func GetProjectBy(field string, s string) (*Project, error)

func GetProjectByChannel

func GetProjectByChannel(channel string) (*Project, error)

func GetProjectByName

func GetProjectByName(name string) (*Project, error)

func GetProjects

func GetProjects() ([]Project, error)

func (Project) StrPivotalId

func (p Project) StrPivotalId() string

type Setting

type Setting struct {
	Id    int
	User  string
	Name  string
	Value string
}

func GetSetting

func GetSetting(user string, name string) (*Setting, error)

func GetSettings

func GetSettings(user string) ([]Setting, error)

type Timer

type Timer struct {
	ID         int
	User       string
	Name       string
	CreatedAt  *time.Time
	FinishedAt *time.Time
}

Timer tracks task timers for users

func GetRunningTimers

func GetRunningTimers(user string) ([]Timer, error)

func GetStartedTimerByName

func GetStartedTimerByName(user, name string) (*Timer, error)

func GetTimer

func GetTimer(id int) (*Timer, error)

func GetTimerByName

func GetTimerByName(user, name string) (*Timer, error)

func (*Timer) Duration

func (timer *Timer) Duration() string

func (*Timer) IsFinished

func (timer *Timer) IsFinished() bool

func (*Timer) Minutes

func (timer *Timer) Minutes() int

func (*Timer) Reload

func (timer *Timer) Reload() (*Timer, error)

Reload reloads the timer, returning a new instance

func (*Timer) Status

func (timer *Timer) Status() string

func (*Timer) Stop

func (timer *Timer) Stop() error

Stop finishes a running timer

type User

type User struct {
	Id          *int
	Name        string
	PivotalId   *int64
	MavenlinkId *int64
}

func GetUserBy

func GetUserBy(field string, s string) (*User, error)

func GetUserByName

func GetUserByName(name string) (*User, error)

func GetUsers

func GetUsers() ([]User, error)

func (User) StrPivotalId

func (u User) StrPivotalId() string

type Vacation

type Vacation struct {
	ID          int
	User        string
	StartDate   *time.Time
	EndDate     *time.Time
	Description string
}

func CreateVacation

func CreateVacation(user string, desc string, start *time.Time, end *time.Time) (*Vacation, error)

func GetCurrentVacations

func GetCurrentVacations() ([]Vacation, error)

func GetVacations

func GetVacations() ([]Vacation, error)

Jump to

Keyboard shortcuts

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