Documentation
¶
Index ¶
- Constants
- Variables
- func DoTaskModify(entry EntryRow, id int)
- func DoTaskSubmit(entries ...EntryRow) error
- func ImportWorklog(db *Database) (int, error)
- func LoginGetTaskForm(formLogged *bool, username string, pass string) error
- func LoginGetTasks(formLogged *bool) bool
- func SetLogger(l *log.Logger)
- type Activity
- type ActivityResp
- type Auth
- type AuthResp
- type CompanyAccounts
- type Data
- type Database
- func (d *Database) AddToActMap(projCode string, act list.Item) error
- func (d *Database) AddToTaskMap(projCode string, item list.Item) error
- func (d *Database) AlterProjTable() error
- func (d *Database) AlterTable() error
- func (d *Database) CloseDatabase()
- func (d *Database) CreateDatabase() error
- func (d *Database) CreateEventDatabase() error
- func (d *Database) DeleteEntry(e int) error
- func (d *Database) DeleteLink(projCode string) error
- func (d *Database) ModifyEntry(e EntryRow) error
- func (d *Database) OpenDatabase(t *testing.T) error
- func (d *Database) QueryAndExport() error
- func (d *Database) QueryEntries(id, maxId *int) ([]EntryRow, error)
- func (d *Database) QueryEntry(e EntryRow) (EntryRow, error)
- func (d *Database) QueryLinks() (map[string]int, map[string]int, error)
- func (d *Database) QuerySummary(start, end *time.Time) ([]EntryRow, error)
- func (d *Database) SaveAct(proj string, id int) error
- func (d *Database) SaveEntry(entry EntryRow) error
- func (d *Database) SaveLink(proj string, id int) error
- func (d *Database) SeedDatabase() error
- type Entry
- type EntryRow
- type Item
- type ModifyResp
- type Request
- type StatusCode
- type TaskEntry
- type TaskListResp
Constants ¶
View Source
const ( Nothing StatusCode = iota Success = 200 InvalidRequest = 400 NoAuth = 401 Forbidden = 403 RequestTimeout = 408 TooManyReq = 429 ServerError = 500 )
View Source
const ( Date = iota Code Desc StartTime EndTime Hours Submit Deleted Imp Unlink )
Variables ¶
View Source
var ProjCodeToAct map[string]int // same as above
View Source
var ProjCodeToTask map[string]int // This is nil, reference before assignment will cause nil pointer issues
Functions ¶
func DoTaskModify ¶
For modifying an already submitted task.
func ImportWorklog ¶
For the moment the import function will only look for a file
func LoginGetTasks ¶
bool to let system know if it should continue with process or prompt user for input
Types ¶
type Activity ¶
type Activity struct { ActivityID int `json:"activity_id"` ActName string `json:"name"` ParentName string `json:"parent_name"` IsActive bool `json:"is_active"` }
func (Activity) Description ¶
func (Activity) FilterValue ¶
type ActivityResp ¶
type ActivityResp struct { Status string `json:"status"` StatusCode int `json:"statusCode"` Messages interface{} `json:"messages"` Data []Activity `json:"data"` }
var ActResp ActivityResp
func (*ActivityResp) ConstructActList ¶
func (a *ActivityResp) ConstructActList() []list.Item
type Auth ¶
type Auth struct { Username string `json:"username"` Password string `json:"password"` DeviceName string `json:"device_name"` DeviceType string `json:"device_type"` DeviceID string `json:"device_id"` Request struct { } `json:"request"` CompanyID string `json:"company_account_id"` Lang string `json:"lang"` }
type AuthResp ¶
type AuthResp struct { Status string `json:"status"` StatusCode int `json:"statusCode"` Messages interface{} `json:"messages"` Data struct { Token string `json:"token"` Settings struct { UserID int `json:"user_id"` MasterCompanyAccount string `json:"master_company_account"` FirstDayofWeek string `json:"first_day_of_week"` Timezone string `json:"timezone"` LocaleClock string `json:"locale_clock"` LocaleDate string `json:"locale_date"` LocaleNumber struct { ThousandSeparator string `json:"thousandSeparator"` DecimalSeparator string `json:"decimalSeparator"` } `json:"locale_number"` CompanyAccounts []CompanyAccounts `json:"company_accounts"` } `json:"settings"` } `json:"data"` }
var Authenticate AuthResp
type CompanyAccounts ¶
type Data ¶
type Data struct { ActivityID int `json:"activity_id"` EventID int `json:"event_id"` EventName string `json:"event_name"` ProjectName string `json:"project_name"` ProjectID int `json:"project_id"` TimeID int `json:"time_entry_id"` Desc string `json:"description"` StartDateTime string `json:"start_datetime"` Dur string `json:"duration"` Comp string `json:"completed_datetime"` }
func (Data) Description ¶
func (Data) FilterValue ¶
type Database ¶
func (*Database) AddToActMap ¶
function to map task list resp
func (*Database) AddToTaskMap ¶
function to map task list resp
func (*Database) AlterProjTable ¶
Check if table has the notes column and add if not
func (*Database) AlterTable ¶
Check if table has the notes column and add if not
func (*Database) CloseDatabase ¶
func (d *Database) CloseDatabase()
func (*Database) CreateDatabase ¶
func (*Database) CreateEventDatabase ¶
func (*Database) DeleteEntry ¶
func (*Database) DeleteLink ¶
func (*Database) ModifyEntry ¶
func (*Database) QueryAndExport ¶
func (*Database) QueryEntries ¶
TODO: fix this to make list construction work better
func (*Database) QueryLinks ¶
This should be the only function required to read links
func (*Database) QuerySummary ¶
func (*Database) SeedDatabase ¶
TODO: Seed database for better tests.
type EntryRow ¶
func (EntryRow) Description ¶
func (EntryRow) FilterValue ¶
func (*EntryRow) ModFillData ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Custom items for item
func (Item) Description ¶
func (Item) FilterValue ¶
type ModifyResp ¶
type Request ¶
type Request struct { EventID int `json:"event_id"` Description string `json:"description"` Date string `json:"time_entry_date"` CompDate string `json:"completed_datetime"` CreatedDate string `json:"submitted_date"` Duration string `json:"duration"` StartDateTime string `json:"start_datetime"` Completed bool `json:"is_completed"` Title string `json:"title"` ActivityID int `json:"activity_id"` }
type StatusCode ¶
type StatusCode int
type TaskEntry ¶
type TaskEntry struct { Status string `json:"status"` StatusCode int `json:"statusCode"` Messages interface{} `json:"messages"` Request Request }
This should marshal and unmarshal to the Modify API call in Scoro V2 API docs
type TaskListResp ¶
type TaskListResp struct { Status string `json:"status"` StatusCode int `json:"statusCode"` Messages interface{} `json:"messages"` Data []Data `json:"data"` }
var TaskList TaskListResp
func (*TaskListResp) ConstructTaskList ¶
func (d *TaskListResp) ConstructTaskList() []list.Item
func (*TaskListResp) String ¶
func (t *TaskListResp) String() string
Click to show internal directories.
Click to hide internal directories.