Documentation ¶
Index ¶
- Constants
- Variables
- func GetAccount(accessToken string) (types.Account, error)
- func GetNotifications(accessToken string, since ...time.Time) (types.Notifications, error)
- func InitSQLite3Database(databasePath string) error
- func InsertNotification(ptNotification pkgpivotaltracker.APINotification, connection *sql.DB) error
- func QueryNotification(notification pkgpivotaltracker.APINotification, connection *sql.DB) (bool, error)
- func WatchNotifications(accessToken string, fromProjects Projects, databaseConnection *sql.DB, ...) chan types.Notification
- type Account
- func (a Account) GetCreatedAt() *string
- func (a Account) GetEmail() *string
- func (a Account) GetFollowerCount() *int
- func (a Account) GetIsAdmin() *bool
- func (a Account) GetLastSeen() *string
- func (a Account) GetLink() *string
- func (a Account) GetName() *string
- func (a Account) GetProjectCount() *int
- func (a Account) GetUsername() *string
- type Config
- type Notification
- type Project
- type Projects
Constants ¶
const (
TableName = "pt_notifs"
)
Variables ¶
var SQLite3Migrations = []string{ fmt.Sprintf("ALTER TABLE `%s` ADD `notification_id` VARCHAR(32) NOT NULL DEFAULT ''", TableName), fmt.Sprintf("ALTER TABLE `%s` ADD `message` TEXT NOT NULL DEFAULT ''", TableName), fmt.Sprintf("ALTER TABLE `%s` ADD `raw` TEXT NOT NULL DEFAULT ''", TableName), }
Functions ¶
func GetNotifications ¶ added in v0.0.5
GetNotifications is a wrapper around the `pkg/pivotaltracker` package that returns notifications as defined by types.Notifications instead of the raw API response
func InitSQLite3Database ¶
func InsertNotification ¶
func InsertNotification(ptNotification pkgpivotaltracker.APINotification, connection *sql.DB) error
func QueryNotification ¶
func QueryNotification(notification pkgpivotaltracker.APINotification, connection *sql.DB) (bool, error)
func WatchNotifications ¶
Types ¶
type Account ¶ added in v0.0.8
type Account pkg.APIv5AccountResponse
Account implements types.Account
func (Account) GetCreatedAt ¶ added in v0.0.8
func (Account) GetFollowerCount ¶ added in v0.0.8
func (Account) GetIsAdmin ¶ added in v0.0.8
func (Account) GetLastSeen ¶ added in v0.0.8
func (Account) GetProjectCount ¶ added in v0.0.8
func (Account) GetUsername ¶ added in v0.0.8
type Config ¶ added in v0.0.5
type Config struct { // Projects is the list of projects to monitor Projects Projects `json:"projects" yaml:"projects"` // AccessToken to be used for all listed projects if their own access token is not defined. // This value can be retrieved from the section named API Token at https://www.pivotaltracker.com/profile AccessToken string `json:"accessToken" yaml:"accessToken"` }
Config defines the structure of the configuration that can be consumed for tracking notifications and events from the Pivotal Tracker platform
func (Config) GetSanitized ¶ added in v0.0.5
GetSanitized returns a copy of this Config instance without sensitive details like access tokens
type Notification ¶ added in v0.0.5
type Notification pkgpivotaltracker.APINotification
Notification implements types.Notification and is essentially a serializer of the raw API response by pivotal tracker
func (Notification) GetMessage ¶ added in v0.0.5
func (n Notification) GetMessage() string
GetMessage implements the types.Notification interface and returns the logical message component of this Notification instance
func (Notification) GetTitle ¶ added in v0.0.5
func (n Notification) GetTitle() string
GetTitle implements the types.Notification interface and returns the logical title component of this Notification instance
type Project ¶ added in v0.0.5
type Project struct { // Name is the custom label given to this project as the user would like to define it Name string `json:"name" yaml:"name"` // Description is a user-defined description of what this project is for Description string `json:"description" yaml:"description"` // ProjectID of the project in PivotalTracker that's obtainable by going to a board and getting it from the URL ProjectID string `json:"projectID" yaml:"projectID"` // AccessToken for this project, if not specified, defaults to use parent access token. // This value can be retrieved from the section named API Token at the URL:L // https://www.pivotaltracker.com/profile AccessToken string `json:"accessToken" yaml:"accessToken"` // Public indicates whether this account should be public, if so, the /platforms // endpoint on the dev server will expose this account; this is done to accomodate // using both personal and work accounts, note that even if this is set to true, // the AccessToken should not be exposed Public bool `json:"public" yaml:"public"` }
Project defines a Pivotal Tracker project