pivotaltracker

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableName = "pt_notifs"
)

Variables

View Source
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 GetAccount added in v0.0.8

func GetAccount(accessToken string) (types.Account, error)

func GetNotifications added in v0.0.5

func GetNotifications(accessToken string, since ...time.Time) (types.Notifications, error)

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 InitSQLite3Database(databasePath string) error

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

func WatchNotifications(
	accessToken string,
	fromProjects Projects,
	databaseConnection *sql.DB,
	updateInterval time.Duration,
	stop chan struct{},
) chan types.Notification

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 (a Account) GetCreatedAt() *string

func (Account) GetEmail added in v0.0.8

func (a Account) GetEmail() *string

func (Account) GetFollowerCount added in v0.0.8

func (a Account) GetFollowerCount() *int

func (Account) GetIsAdmin added in v0.0.8

func (a Account) GetIsAdmin() *bool

func (Account) GetLastSeen added in v0.0.8

func (a Account) GetLastSeen() *string
func (a Account) GetLink() *string

func (Account) GetName added in v0.0.8

func (a Account) GetName() *string

func (Account) GetProjectCount added in v0.0.8

func (a Account) GetProjectCount() *int

func (Account) GetUsername added in v0.0.8

func (a Account) GetUsername() *string

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

func (c Config) GetSanitized() Config

GetSanitized returns a copy of this Config instance without sensitive details like access tokens

func (*Config) MergeWith added in v0.0.7

func (c *Config) MergeWith(o Config)

MergeWith merges the current Config instance with a provided Config instance. The merge strategy is add-only

type Notification added in v0.0.5

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

func (Project) GetSanitized added in v0.0.5

func (p Project) GetSanitized() Project

type Projects added in v0.0.5

type Projects []Project

Projects defines a structure to store a list of Pivotal Tracker projects

func (Projects) GetSanitized added in v0.0.5

func (p Projects) GetSanitized() Projects

Jump to

Keyboard shortcuts

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