service

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FullName

func FullName(s Service) string

FullName returns the application namespaced name for the service

func HasCredentials

func HasCredentials(s Service) (foundCredentials bool)

HasCredentials returns true if a user's credentials have been set

func LoadCredentials

func LoadCredentials(s Service) (token string, e error)

LoadCredentials returns the token for the harvest service

func SaveCredentials

func SaveCredentials(s Service, token string) (err error)

SaveCredentials persists credentials to the OSX keychain

Types

type HarvestService

type HarvestService struct {
	Name string
	Service
	User *harvest.User
	API  *harvest.API
}

HarvestService defines a harvest service

func NewHarvestService

func NewHarvestService() (harvestService *HarvestService)

NewHarvestService creates a HarvestService instance

func (*HarvestService) GetName

func (hs *HarvestService) GetName() (name string)

GetName returns the name value

func (*HarvestService) GetProjects

func (hs *HarvestService) GetProjects() (projectAssignments []*ProjectAssignment)

GetProjects returns projects

func (*HarvestService) GetTasks

func (hs *HarvestService) GetTasks(projectAssignment *ProjectAssignment) (tasks []*harvest.TaskAssignment)

func (*HarvestService) SignIn

func (hs *HarvestService) SignIn(account_id string, token string) error

SignIn signs a harvest user in

func (*HarvestService) StartTimer

func (hs *HarvestService) StartTimer(projectID string, taskID string, notes string) (timerID int, err error)

func (*HarvestService) Stoptimer

func (hs *HarvestService) Stoptimer(timerEntryID int) (err error)

type PivotalTrackerService

type PivotalTrackerService struct {
	Service
	Name   string
	Client *pivotal.Client
}

PivotalTrackerService defines a harvest service

func NewPivotalTrackerService

func NewPivotalTrackerService() (pivotalTrackerService *PivotalTrackerService)

NewPivotalTrackerService returns a new instance of the pivotal tracker service

func (*PivotalTrackerService) GetName

func (pt *PivotalTrackerService) GetName() (name string)

GetName returns the name value

func (*PivotalTrackerService) GetProjects

func (pt *PivotalTrackerService) GetProjects() (projects []*pivotal.Project, err error)

GetProjects returns projects

func (*PivotalTrackerService) GetStory

func (pt *PivotalTrackerService) GetStory(projectID int, storyID int) (story *pivotal.Story)

GetStory returns Story

func (*PivotalTrackerService) SignIn

func (pt *PivotalTrackerService) SignIn(token string) (err error)

SignIn signs a user into

type ProjectAssignment

type ProjectAssignment struct {
	ID               int64                     `json:"id,omitempty"`
	IsProjectManager bool                      `json:"is_project_manager"`
	IsActive         bool                      `json:"is_active"`
	Project          *harvest.Project          `json:"project"`
	Client           *harvest.Client           `json:"client"`
	TaskAsignments   []*harvest.TaskAssignment `json:"task_assignments"`
}

type ProjectsResponse

type ProjectsResponse struct {
	Projects []*harvest.Project `json:"projects"`
}

ProjectsResponse is a collection of projects returned from /daily

type Service

type Service interface {
	GetName() string
}

Service defines a service used in go-to-work

type TimeEntry

type TimeEntry struct {
	ID             int    `json:"id"`
	ProjectID      int    `json:"project_id"`
	TaskID         int    `json:"task_id"`
	SpentDate      string `json:"spent_date"`
	Notes          string `json:"notes"`
	TimerStartedAt string `json:"timer_started_at,omitempty"`
}

type UserAssignmentsResponse

type UserAssignmentsResponse struct {
	ProjectAssignments []*ProjectAssignment `json:"project_assignments"`
	PerPage            int64                `json:"per_page"`
	TotalPages         int64                `json:"total_pages"`
	TotalEntries       int64                `json:"total_entries"`
	NextPage           *int64               `json:"next_page"`
	PreviousPage       *int64               `json:"previous_page"`
	Page               int64                `json:"page"`
}

type WhoAmIResponse

type WhoAmIResponse struct {
	User *harvest.User `json:"user"`
}

WhoAmIResponse defines the response from the /account/who_am_i endpoint

Jump to

Keyboard shortcuts

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