cmd

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2017 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "act",
	Short: "act - Activity Continuous Tracking",
	Long:  ``,
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func Load

func Load(path string, object interface{}) (err error)

Load decode Gob file

func Save

func Save(path string, object interface{}) (err error)

Save encode via Gob to file

Types

type ActivityStruct

type ActivityStruct struct {
	IssueID    int
	ActivityID int
	StartedAt  time.Time
	StoppedAt  time.Time
	Comment    string
}

type IssuePayloadStruct

type IssuePayloadStruct struct {
	Issue IssueStruct `json:"issue"`
}

type IssueStruct

type IssueStruct struct {
	Note string `json:"notes"`
}

type PayloadStruct

type PayloadStruct struct {
	TimeEntry TimeEntryStruct `json:"time_entry"`
}

PayloadStruct is the envelope to the time_entry expected by the Redmine API

type RedmineActivityStruct

type RedmineActivityStruct struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type RedmineGetTimeEntriesStruct

type RedmineGetTimeEntriesStruct struct {
	TimeEntries []RedmineTimeEntryStruct `json:"time_entries"`
}

type RedmineIssueStruct

type RedmineIssueStruct struct {
	ID int `json:"id"`
}

type RedmineProjectSctruct

type RedmineProjectSctruct struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type RedmineTimeEntryStruct

type RedmineTimeEntryStruct struct {
	ID        int                   `json:"id"`
	Time      float64               `json:"hours"`
	Comment   string                `json:"comments"`
	Date      string                `json:"spent_on"`
	CreatedOn string                `json:"created_on"`
	UpdatedOn string                `json:"updated_on"`
	Project   RedmineProjectSctruct `json:"project"`
	Issue     RedmineIssueStruct    `json:"issue"`
	User      RedmineUserStruct     `json:"user"`
	Activity  RedmineActivityStruct `json:"activity"`
}

type RedmineUserStruct

type RedmineUserStruct struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type TimeEntryStruct

type TimeEntryStruct struct {
	IssueID    int    `json:"issue_id"`
	Date       string `json:"spent_on"`
	Time       string `json:"hours"`
	ActivityID int    `json:"activity_id"`
	Comment    string `json:"comments"`
}

TimeEntryStruct is expected format of the Redmine API

Jump to

Keyboard shortcuts

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