tiktokmod

package
v4.1.0-0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: LGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllowMembersLabel = "DEMO"

AllowMembersLabel - Default label name for cards to ignore "face"/"owner" alerts

View Source
var BacklogName = "Backlog"

BacklogName - Default name of Backlog List

View Source
var DoneName = "Done"

DoneName - Default name of Done List

View Source
var LabelRO = "ROLL-OVER"

LabelRO - Default name of Roll-over Label

View Source
var NextSprintName = "Next Sprint"

NextSprintName - Default name of Next Sprint List

View Source
var RFRName = "Ready for Review"

RFRName - Default name of PR List

View Source
var ReadyForWork = "Ready for Work"

ReadyForWork - Default name of Ready for Work List

View Source
var Scoped = "Scoped"

Scoped - Default name of Backlog List

View Source
var SilenceCardLabel = "TikTok Hush"

SilenceCardLabel - Default label name for label that will disable 98% of tiktok monitoring/alerting

View Source
var SprintName = "Sprint"

SprintName - Default name of custom Field for sprint name

View Source
var SprintPoints = "Burndown"

SprintPoints - Default name of custom field for story points

View Source
var TemplateLabelID = "TEMPLATE CARD DO NOT MOVE"

TemplateLabelID - Default label name of Template cards

View Source
var TrainingLabel = "Training"

TrainingLabel - Default label name for training cards

View Source
var Upcoming = "Upcoming"

Upcoming - Default name of Upcoming/Un-Scoped List

View Source
var WorkingName = "Working"

WorkingName - Default name of Working List

Functions

func AddBoardMember

func AddBoardMember(tiktok *TikTokConf, boardID string, memberID string) error

AddBoardMember - Add a trello member to a board

func AddDBUser

func AddDBUser(tiktok *TikTokConf, users UserData) bool

AddDBUser - Put user data into DB

func AlertRunner

func AlertRunner(opts Config, tiktok *TikTokConf) (string, error)

AlertRunner - Run the alerts in Planning / Next Sprint / Ready for Work / Working

func ArchiveBacklog

func ArchiveBacklog(tiktok *TikTokConf, opts Config) (err error)

ArchiveBacklog - Archive old cards in the backlog

func AssignCollection

func AssignCollection(boardID string, collectionID string, tiktok *TikTokConf) string

AssignCollection - Assign a board to a speific collection (via its ID)

func Between

func Between(value string, a string, b string) string

Between - find string between two chars

func BuildConfig

func BuildConfig(boardID string, tiktok *TikTokConf, user string, api *slack.Client)

BuildConfig - grab UID's out of trello to help setup config files

func CardPlay

func CardPlay(tiktok *TikTokConf, opts Config, channelResponse string, teamID string, csv bool)

CardPlay - Pull card timing data and dump to CSV

func CardPosition

func CardPosition(tiktok *TikTokConf, cardID string, position string) error

CardPosition - change card position

func CheckActionCards

func CheckActionCards(tiktok *TikTokConf, opts Config, teamID string)

CheckActionCards - Loop through retro boards and verify all retro cards are checked for in-action

func CheckBugs

func CheckBugs(opts Config, tiktok *TikTokConf) (critBugNum int)

CheckBugs - Check for bugs and alert on them

func CheckThemes

func CheckThemes(tiktok *TikTokConf, opts Config, listID string) (amessage string, err error)

CheckThemes - Check that cards in a specific list have Theme Labels, returns formatted output

func CleanBackLog

func CleanBackLog(opts Config, tiktok *TikTokConf) error

CleanBackLog - Clean-up BackLog

func CleanDone

func CleanDone(opts Config, tiktok *TikTokConf) (string, error)

CleanDone - Clean Done column of old cards

func CommentCard

func CommentCard(cardID string, comment string, tiktok *TikTokConf) error

CommentCard - add a comment to a card

func ConnectDB

func ConnectDB(tiktok *TikTokConf, dbName string) (db *sql.DB, status bool, err error)

ConnectDB - establish gsql connection to db

func CreateCard

func CreateCard(cardName string, listID string, tiktok *TikTokConf) error

CreateCard - custom card creation

func CreateList

func CreateList(boardID string, listName string, tiktok *TikTokConf) error

CreateList - adlio doesn't have this function so here it is

func DownloadFile

func DownloadFile(filepath string, url string) error

DownloadFile - download (stream copy) a file from a URL to the local file system

func DupeTable

func DupeTable(tiktok *TikTokConf, newTableName string, existTableName string) error

DupeTable - Duplicates table inside CloudSQL DB

func DupeTrelloBoard

func DupeTrelloBoard(boardID string, newName string, trelloOrg string, tiktok *TikTokConf) (output string, err error)

DupeTrelloBoard - Duplicate an entire trello board and assign it to the Dupe Collection

func EpicLink(tiktok *TikTokConf, opts Config)

EpicLink - Verify feature cards are linked to Epics

func FindToml

func FindToml(tiktok *TikTokConf) (tomls []os.FileInfo, err error)

FindToml - Get list of TOML files

func GetAllPoints

func GetAllPoints(tiktok *TikTokConf, opts Config, sOpts SprintData) (message string, valid bool)

GetAllPoints - GetAll Points in a sprint

func GetCardPoints

func GetCardPoints(opts Config, tiktok *TikTokConf, cardID string) (points int)

GetCardPoints - Get the points on a card from the power-up

func GetColumn

func GetColumn(opts Config, someString string) (columnID string, colName string)

GetColumn - determine which column was specified in a request (Default: BackLog)

func GetCreateDate

func GetCreateDate(tiktok *TikTokConf, cardID string) (createDate time.Time, err error)

GetCreateDate - Retrieve creation date of a trello card

func GetIgnoreLabels

func GetIgnoreLabels(tiktok *TikTokConf, boardID string) (ignoreLabels []string, err error)

GetIgnoreLabels - get all label IDs that should be ignored for a board

func GetMemberInfo

func GetMemberInfo(headID string, tiktok *TikTokConf) (fullname string, avatarhash string, userName string)

GetMemberInfo - get members data

func GetSquadMembership

func GetSquadMembership(tiktok *TikTokConf, dbUserID int, sprintName string) (userList []string, err error)

GetSquadMembership - Get list of squads a user is part of in a given sprint

func GetTimePutList

func GetTimePutList(listID string, cardID string, opts Config, tiktok *TikTokConf) (found bool, cardListTime time.Time)

GetTimePutList - Get datetime card was last put in a given list

func GitPR

func GitPR(tiktok *TikTokConf, repoName string, PRID int, org string) (pull *github.PullRequest, err error)

GitPR - retrieve a single PR in a repo

func GitPRList

func GitPRList(tiktok *TikTokConf, repoName string, org string) (pulls []*github.PullRequest, err error)

GitPRList - retrieve all PRs in a repo

func Help

func Help(tiktok *TikTokConf, user string, api *slack.Client)

Help - Help return message

func HolidayTroll

func HolidayTroll(tiktok *TikTokConf, teamID string, job string, dummy bool)

HolidayTroll - TikTok Holiday messaging Cron

func LabelIgnore

func LabelIgnore(opts Config, tiktok *TikTokConf, labelID string) error

LabelIgnore - add a label to the ignore table

func ListAllTOML

func ListAllTOML(tiktok *TikTokConf) (message string)

ListAllTOML - list all the available TOML files in a string

func LogToSlack

func LogToSlack(message string, tiktok *TikTokConf, attachments Attachment)

LogToSlack - Dump Logs to a Slack Channel

func MoveCardList

func MoveCardList(tiktok *TikTokConf, cardID string, newList string) error

MoveCardList - Move a card to a different list

func PRSummary

func PRSummary(opts Config, tiktok *TikTokConf) (output string, err error)

PRSummary - Summarize PR Column

func Permissions

func Permissions(tiktok *TikTokConf, slackID string, action string, api *slack.Client, chkchannel string) bool

Permissions - determine if user has permissions to do something

func PointCleanup

func PointCleanup(opts Config, tiktok *TikTokConf, teamID string) (rtnMessage string)

PointCleanup - module to syncronize points between Plugins and Customfields

func PostSnippet

func PostSnippet(tiktok *TikTokConf, fileType string, fileContent string, channel string, title string) error

PostSnippet - Post a snippet of any type to slack channel

func PutCardData

func PutCardData(tiktok *TikTokConf, allCardData CardReportData, teamID string) error

PutCardData - put card data to DB instead of CSV

func PutCustomField

func PutCustomField(cardID string, customID string, tiktok *TikTokConf, someValueType string, somevalue string) (err error)

PutCustomField - Write data to custom card fields power-up

func PutDBSprint

func PutDBSprint(tiktok *TikTokConf, sOpts SprintData) error

PutDBSprint - Put sprint data into DB

func PutThemeCount

func PutThemeCount(tiktok *TikTokConf, allTheme Themes, sOpts SprintData, teamID string) error

PutThemeCount - Update board theme counts for reporting

func ReOrderCardInList

func ReOrderCardInList(tiktok *TikTokConf, cardID string, newPos string) error

ReOrderCardInList - Change placement of a card in a list newPos == "top", "bottom" or positive float

func RecordChapterCount

func RecordChapterCount(tiktok *TikTokConf, chapterName string, listName string, cardCount int, teamName string) bool

RecordChapterCount - Record points for sprint per squad

func RecordChapters

func RecordChapters(tiktok *TikTokConf, teamID string, listName string) error

RecordChapters - Record Chapter card info to SQL DB per specified column/list

func RecordSquadSprintData

func RecordSquadSprintData(tiktok *TikTokConf, totalPoints Squads, sprintName string, nonPoints int) bool

RecordSquadSprintData - Record points for sprint per squad

func RemoveHead

func RemoveHead(tiktok *TikTokConf, cardID string, memberID string) error

RemoveHead - Remove member from trello card

func Responder

func Responder(lowerString string, tiktok *TikTokConf, ev *slack.MessageEvent, rtm *slack.RTM)

Responder - check for chatty messages that need responses not actions

func RetrieveOrgRepo

func RetrieveOrgRepo(tiktok *TikTokConf, orgName string) (repos []*github.Repository)

RetrieveOrgRepo - retrieve list of repositories for an Organization

func RetrieveRepo

func RetrieveRepo(tiktok *TikTokConf) (repos []*github.Repository)

RetrieveRepo - retrieve list of repositories for the API user

func RetrieveUsers

func RetrieveUsers(tiktok *TikTokConf, org string) (users []*github.User)

RetrieveUsers - retrieve list of Users

func RetroCheck

func RetroCheck(tiktok *TikTokConf, opts Config, boardID string) (err error)

RetroCheck - Check a specified Retro board for un-finished action cards

func SanityCheck

func SanityCheck(ConfigLocation string, ms GeneralOptions) (sane bool, output string)

SanityCheck - Check for Valid Config file. Determines struct values exist and are not blank

func Send

func Send(webhookURL string, proxy string, payload Payload) []error

Send - send message

func SendAlert

func SendAlert(tiktok *TikTokConf, opts Config, alertType string)

SendAlert - send a slack alert message about a sprint meeting reminder (standup/demo/retro/wdw)

func SkipColumn

func SkipColumn(tiktok *TikTokConf, skippedColumn string, cardID string) (skipped bool)

SkipColumn - check if a card was ever in a specific column

func SkippedPR

func SkippedPR(tiktok *TikTokConf, opts Config)

SkippedPR - Alert if cards have skipped PR column

func SliceExists

func SliceExists(tiktok *TikTokConf, slice interface{}, item interface{}) bool

SliceExists - Determine if value is in a slice

func Sprint

func Sprint(opts Config, tiktok *TikTokConf, retroNo bool) (message string, err error)

Sprint - Verify sprint is acceptable to execute then do or do not

func StalePRcards

func StalePRcards(opts Config, tiktok *TikTokConf) (message string, err error)

StalePRcards - Check for cards that are aged out in the PR column

func StandardCron

func StandardCron(tiktok *TikTokConf, teamID string, job string, holiday bool)

StandardCron - Execute requested cron job

func SyncPoints

func SyncPoints(teamID string, listID string, opts Config, tiktok *TikTokConf) (messasge string, apMessage string, err error)

SyncPoints - sync points between Agile power-up and custom field in the provided column

func TemplateCard

func TemplateCard(tiktok *TikTokConf, opts Config)

TemplateCard - Check for template cards and move them to top of backlog

func Wrangler

func Wrangler(webhookURL string, message string, myChannel string, emojiName string, attachments Attachment)

Wrangler - wrangle slack calls

func WranglerDM

func WranglerDM(tiktok *TikTokConf, payload BotDMPayload) error

WranglerDM - Send chat.Post API DM messages "as the bot"

Types

type Attachment

type Attachment struct {
	Fallback   string   `json:"fallback,omitempty"`
	Color      string   `json:"color,omitempty"`
	PreText    string   `json:"pretext,omitempty"`
	AuthorName string   `json:"author_name,omitempty"`
	AuthorLink string   `json:"author_link,omitempty"`
	AuthorIcon string   `json:"author_icon,omitempty"`
	Title      string   `json:"title,omitempty"`
	TitleLink  string   `json:"title_link,omitempty"`
	Text       string   `json:"text,omitempty"`
	ImageURL   string   `json:"image_url,omitempty"`
	Fields     []*Field `json:"fields,omitempty"`
	Footer     string   `json:"footer,omitempty"`
	FooterIcon string   `json:"footer_icon,omitempty"`
	Timestamp  int64    `json:"ts,omitempty"`
	MarkdownIn []string `json:"mrkdwn_in,omitempty"`
}

Attachment - struct

func (*Attachment) AddField

func (attachment *Attachment) AddField(field Field) *Attachment

AddField - add fields

type AttachmentPreview

type AttachmentPreview struct {
	ID     string `json:"_id"`
	URL    string `json:"url"`
	Width  int    `json:"width"`
	Height int    `json:"height"`
	Bytes  int    `json:"bytes"`
	Scaled bool   `json:"scaled"`
}

AttachmentPreview - struct for attachment preview data

type BasicSlackPayload

type BasicSlackPayload struct {
	Ok    bool   `json:"ok"`
	Error string `json:"error"`
}

BasicSlackPayload - returns most basic slack response payload

func ChannelInvite

func ChannelInvite(tiktok *TikTokConf, channelID string, userID string) (slackPayload BasicSlackPayload, err error)

ChannelInvite - Invite a user to a specific channel. Expects slack channel ID and user ID not slack names

func ChannelTopicSet

func ChannelTopicSet(tiktok *TikTokConf, channelID string, topic string) (slackPayload BasicSlackPayload, err error)

ChannelTopicSet - Set topic in a channel. Expects slack channel ID not name. Bot MUST be in channel to work

func UnArchiveChannel

func UnArchiveChannel(tiktok *TikTokConf, channelID string) (slackPayload BasicSlackPayload, err error)

UnArchiveChannel - un-archive a slack channel and return payload. must send channel slackID, not channel name

type BoardData

type BoardData struct {
	ID             string      `json:"id"`
	Name           string      `json:"name"`
	Desc           string      `json:"desc"`
	DescData       interface{} `json:"descData"`
	Closed         bool        `json:"closed"`
	IDOrganization string      `json:"idOrganization"`
	Pinned         bool        `json:"pinned"`
	URL            string      `json:"url"`
	ShortURL       string      `json:"shortUrl"`
	Prefs          struct {
		PermissionLevel       string `json:"permissionLevel"`
		Voting                string `json:"voting"`
		Comments              string `json:"comments"`
		Invitations           string `json:"invitations"`
		SelfJoin              bool   `json:"selfJoin"`
		CardCovers            bool   `json:"cardCovers"`
		CardAging             string `json:"cardAging"`
		CalendarFeedEnabled   bool   `json:"calendarFeedEnabled"`
		Background            string `json:"background"`
		BackgroundImage       string `json:"backgroundImage"`
		BackgroundImageScaled []struct {
			Width  int    `json:"width"`
			Height int    `json:"height"`
			URL    string `json:"url"`
		} `json:"backgroundImageScaled"`
		BackgroundTile        bool   `json:"backgroundTile"`
		BackgroundBrightness  string `json:"backgroundBrightness"`
		BackgroundBottomColor string `json:"backgroundBottomColor"`
		BackgroundTopColor    string `json:"backgroundTopColor"`
		CanBePublic           bool   `json:"canBePublic"`
		CanBeOrg              bool   `json:"canBeOrg"`
		CanBePrivate          bool   `json:"canBePrivate"`
		CanInvite             bool   `json:"canInvite"`
	} `json:"prefs"`
	LabelNames struct {
		Green  string `json:"green"`
		Yellow string `json:"yellow"`
		Orange string `json:"orange"`
		Red    string `json:"red"`
		Purple string `json:"purple"`
		Blue   string `json:"blue"`
		Sky    string `json:"sky"`
		Lime   string `json:"lime"`
		Pink   string `json:"pink"`
		Black  string `json:"black"`
	} `json:"labelNames"`
	Cards []struct {
		ID                    string        `json:"id"`
		CheckItemStates       interface{}   `json:"checkItemStates"`
		Closed                bool          `json:"closed"`
		DateLastActivity      time.Time     `json:"dateLastActivity"`
		Desc                  string        `json:"desc"`
		DescData              interface{}   `json:"descData"`
		IDBoard               string        `json:"idBoard"`
		IDList                string        `json:"idList"`
		IDMembersVoted        []interface{} `json:"idMembersVoted"`
		IDShort               int           `json:"idShort"`
		IDAttachmentCover     interface{}   `json:"idAttachmentCover"`
		IDLabels              []interface{} `json:"idLabels"`
		ManualCoverAttachment bool          `json:"manualCoverAttachment"`
		Name                  string        `json:"name"`
		Pos                   int           `json:"pos"`
		ShortLink             string        `json:"shortLink"`
		Badges                struct {
			Votes             int `json:"votes"`
			AttachmentsByType struct {
				Trello struct {
					Board int `json:"board"`
					Card  int `json:"card"`
				} `json:"trello"`
			} `json:"attachmentsByType"`
			ViewingMemberVoted bool        `json:"viewingMemberVoted"`
			Subscribed         bool        `json:"subscribed"`
			Fogbugz            string      `json:"fogbugz"`
			CheckItems         int         `json:"checkItems"`
			CheckItemsChecked  int         `json:"checkItemsChecked"`
			Comments           int         `json:"comments"`
			Attachments        int         `json:"attachments"`
			Description        bool        `json:"description"`
			Due                interface{} `json:"due"`
			DueComplete        bool        `json:"dueComplete"`
		} `json:"badges"`
		DueComplete  bool          `json:"dueComplete"`
		Due          interface{}   `json:"due"`
		IDChecklists []interface{} `json:"idChecklists"`
		IDMembers    []string      `json:"idMembers"`
		Labels       []struct {
			ID      string `json:"id"`
			IDBoard string `json:"idBoard"`
			Name    string `json:"name"`
			Color   string `json:"color"`
		} `json:"labels"`
		ShortURL         string `json:"shortUrl"`
		Subscribed       bool   `json:"subscribed"`
		URL              string `json:"url"`
		CustomFieldItems []struct {
			ID    string `json:"id"`
			Value struct {
				Text   string `json:"text"`
				Number string `json:"number"`
			} `json:"value"`
			IDCustomField string `json:"idCustomField"`
			IDModel       string `json:"idModel"`
			ModelType     string `json:"modelType"`
		} `json:"customFieldItems"`
	} `json:"cards"`
}

BoardData - struct for nested Board/List/Card API call

func RetrieveAll

func RetrieveAll(tiktok *TikTokConf, boardID string, whichCards string) (allTheThings BoardData, err error)

RetrieveAll - Get all board data (cards/lists/etc) whichCards == none / all / closed / open / visible per https://developers.trello.com/reference#cards-nested-resource

type Boards

type Boards struct {
	ID             string      `json:"id"`
	Name           string      `json:"name"`
	Desc           string      `json:"desc"`
	DescData       interface{} `json:"descData"`
	Closed         bool        `json:"closed"`
	IDOrganization string      `json:"idOrganization"`
	Pinned         bool        `json:"pinned"`
	URL            string      `json:"url"`
	ShortURL       string      `json:"shortUrl"`
	Prefs          struct {
		PermissionLevel       string      `json:"permissionLevel"`
		Voting                string      `json:"voting"`
		Comments              string      `json:"comments"`
		Invitations           string      `json:"invitations"`
		SelfJoin              bool        `json:"selfJoin"`
		CardCovers            bool        `json:"cardCovers"`
		CardAging             string      `json:"cardAging"`
		CalendarFeedEnabled   bool        `json:"calendarFeedEnabled"`
		Background            string      `json:"background"`
		BackgroundImage       interface{} `json:"backgroundImage"`
		BackgroundImageScaled interface{} `json:"backgroundImageScaled"`
		BackgroundTile        bool        `json:"backgroundTile"`
		BackgroundBrightness  string      `json:"backgroundBrightness"`
		BackgroundColor       string      `json:"backgroundColor"`
		BackgroundBottomColor string      `json:"backgroundBottomColor"`
		BackgroundTopColor    string      `json:"backgroundTopColor"`
		CanBePublic           bool        `json:"canBePublic"`
		CanBeOrg              bool        `json:"canBeOrg"`
		CanBePrivate          bool        `json:"canBePrivate"`
		CanInvite             bool        `json:"canInvite"`
	} `json:"prefs"`
	LabelNames struct {
		Green  string `json:"green"`
		Yellow string `json:"yellow"`
		Orange string `json:"orange"`
		Red    string `json:"red"`
		Purple string `json:"purple"`
		Blue   string `json:"blue"`
		Sky    string `json:"sky"`
		Lime   string `json:"lime"`
		Pink   string `json:"pink"`
		Black  string `json:"black"`
	} `json:"labelNames"`
	Limits struct {
	} `json:"limits"`
}

Boards - struct to create trello boards

func CreateBoard

func CreateBoard(boardName string, orgName string, tiktok *TikTokConf) (trellrep Boards, err error)

CreateBoard - adlio doesn't have this function so here it is

type BotDMPayload

type BotDMPayload struct {
	Token          string       `json:"token,omitempty"`
	Channel        string       `json:"channel,omitempty"`
	Text           string       `json:"text,omitempty"`
	AsUser         bool         `json:"as_user,omitempty"`
	Attachments    []Attachment `json:"attachments,omitempty"`
	IconEmoji      string       `json:"icon_emoji,omitempty"`
	IconURL        string       `json:"icon_url,omitempty"`
	LinkNames      bool         `json:"link_names,omitempty"`
	Mkrdwn         bool         `json:"mrkdwn,omitempty"`
	Parse          string       `json:"parse,omitempty"`
	ReplyBroadcast bool         `json:"reply_broadcast,omitempty"`
	ThreadTS       string       `json:"thread_ts,omitempty"`
	UnfurlLinks    bool         `json:"unfurl_links,omitempty"`
	UnfurlMedia    bool         `json:"unfurl_media,omitempty"`
	Username       string       `json:"username,omitempty"`
}

BotDMPayload - struct for bot DMs

type BugLabel

type BugLabel struct {
	ID       int
	BoardID  string
	BugLevel string
	LabelID  string
}

BugLabel - Bug Label Information

func GetBugID

func GetBugID(tiktok *TikTokConf, boardID string) (bugs []BugLabel, err error)

GetBugID - get all Bug label IDs for a given board

type CardAction

type CardAction []struct {
	ID              string `json:"id"`
	IDMemberCreator string `json:"idMemberCreator"`
	Data            struct {
		List struct {
			Name string `json:"name"`
			ID   string `json:"id"`
		} `json:"list"`
		Board struct {
			ShortLink string `json:"shortLink"`
			Name      string `json:"name"`
			ID        string `json:"id"`
		} `json:"board"`
		Card struct {
			ShortLink string `json:"shortLink"`
			IDShort   int    `json:"idShort"`
			Name      string `json:"name"`
			ID        string `json:"id"`
		} `json:"card"`
		Text string `json:"text"`
	} `json:"data"`
	Type   string    `json:"type"`
	Date   time.Time `json:"date"`
	Limits struct {
		Reactions struct {
			PerAction struct {
				Status    string `json:"status"`
				DisableAt int    `json:"disableAt"`
				WarnAt    int    `json:"warnAt"`
			} `json:"perAction"`
			UniquePerAction struct {
				Status    string `json:"status"`
				DisableAt int    `json:"disableAt"`
				WarnAt    int    `json:"warnAt"`
			} `json:"uniquePerAction"`
		} `json:"reactions"`
	} `json:"limits"`
	MemberCreator struct {
		ID               string      `json:"id"`
		AvatarHash       string      `json:"avatarHash"`
		AvatarURL        string      `json:"avatarUrl"`
		FullName         string      `json:"fullName"`
		IDMemberReferrer interface{} `json:"idMemberReferrer"`
		Initials         string      `json:"initials"`
		Username         string      `json:"username"`
	} `json:"memberCreator"`
}

CardAction - struct for holding card actions

func GetCardAction

func GetCardAction(tiktok *TikTokConf, cardID string, limit int) (actions CardAction, err error)

GetCardAction - retrieve card actions

type CardAttachment

type CardAttachment struct {
	ID        string              `json:"id"`
	Name      string              `json:"name"`
	Pos       float32             `json:"pos"`
	Bytes     int                 `json:"int"`
	Date      string              `json:"date"`
	EdgeColor string              `json:"edgeColor"`
	IDMember  string              `json:"idMember"`
	IsUpload  bool                `json:"isUpload"`
	MimeType  string              `json:"mimeType"`
	Previews  []AttachmentPreview `json:"previews"`
	URL       string              `json:"url"`
}

CardAttachment - struct for card attachment data

func GetAttachments

func GetAttachments(tiktok *TikTokConf, cardID string) (cAttach []CardAttachment, err error)

GetAttachments - get trello card attachment data

type CardComment

type CardComment []struct {
	ID              string `json:"id"`
	IDMemberCreator string `json:"idMemberCreator"`
	Data            struct {
		List struct {
			Name string `json:"name"`
			ID   string `json:"id"`
		} `json:"list"`
		Board struct {
			ShortLink string `json:"shortLink"`
			Name      string `json:"name"`
			ID        string `json:"id"`
		} `json:"board"`
		Card struct {
			ShortLink string `json:"shortLink"`
			IDShort   int    `json:"idShort"`
			Name      string `json:"name"`
			ID        string `json:"id"`
		} `json:"card"`
		Text string `json:"text"`
	} `json:"data"`
	Type   string    `json:"type"`
	Date   time.Time `json:"date"`
	Limits struct {
		Reactions struct {
			PerAction struct {
				Status    string `json:"status"`
				DisableAt int    `json:"disableAt"`
				WarnAt    int    `json:"warnAt"`
			} `json:"perAction"`
			UniquePerAction struct {
				Status    string `json:"status"`
				DisableAt int    `json:"disableAt"`
				WarnAt    int    `json:"warnAt"`
			} `json:"uniquePerAction"`
		} `json:"reactions"`
	} `json:"limits"`
	MemberCreator struct {
		ID         string `json:"id"`
		AvatarHash string `json:"avatarHash"`
		AvatarURL  string `json:"avatarUrl"`
		FullName   string `json:"fullName"`
		Initials   string `json:"initials"`
		Username   string `json:"username"`
	} `json:"memberCreator"`
}

CardComment - struct for managing trello card comments

func GetCardComments

func GetCardComments(cardID string, tiktok *TikTokConf) (cardComments CardComment, err error)

GetCardComments - retrieve all comments on a given trello card

type CardData

type CardData struct {
	CardID    string
	CardName  string
	CardURL   string
	WorkStart time.Time
	PRStart   time.Time
	Heads     []string
}

CardData struct

type CardDescHistory

type CardDescHistory []struct {
	ID              string `json:"id"`
	IDMemberCreator string `json:"idMemberCreator"`
	Data            struct {
		List struct {
			Name string `json:"name"`
			ID   string `json:"id"`
		} `json:"list"`
		Board struct {
			ShortLink string `json:"shortLink"`
			Name      string `json:"name"`
			ID        string `json:"id"`
		} `json:"board"`
		Card struct {
			ShortLink string `json:"shortLink"`
			IDShort   int    `json:"idShort"`
			Name      string `json:"name"`
			ID        string `json:"id"`
			Desc      string `json:"desc"`
		} `json:"card"`
		Old struct {
			Desc string `json:"desc"`
		} `json:"old"`
	} `json:"data"`
	Type   string    `json:"type"`
	Date   time.Time `json:"date"`
	Limits struct {
	} `json:"limits"`
	MemberCreator struct {
		ID         string `json:"id"`
		AvatarHash string `json:"avatarHash"`
		AvatarURL  string `json:"avatarUrl"`
		FullName   string `json:"fullName"`
		Initials   string `json:"initials"`
		Username   string `json:"username"`
	} `json:"memberCreator"`
}

CardDescHistory - struct to contain description history of any given trello card

func GetDescHistory

func GetDescHistory(tiktok *TikTokConf, cardID string) (descHistory CardDescHistory, err error)

GetDescHistory - retrieve card description history

type CardListHistory

type CardListHistory []struct {
	ID              string `json:"id"`
	IDMemberCreator string `json:"idMemberCreator"`
	Data            struct {
		ListAfter struct {
			Name string `json:"name"`
			ID   string `json:"id"`
		} `json:"listAfter"`
		ListBefore struct {
			Name string `json:"name"`
			ID   string `json:"id"`
		} `json:"listBefore"`
		Board struct {
			ShortLink string `json:"shortLink"`
			Name      string `json:"name"`
			ID        string `json:"id"`
		} `json:"board"`
		Card struct {
			ShortLink string `json:"shortLink"`
			IDShort   int    `json:"idShort"`
			Name      string `json:"name"`
			ID        string `json:"id"`
			IDList    string `json:"idList"`
		} `json:"card"`
		Old struct {
			IDList string `json:"idList"`
		} `json:"old"`
	} `json:"data"`
	Type   string    `json:"type"`
	Date   time.Time `json:"date"`
	Limits struct {
	} `json:"limits"`
	MemberCreator struct {
		ID         string `json:"id"`
		AvatarHash string `json:"avatarHash"`
		AvatarURL  string `json:"avatarUrl"`
		FullName   string `json:"fullName"`
		Initials   string `json:"initials"`
		Username   string `json:"username"`
	} `json:"memberCreator"`
}

CardListHistory - struct to contain list history of any given trello card

func GetCardListHistory

func GetCardListHistory(cardID string, tiktok *TikTokConf) (cardListHistory CardListHistory)

GetCardListHistory - return list history of a card

type CardReportData

type CardReportData struct {
	CardID           string
	CardTitle        string
	Points           int
	CardURL          string
	List             string
	StartedInWorking time.Time
	StartedInPR      time.Time
	EnteredDone      time.Time
	Owners           string
}

CardReportData - Card Information

type ChannelListPayload

type ChannelListPayload struct {
	Ok       bool `json:"ok"`
	Channels []struct {
		ID                 string        `json:"id"`
		Name               string        `json:"name"`
		IsChannel          bool          `json:"is_channel"`
		IsGroup            bool          `json:"is_group"`
		IsIm               bool          `json:"is_im"`
		Created            int           `json:"created"`
		Creator            string        `json:"creator"`
		IsArchived         bool          `json:"is_archived"`
		IsGeneral          bool          `json:"is_general"`
		Unlinked           int           `json:"unlinked"`
		NameNormalized     string        `json:"name_normalized"`
		IsShared           bool          `json:"is_shared"`
		IsExtShared        bool          `json:"is_ext_shared"`
		IsOrgShared        bool          `json:"is_org_shared"`
		PendingShared      []interface{} `json:"pending_shared"`
		IsPendingExtShared bool          `json:"is_pending_ext_shared"`
		IsMember           bool          `json:"is_member"`
		IsPrivate          bool          `json:"is_private"`
		IsMpim             bool          `json:"is_mpim"`
		Topic              struct {
			Value   string `json:"value"`
			Creator string `json:"creator"`
			LastSet int    `json:"last_set"`
		} `json:"topic"`
		Purpose struct {
			Value   string `json:"value"`
			Creator string `json:"creator"`
			LastSet int    `json:"last_set"`
		} `json:"purpose"`
		PreviousNames []interface{} `json:"previous_names"`
		NumMembers    int           `json:"num_members"`
	} `json:"channels"`
	ResponseMetadata struct {
		NextCursor string `json:"next_cursor"`
	} `json:"response_metadata"`
	Error string `json:"error"`
}

ChannelListPayload - return payload containing list of slack channels

func ChannelList

func ChannelList(tiktok *TikTokConf, noArchived bool) (slackPayload ChannelListPayload, success bool, err error)

ChannelList - Return slice of slack channels

type ChannelRespPayload

type ChannelRespPayload struct {
	Ok      bool `json:"ok"`
	Channel struct {
		ID                 string      `json:"id"`
		Name               string      `json:"name"`
		IsChannel          bool        `json:"is_channel"`
		Created            int         `json:"created"`
		Creator            string      `json:"creator"`
		IsArchived         bool        `json:"is_archived"`
		IsGeneral          bool        `json:"is_general"`
		NameNormalized     string      `json:"name_normalized"`
		IsShared           bool        `json:"is_shared"`
		IsOrgShared        bool        `json:"is_org_shared"`
		IsMember           bool        `json:"is_member"`
		IsPrivate          bool        `json:"is_private"`
		IsMpim             bool        `json:"is_mpim"`
		LastRead           string      `json:"last_read"`
		Latest             interface{} `json:"latest"`
		UnreadCount        int         `json:"unread_count"`
		UnreadCountDisplay int         `json:"unread_count_display"`
		Members            []string    `json:"members"`
		Topic              struct {
			Value   string `json:"value"`
			Creator string `json:"creator"`
			LastSet int    `json:"last_set"`
		} `json:"topic"`
		Purpose struct {
			Value   string `json:"value"`
			Creator string `json:"creator"`
			LastSet int    `json:"last_set"`
		} `json:"purpose"`
		PreviousNames []interface{} `json:"previous_names"`
	} `json:"channel"`
	Error  string `json:"error"`
	Detail string `json:"detail"`
}

ChannelRespPayload - return payload from slack channel creation

func ArchiveChannel

func ArchiveChannel(tiktok *TikTokConf, channelID string) (slackPayload ChannelRespPayload, success bool, err error)

ArchiveChannel - archive a slack channel created by bot and return payload. must send channel slackID, not channel name

func CreateChannel

func CreateChannel(tiktok *TikTokConf, channelName string, errValidate bool) (slackPayload ChannelRespPayload, success bool, err error)

CreateChannel - create a slack channel and return the payload

type Chapter

type Chapter struct {
	ID            int
	BoardID       string
	ChapterName   string
	LabelID       string
	ChapterPoints int
	ChapterCount  int
}

Chapter - Chapter Information

type Chapters

type Chapters []Chapter

Chapters - array of Chapter

func ChapterCount

func ChapterCount(tiktok *TikTokConf, opts Config, listID string) (allChapter Chapters, totalCards int, err error)

ChapterCount - Card count by chapter on given list

func ChapterPoint

func ChapterPoint(tiktok *TikTokConf, opts Config, listID string) (allChapter Chapters, noChapter int, err error)

ChapterPoint - Point count by chapter on given list

func GetDBChapters

func GetDBChapters(tiktok *TikTokConf, boardID string) (allChapters Chapters, err error)

GetDBChapters - get all chapters and label IDs in db

type Config

type Config struct {
	General GeneralOptions
}

Config - Struct of option file sections

func LoadConf

func LoadConf(tiktok *TikTokConf, team string) (opts Config, err error)

LoadConf - load a teams conf file to do something

func LoadConfig

func LoadConfig(configFile string) (*Config, error)

LoadConfig - load toml config file

type ConfigMe

type ConfigMe struct {
	BacklogID         string
	Upcoming          string
	Scoped            string
	NextsprintID      string
	ReadyForWork      string
	Working           string
	ReadyForReview    string
	Done              string
	BoardID           string
	ROLabelID         string
	CfsprintID        string
	CfpointsID        string
	TemplateLabelID   string
	AllowMembersLabel string
	TrainingLabel     string
	SilenceCardLabel  string
}

ConfigMe struct for passing config data around

type Cronjobs

type Cronjobs struct {
	Cronjob []struct {
		Timing string
		Action string
		Config string
	}
}

Cronjobs struct. For holding all cron job info from TOML

func BotActions

func BotActions(lowerString string, tiktok *TikTokConf, ev *slack.MessageEvent, rtm *slack.RTM, api *slack.Client, c *cron.Cron, cronjobs *Cronjobs, CronState string) (*cron.Cron, *Cronjobs, string)

BotActions - TikTokConf Actions based on commands

func CronLoad

func CronLoad(tiktok *TikTokConf) (cronjobs *Cronjobs, c *cron.Cron, err error)

CronLoad - Load or re-load all cron jobs. Re-read the toml file

func LoadCronFile

func LoadCronFile() (*Cronjobs, error)

LoadCronFile - CRON Tabs

type CustomCollection

type CustomCollection []*Customs

CustomCollection - handles mutiple custom fields

func GetBoardCustoms

func GetBoardCustoms(boardID string, tiktok *TikTokConf) (customList CustomCollection, err error)

GetBoardCustoms - grab all custom fields on a board

type Customs

type Customs struct {
	ID         string `json:"id"`
	IDMOdel    string `json:"idModel"`
	ModelType  string `json:"modelType"`
	FieldGroup string `json:"fieldGroup"`
	Name       string `json:"name"`
	Pos        int    `json:"pos"`
	Type       string `json:"type"`
}

Customs struct

type Field

type Field struct {
	Title string `json:"title"`
	Value string `json:"value"`
	Short bool   `json:"short"`
}

Field - struct

type GeneralOptions

type GeneralOptions struct {
	TeamName        string
	Sprintname      string
	TrelloOrg       string
	StaleTime       int
	MaxPoints       int
	ArchiveDoneDays int
	BackLogDays     int
	SprintDuration  int
	RetroActionDays int
	IgnoreWeekends  bool
	HolidaySupport  bool

	BacklogID         string
	Upcoming          string
	Scoped            string
	NextsprintID      string
	ReadyForWork      string
	Working           string
	ReadyForReview    string
	Done              string
	BoardID           string
	ROLabelID         string
	TemplateLabelID   string
	CfsprintID        string
	CfpointsID        string
	RetroCollectionID string
	AllowMembersLabel string
	TrainingLabel     string
	SilenceCardLabel  string
	DemoBoardID       string

	RetroChannel     string
	SprintChannel    string
	ComplaintChannel string

	StandupAlertChannel string
	StandupLink         string
	DemoAlertChannel    string
	DemoAlertLink       string
	RetroAlertChannel   string
	RetroAlertLink      string
	WDWAlertChannel     string
	WDWAlertLink        string
}

GeneralOptions struct for configs

type Holiday

type Holiday struct {
	ID      int
	Name    string
	Day     time.Time
	Message string
}

Holiday - Struct for Holiday data

func GetHoliday

func GetHoliday(tiktok *TikTokConf, year string) (theHolidays []Holiday, err error)

GetHoliday - Get List of Holidays in SQL DB. If year is 0, all dates are returned

func IsHoliday

func IsHoliday(tiktok *TikTokConf, checkDate time.Time) (isHoliday bool, holiday Holiday)

IsHoliday - Check for Holidays in SQL DB

type LabelCollection

type LabelCollection []*Labels

LabelCollection - handles multiple plugin types per board

func GetBoardLabels

func GetBoardLabels(boardID string, tiktok *TikTokConf) (labelList LabelCollection, err error)

GetBoardLabels - grab all labels on a board. not part of Adilo/trello

type Labels

type Labels struct {
	ID      string `json:"id"`
	IDBoard string `json:"idBoard"`
	Name    string `json:"name"`
	Color   string `json:"color"`
	Uses    int    `json:"uses"`
}

Labels struct

type ListData

type ListData []struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	Closed     bool   `json:"closed"`
	IDBoard    string `json:"idBoard"`
	Pos        int    `json:"pos"`
	Subscribed bool   `json:"subscribed"`
}

ListData - struct of board lists data

func GetLists

func GetLists(tiktok *TikTokConf, boardID string) (listData ListData, err error)

GetLists - Get all lists data in a board

type Member

type Member struct {
	ID                       string        `json:"id"`
	AvatarHash               string        `json:"avatarHash"`
	AvatarURL                string        `json:"avatarUrl"`
	Bio                      string        `json:"bio"`
	BioData                  interface{}   `json:"bioData"`
	Confirmed                bool          `json:"confirmed"`
	FullName                 string        `json:"fullName"`
	IDEnterprisesDeactivated []interface{} `json:"idEnterprisesDeactivated"`
	IDPremOrgsAdmin          []interface{} `json:"idPremOrgsAdmin"`
	Initials                 string        `json:"initials"`
	MemberType               string        `json:"memberType"`
	Products                 []interface{} `json:"products"`
	Status                   string        `json:"status"`
	URL                      string        `json:"url"`
	Username                 string        `json:"username"`
	AvatarSource             interface{}   `json:"avatarSource"`
	Email                    interface{}   `json:"email"`
	GravatarHash             interface{}   `json:"gravatarHash"`
	IDBoards                 []string      `json:"idBoards"`
	IDEnterprise             interface{}   `json:"idEnterprise"`
	IDOrganizations          []string      `json:"idOrganizations"`
	IDEnterprisesAdmin       []interface{} `json:"idEnterprisesAdmin"`
	Limits                   struct {
		Boards struct {
			TotalPerMember struct {
				Status    string `json:"status"`
				DisableAt int    `json:"disableAt"`
				WarnAt    int    `json:"warnAt"`
			} `json:"totalPerMember"`
		} `json:"boards"`
		Orgs struct {
			TotalPerMember struct {
				Status    string `json:"status"`
				DisableAt int    `json:"disableAt"`
				WarnAt    int    `json:"warnAt"`
			} `json:"totalPerMember"`
		} `json:"orgs"`
	} `json:"limits"`
	LoginTypes               interface{}   `json:"loginTypes"`
	MarketingOptIn           interface{}   `json:"marketingOptIn"`
	MessagesDismissed        interface{}   `json:"messagesDismissed"`
	OneTimeMessagesDismissed interface{}   `json:"oneTimeMessagesDismissed"`
	Prefs                    interface{}   `json:"prefs"`
	Trophies                 []interface{} `json:"trophies"`
	UploadedAvatarHash       interface{}   `json:"uploadedAvatarHash"`
	UploadedAvatarURL        interface{}   `json:"uploadedAvatarUrl"`
	PremiumFeatures          []interface{} `json:"premiumFeatures"`
	IDBoardsPinned           interface{}   `json:"idBoardsPinned"`
}

Member - data struct

type PValue

type PValue struct {
	Points        string   `json:"points"`
	PointsHistory []string `json:"pointsHistory,omitempty"`
}

PValue custom field value struct

type Payload

type Payload struct {
	Parse       string       `json:"parse,omitempty"`
	Username    string       `json:"username,omitempty"`
	IconURL     string       `json:"icon_url,omitempty"`
	IconEmoji   string       `json:"icon_emoji,omitempty"`
	Channel     string       `json:"channel,omitempty"`
	Text        string       `json:"text,omitempty"`
	LinkNames   string       `json:"link_names,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
	UnfurlLinks bool         `json:"unfurl_links,omitempty"`
	UnfurlMedia bool         `json:"unfurl_media,omitempty"`
}

Payload - struct

type PluginCard

type PluginCard struct {
	ID       string `json:"id"`
	IDPlugin string `json:"idPlugin"`
	Scope    string `json:"scope"`
	IDModel  string `json:"idModel"`
	Value    string `json:"value"`
	Access   string `json:"access"`
}

PluginCard - PowerUp Plugin Struct

type PluginCollection

type PluginCollection []*PluginCard

PluginCollection handles multiple plugin types per board

func GetPowerUpField

func GetPowerUpField(cardID string, tiktok *TikTokConf) (pluginCard PluginCollection, err error)

GetPowerUpField - adlio/trello doesn't support Powerup/Plugin card fields, so buildling this function to add that

type PointsHistory

type PointsHistory struct {
	PointsHistory []string `json:"pointsHistory"`
	Points        int      `json:"points"`
}

PointsHistory struct for managing points and points history for plugin

type RetroStruct

type RetroStruct struct {
	TeamID  string
	RetroID string
}

RetroStruct - struct of Retro Board UIDs

func GetRetroID

func GetRetroID(tiktok *TikTokConf, teamID string) (retroStruct []RetroStruct, err error)

GetRetroID - Get all retro board IDs into one slice

func GetWBoards

func GetWBoards(tiktok *TikTokConf) (retroArray []RetroStruct, err error)

GetWBoards - search and retrieve all Trello boards in organization that have {W} in the title. used for alerting on retro items

type SprintData

type SprintData struct {
	V2ID        int
	TeamID      string
	SprintStart time.Time
	Duration    int
	RetroID     string
	SprintName  string
	WorkingDays int
}

SprintData - DB Storage struct

func GetDBSprint

func GetDBSprint(tiktok *TikTokConf, teamID string) (sOpts SprintData, err error)

GetDBSprint - Get sprint data out of DB

type SprintPointsBySquad

type SprintPointsBySquad struct {
	SprintName   string
	SquadName    string
	SprintPoints int
}

SprintPointsBySquad - Sprint Points by Squad

type Squad

type Squad struct {
	ID        int
	BoardID   string
	Squadname string
	LabelID   string
	SquadPts  int
}

Squad - Squad Information

type Squads

type Squads []Squad

Squads - array of squad

func GetDBSquads

func GetDBSquads(tiktok *TikTokConf, boardID string) (allSquads Squads, err error)

GetDBSquads - get all squads and label IDs in db

func SprintSquadPoints

func SprintSquadPoints(tiktok *TikTokConf, opts Config, sprintName string) (totalpoints Squads, nonPoints int, err error)

SprintSquadPoints - Determine squad points used on a specific sprint by sprint name

func SquadPoints

func SquadPoints(columnID string, opts Config, tiktok *TikTokConf) (allSquads Squads, nonPoints int, err error)

SquadPoints - retrieve all the squad points on a board

type Theme

type Theme struct {
	ID      string `json:"id"`
	IDBoard string `json:"idBoard"`
	Name    string `json:"name"`
	Color   string `json:"color"`
	Pts     int
}

Theme - struct of theme points

type Themes

type Themes []Theme

Themes - array of theme structs

func CountCards

func CountCards(opts Config, tiktok *TikTokConf, teamID string) (allThemes Themes, err error)

CountCards - function to count # of cards per theme in pre-sprint columns for reporting

func GetLabel

func GetLabel(tiktok *TikTokConf, boardID string) (allThemes Themes, err error)

GetLabel - Get labels on a board

func ThemePoints

func ThemePoints(opts Config, tiktok *TikTokConf, columnID string) (allThemes Themes, err error)

ThemePoints - retrieve all the theme points in a given trello colum (list)

type TikTokConf

type TikTokConf struct {
	Config TikTokStruct
}

TikTokConf - Struct of tiktok conf file section

func LoadTikTokConf

func LoadTikTokConf() (*TikTokConf, error)

LoadTikTokConf Main Config

func Startup

func Startup(tiktokOpts *TikTokConf) (*TikTokConf, bool)

Startup - Startup stuff

type TikTokStruct

type TikTokStruct struct {
	SlackHook               string
	SlackToken              string
	SlackOAuth              string
	Tkey                    string
	Ttoken                  string
	GitToken                string
	DBUser                  string
	DBPassword              string
	DEBUG                   bool
	LogChannel              string
	SlackEmoji              string
	LogToSlack              bool
	AdminSlackChannel       string
	ScrumControlChannel     string
	DupeCollectionID        string
	LoggingPrefix           string
	Version                 string
	BotID                   string
	BotName                 string
	TeamID                  string
	TeamName                string
	PointsPowerUpID         string
	BotTrelloID             string
	TrelloOrgID             string
	UseGCP                  bool
	SQLHost                 string
	SQLPort                 string
	SQLDBName               string
	AllowNativePasswords    bool
	AllowCleartextPasswords bool
	AllowAllFiles           bool
	ParseTime               bool
	GithubOrgName           string
}

TikTokStruct primary configuration struct

type TotalSprint

type TotalSprint []SprintPointsBySquad

TotalSprint - array of SprintPointsBySquad

func GetPreviousSprintPoints

func GetPreviousSprintPoints(tiktok *TikTokConf, sprintname string) (totalSprint TotalSprint, err error)

GetPreviousSprintPoints - Retrieve Previous sprint data from CloudSQL

type UserData

type UserData struct {
	ID      int
	Name    string
	SlackID string
	Trello  string
	Github  string
	Email   string
}

UserData - Matrix of user accounts

func GetDBUsers

func GetDBUsers(tiktok *TikTokConf) (users []UserData, err error)

GetDBUsers - get all users

func GetUser

func GetUser(tiktok *TikTokConf, myField string, mySearch string) (user UserData, err error)

GetUser - get a user from DB

Jump to

Keyboard shortcuts

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