Documentation ¶
Index ¶
- func Connect(cfg c.Config)
- func CreateActivitiesTable()
- func CreateChannelsTable()
- func CreateTagsTable()
- func CreateTriagerTable()
- func DeleteTag(data string) error
- func LoadChannel(channelID string) (channel string, err error)
- func LoadChannels(dm bool) (channels []string, err error)
- func LoadTag(id int) (loadedTag map[string]interface{})
- func LoadTags() (tags []map[string]interface{})
- func LoadTriager() (triager string, err error)
- func SaveActivity(user string, name string, activityType string) error
- func SaveChannels(channelID string, private bool) (err error)
- func SaveNewTag(data map[string]string) error
- func SaveTagUpdate(data map[string]string) error
- func SaveTriager(data string) error
- type Activity
- type ActivityOptions
- type NullTime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
Connect uses the configuration passed from the config file to connect to Postgres and ensure that the table is created properly.
func CreateActivitiesTable ¶
func CreateActivitiesTable()
CreateActivitiesTable checks to see if the proper table exists, and if it doesn't, create one.
func CreateChannelsTable ¶
func CreateChannelsTable()
CreateChannelsTable checks to see if the proper table exists, and if it doesn't, create one.
func CreateTagsTable ¶
func CreateTagsTable()
CreateTagsTable checks to see if the proper table exists, and if it doesn't, create one.
func CreateTriagerTable ¶
func CreateTriagerTable()
CreateTriagerTable checks to see if the proper table exists, and if it doesn't, create one.
func LoadChannel ¶
func LoadChannels ¶
LoadChannels grabs the list of channels from the database and returns them in a slice of strings.
func LoadTags ¶
func LoadTags() (tags []map[string]interface{})
LoadTags retrieves all of the tags from the database, either to list or to loop through
func LoadTriager ¶
LoadTriager requests the triager with the most recent updated_at value in the table
func SaveActivity ¶
SaveActivity takes the user data and activity type and saves it to the Postgres database
func SaveChannels ¶
SaveChannels saves channels into the database and updates the existing record if one exists
func SaveNewTag ¶
SaveNewTag saves a new tag into the database
func SaveTagUpdate ¶
SaveTagUpdate saves a tag update into the database
func SaveTriager ¶
SaveTriager saves a new triager into the database
Types ¶
type Activity ¶
type Activity struct { SlackID string SlackName string ActivityType string StartedAt NullTime EndedAt NullTime }
Activity represents a single activity listed in the database
func LoadActivity ¶
func LoadActivity(opts ActivityOptions) (activities []Activity, err error)
LoadActivity requests a list of activity/activities from the database to use in the History command, or in reporting
type ActivityOptions ¶
ActivityOptions allows us to pass multiple optional parameters to the LoadActivity function, including a filter for activityType and a cap on how many are loaded