scrum

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	First iteration = iota
	Last
)

Variables

View Source
var SlackParams = slack.PostMessageParameters{AsUser: true, LinkNames: 1}

Functions

This section is empty.

Types

type Config

type Config struct {
	Timezone string       `json:"timezone"`
	Teams    []TeamConfig `json:"teams"`
}

Config is the configuration format

func (*Config) ToTeams

func (c *Config) ToTeams() []*Team

type ConfigurationProvider

type ConfigurationProvider interface {
	Config() *Config
	OnChange(handler func(cfg *Config))
}
{
  "timezone": "America/Montreal",
  "teams": [
    {
      "channel": "general",
      "name": "L337",
      "members": [
        "fboutin2",
        "lbourdages",
        "pa",
        "jo"
      ],
      "split_report": false,
      "question_sets": [
        {
          "questions": [
            "What did you do yesterday?",
            "What will you do today?",
            "Are you being blocked by someone for a review? who ? why ?",
            "How will you dominate the world"
          ],
          "report_schedule_cron": "@every 30s",
          "first_reminder_limit": "-8s",
          "last_reminder_limit": "-3s"
        }
      ]
    }
  ]
}

func NewConfigWatcher

func NewConfigWatcher(file string) ConfigurationProvider

type QuestionSet

type QuestionSet struct {
	Questions                 []string
	ReportSchedule            cron.Schedule
	FirstReminderBeforeReport time.Duration
	LastReminderBeforeReport  time.Duration
}

type QuestionSetConfig

type QuestionSetConfig struct {
	Questions                 []string `json:"questions"`
	ReportScheduleCron        string   `json:"report_schedule_cron"`
	FirstReminderBeforeReport string   `json:"first_reminder_limit"`
	LastReminderBeforeReport  string   `json:"last_reminder_limit"`
}
{
  "timezone": "America/Montreal",
  "teams": [
    {
      "channel": "general",
      "name": "L337",
      "members": [
        "fboutin2",
        "lbourdages",
        "pa",
        "jo"
      ],
      "split_report": false,
      "question_sets": [
        {
          "questions": [
            "What did you do yesterday?",
            "What will you do today?",
            "Are you being blocked by someone for a review? who ? why ?",
            "How will you dominate the world"
          ],
          "report_schedule_cron": "@every 30s",
          "first_reminder_limit": "-8s",
          "last_reminder_limit": "-3s"
        }
      ]
    }
  ]
}

type Report

type Report struct {
	User    string
	Team    string
	Skipped bool
	// questions / answers
	Answers map[string]string
}

type ScrumReminderJob

type ScrumReminderJob struct {
	*TeamState
	*QuestionSet
	// contains filtered or unexported fields
}

func (ScrumReminderJob) AddToOutOfOffice

func (m ScrumReminderJob) AddToOutOfOffice(team string, username string)

func (ScrumReminderJob) DeleteLastReport

func (m ScrumReminderJob) DeleteLastReport(user string) bool

func (ScrumReminderJob) GetQuestionSetsForTeam

func (m ScrumReminderJob) GetQuestionSetsForTeam(team string) []*QuestionSet

func (ScrumReminderJob) GetTeamByName added in v0.15.1

func (m ScrumReminderJob) GetTeamByName(teamName string) (*TeamState, error)

func (ScrumReminderJob) GetTeamsForUser

func (m ScrumReminderJob) GetTeamsForUser(username string) []string

func (ScrumReminderJob) RemoveFromOutOfOffice

func (m ScrumReminderJob) RemoveFromOutOfOffice(team string, username string)

func (*ScrumReminderJob) Run

func (job *ScrumReminderJob) Run()

func (ScrumReminderJob) SaveReport

func (m ScrumReminderJob) SaveReport(report *Report, qs *QuestionSet)

type ScrumReportJob

type ScrumReportJob struct {
	*TeamState
	*QuestionSet
}

func (ScrumReportJob) AddToOutOfOffice

func (m ScrumReportJob) AddToOutOfOffice(team string, username string)

func (ScrumReportJob) DeleteLastReport

func (m ScrumReportJob) DeleteLastReport(user string) bool

func (ScrumReportJob) GetQuestionSetsForTeam

func (m ScrumReportJob) GetQuestionSetsForTeam(team string) []*QuestionSet

func (ScrumReportJob) GetTeamByName added in v0.15.1

func (m ScrumReportJob) GetTeamByName(teamName string) (*TeamState, error)

func (ScrumReportJob) GetTeamsForUser

func (m ScrumReportJob) GetTeamsForUser(username string) []string

func (ScrumReportJob) RemoveFromOutOfOffice

func (m ScrumReportJob) RemoveFromOutOfOffice(team string, username string)

func (*ScrumReportJob) Run

func (job *ScrumReportJob) Run()

func (ScrumReportJob) SaveReport

func (m ScrumReportJob) SaveReport(report *Report, qs *QuestionSet)

type Service

type Service interface {
	DeleteLastReport(username string) bool
	GetTeamByName(teamName string) (*TeamState, error)
	GetTeamsForUser(username string) []string
	GetQuestionSetsForTeam(team string) []*QuestionSet
	SaveReport(report *Report, qs *QuestionSet)
	AddToOutOfOffice(team string, username string)
	RemoveFromOutOfOffice(team string, username string)
}

func NewService

func NewService(configurationProvider ConfigurationProvider, slackBotAPI *slack.Client) Service

type Team

type Team struct {
	Name          string
	Channel       string
	Members       []string
	QuestionsSets []*QuestionSet
	Timezone      *time.Location
	OutOfOffice   []string
	SplitReport   bool
}

type TeamConfig

type TeamConfig struct {
	Name         string              `json:"name"`
	Channel      string              `json:"channel"`
	Members      []string            `json:"members"`
	QuestionSets []QuestionSetConfig `json:"question_sets"`
	Timezone     string              `json:"timezone"`
	SplitReport  bool                `json:"split_report"`
}
{
  "timezone": "America/Montreal",
  "teams": [
    {
      "channel": "general",
      "name": "L337",
      "members": [
        "fboutin2",
        "lbourdages",
        "pa",
        "jo"
      ],
      "split_report": false,
      "question_sets": [
        {
          "questions": [
            "What did you do yesterday?",
            "What will you do today?",
            "Are you being blocked by someone for a review? who ? why ?",
            "How will you dominate the world"
          ],
          "report_schedule_cron": "@every 30s",
          "first_reminder_limit": "-8s",
          "last_reminder_limit": "-3s"
        }
      ]
    }
  ]
}

func (*TeamConfig) ToTeam

func (tc *TeamConfig) ToTeam() *Team

type TeamState

type TeamState struct {
	*Team
	*cron.Cron
	// contains filtered or unexported fields
}

func (TeamState) AddToOutOfOffice

func (m TeamState) AddToOutOfOffice(team string, username string)

func (TeamState) DeleteLastReport

func (m TeamState) DeleteLastReport(user string) bool

func (TeamState) GetQuestionSetsForTeam

func (m TeamState) GetQuestionSetsForTeam(team string) []*QuestionSet

func (TeamState) GetTeamByName added in v0.15.1

func (m TeamState) GetTeamByName(teamName string) (*TeamState, error)

func (TeamState) GetTeamsForUser

func (m TeamState) GetTeamsForUser(username string) []string

func (TeamState) RemoveFromOutOfOffice

func (m TeamState) RemoveFromOutOfOffice(team string, username string)

func (TeamState) SaveReport

func (m TeamState) SaveReport(report *Report, qs *QuestionSet)

Jump to

Keyboard shortcuts

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