Documentation
¶
Overview ¶
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2020 Daniele Rondina <geaaru@sabayonlinux.org> Credits goes also to Gogs authors, some code portions and re-implemented design are also coming from the Gogs project, which is using the go-macaron framework and was really source of ispiration. Kudos to them!
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- func GenDefault(viper *v.Viper)
- type Activity
- func (a *Activity) AddTask(t *Task)
- func (a *Activity) GetAllTasksList() []Task
- func (a *Activity) GetChangeRequests() *[]ChangeRequest
- func (a *Activity) GetLabelValue(key, dft string) string
- func (a *Activity) GetOffer() int64
- func (a *Activity) GetPlannedEffortTotSecs(workHours int) (int64, error)
- func (a *Activity) GetTaskByFullName(name string) (*Task, error)
- func (a *Activity) GetTasks() *[]Task
- func (a *Activity) GetTimeAndMaterialDailyOffer() float64
- func (a *Activity) HasFlag(flag string) bool
- func (a *Activity) HasLabelKey(key string) bool
- func (a *Activity) InitDefaultPriority(prio int)
- func (a *Activity) IsClosed() bool
- func (a *Activity) IsTimeAndMaterial() bool
- type ActivityReport
- func (a *ActivityReport) CalculateDuration() error
- func (a *ActivityReport) CalculateProfitPerc()
- func (a *ActivityReport) CalculateWorkPerc()
- func (a *ActivityReport) GetDuration() string
- func (a *ActivityReport) SetBusinessProgressPerc(v string)
- func (a *ActivityReport) SetCost(v float64)
- func (a *ActivityReport) SetEffort(v int64)
- func (a *ActivityReport) SetProfit(v float64)
- func (a *ActivityReport) SetRevenuePlan(v float64)
- func (a *ActivityReport) SetWork(v string)
- func (a *ActivityReport) SetWorkPerc(v string)
- func (a *ActivityReport) SetWorkSecs(v int64)
- type ActivityResearch
- type AgendaTimesheets
- type ChangeRequest
- type ChangeRequestReport
- type Client
- type Period
- type Resource
- type ResourceCost
- type ResourceHolidays
- type ResourceRate
- type ResourceSick
- type ResourceTimesheet
- func (rt *ResourceTimesheet) GetDate(onlyDate bool) (string, error)
- func (rt *ResourceTimesheet) GetDateUnix(onlyDate bool) (int64, error)
- func (rt *ResourceTimesheet) GetMapKey(opts TimesheetResearch, onlyDate bool) (string, error)
- func (rt *ResourceTimesheet) GetMonth(onlyDate bool) (string, error)
- func (rt *ResourceTimesheet) GetSeconds(workHours int) (int64, error)
- func (rt *ResourceTimesheet) ResolveActivityByName() string
- func (rt *ResourceTimesheet) SetCost(c float64)
- func (rt *ResourceTimesheet) SetRevenue(r float64)
- type ResourceTsAggregated
- func (rta *ResourceTsAggregated) AddResourceTimesheet(rt *ResourceTimesheet, workHours int) error
- func (rta *ResourceTsAggregated) CalculateDuration() (ans error)
- func (rta *ResourceTsAggregated) GetCost() float64
- func (rta *ResourceTsAggregated) GetDuration() string
- func (rta *ResourceTsAggregated) GetRevenue() float64
- func (rta *ResourceTsAggregated) GetSeconds() int64
- type ResourceUnemployed
- type Scenario
- type ScenarioActivity
- type ScenarioSchedule
- type ScenarioTask
- type Task
- func (t *Task) Clone(filtered bool) *Task
- func (t *Task) GetAllTasksAndSubTasksList(fatherName string, fatherResources []string, fatherIsCompleted bool) []Task
- func (t *Task) GetEffort() string
- func (t *Task) GetEffortSeconds(workHours int) (int64, error)
- func (t *Task) GetPlannedEffortTotSecs(workHours int) (int64, error)
- func (t *Task) GetSubTasks() *[]Task
- func (t *Task) GetTaskByFullName(fullname string) (*Task, error)
- func (t *Task) HasFlag(flag string) bool
- func (t *Task) HasLabelKey(key string) bool
- func (t *Task) InitDefaultPriority(prio int)
- func (t *Task) IsCompleted() bool
- func (t *Task) Validate(ignoreError bool) error
- type TaskRecursiveOpts
- type TaskReport
- type TaskResearch
- type TaskSchedPrioritySorter
- type TaskScheduled
- type TimeMasterConfig
- func (c *TimeMasterConfig) GetClientsDirs() []string
- func (c *TimeMasterConfig) GetGeneral() *TimeMasterConfigGeneral
- func (c *TimeMasterConfig) GetLogging() *TimeMasterConfigLogging
- func (c *TimeMasterConfig) GetResourcesDirs() []string
- func (c *TimeMasterConfig) GetScenariosDirs() []string
- func (c *TimeMasterConfig) GetTimesheetsDirs() []string
- func (c *TimeMasterConfig) GetWork() *TimeMasterConfigWork
- func (c *TimeMasterConfig) Unmarshal() error
- func (c *TimeMasterConfig) Yaml() ([]byte, error)
- type TimeMasterConfigGeneral
- type TimeMasterConfigLogging
- type TimeMasterConfigWork
- type TimesheetReport
- type TimesheetReportEvent
- type TimesheetReportPerUser
- type TimesheetResearch
Constants ¶
const ( TM_ENV_PREFIX = "TM" TM_CONFIGNAME = ".time-master" )
Variables ¶
This section is empty.
Functions ¶
func GenDefault ¶
Types ¶
type Activity ¶
type Activity struct {
Name string `json:"name" yaml:"name"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Note string `json:"note,omitempty" yaml:"note,omitempty"`
Priority int `json:"priority" yaml:"priority"`
File string `json:"-" yaml:"-"`
Disabled bool `json:"disabled,omitempty" yaml:"disabled,omitempty"`
Closed bool `json:"closed,omitempty" yaml:"closed,omitempty"`
Offer int64 `json:"offer,omitempty" yaml:"offer,omitempty"`
TimeMaterial bool `json:"time_material,omitempty" yaml:"time_material,omitempty"`
TMDailyOffer float64 `json:"time_material_daily_offer,omitempty" yaml:"time_material_daily_offer,omitempty"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
Flags []string `json:"flags,omitempty" yaml:"flags,omitempty"`
Tasks []Task `json:"tasks,omitempty" yaml:"tasks,omitempty"`
ChangeRequests []ChangeRequest `json:"change_requests,omitempty" yaml:"change_requests,omitempty"`
}
func NewActivity ¶
func (*Activity) GetAllTasksList ¶
func (*Activity) GetChangeRequests ¶ added in v0.3.0
func (a *Activity) GetChangeRequests() *[]ChangeRequest
func (*Activity) GetLabelValue ¶
func (*Activity) GetPlannedEffortTotSecs ¶
func (*Activity) GetTaskByFullName ¶
func (*Activity) GetTimeAndMaterialDailyOffer ¶
func (*Activity) HasLabelKey ¶
func (*Activity) InitDefaultPriority ¶
func (*Activity) IsTimeAndMaterial ¶
type ActivityReport ¶
type ActivityReport struct {
*Activity
RevenuePlan float64 `json:"revenue_plan,omitempty" yaml:"revenue_plan,omitempty"`
Cost float64 `json:"cost,omitempty" yaml:"cost,omitempty"`
Profit float64 `json:"profit,omitempty" yaml:"profit,omitempty"`
Work string `json:"work,omitempty" yaml:"work,omitempty"`
WorkPerc string `json:"work_perc,omitempty" yaml:"work_perc,omitempty"`
Duration string `json:"duration,omitempty" yaml:"duration,omitempty"`
ProfitPerc string `json:"profit_perc,omitempty" yaml:"profit_perc,omitempty"`
BusinessProgressPerc string `json:"business_progress_perc,omitempty" yaml:"business_progress_perc,omitempty"`
Effort int64 `json:"effort_sec,omitempty" yaml:"effort_sec,omitempty"`
WorkSecs int64 `json:"work_sec,omitempty" yaml:"work_sec,omitempty"`
}
func NewActivityReport ¶
func NewActivityReport(a Activity, filtered bool) *ActivityReport
func (*ActivityReport) CalculateDuration ¶
func (a *ActivityReport) CalculateDuration() error
func (*ActivityReport) CalculateProfitPerc ¶
func (a *ActivityReport) CalculateProfitPerc()
func (*ActivityReport) CalculateWorkPerc ¶
func (a *ActivityReport) CalculateWorkPerc()
func (*ActivityReport) GetDuration ¶
func (a *ActivityReport) GetDuration() string
func (*ActivityReport) SetBusinessProgressPerc ¶ added in v0.4.0
func (a *ActivityReport) SetBusinessProgressPerc(v string)
func (*ActivityReport) SetCost ¶
func (a *ActivityReport) SetCost(v float64)
func (*ActivityReport) SetEffort ¶
func (a *ActivityReport) SetEffort(v int64)
func (*ActivityReport) SetProfit ¶
func (a *ActivityReport) SetProfit(v float64)
func (*ActivityReport) SetRevenuePlan ¶
func (a *ActivityReport) SetRevenuePlan(v float64)
func (*ActivityReport) SetWork ¶
func (a *ActivityReport) SetWork(v string)
func (*ActivityReport) SetWorkPerc ¶
func (a *ActivityReport) SetWorkPerc(v string)
func (*ActivityReport) SetWorkSecs ¶
func (a *ActivityReport) SetWorkSecs(v int64)
type ActivityResearch ¶
type AgendaTimesheets ¶
type AgendaTimesheets struct {
File string `json:"-" yaml:"-"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Timesheets []ResourceTimesheet `json:"timesheets" yaml:"timesheets"`
}
func AgengaTimesheetFromYaml ¶
func AgengaTimesheetFromYaml(data []byte, file string) (*AgendaTimesheets, error)
func (*AgendaTimesheets) AddResourceTimesheet ¶
func (a *AgendaTimesheets) AddResourceTimesheet(rt *ResourceTimesheet)
func (*AgendaTimesheets) GetLastDateSecs ¶
func (a *AgendaTimesheets) GetLastDateSecs(onlyDate bool) (int64, error)
func (*AgendaTimesheets) GetTimesheets ¶
func (a *AgendaTimesheets) GetTimesheets() *[]ResourceTimesheet
type ChangeRequest ¶ added in v0.3.0
type ChangeRequest struct {
Name string `json:"name" yaml:"name"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Note string `json:"note,omitempty" yaml:"note,omitempty"`
PreviousOffer int64 `json:"previous_offer,omitempty" yaml:"previous_offer,omitempty"`
Offer int64 `json:"offer,omitempty" yaml:"offer,omitempty"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
Flags []string `json:"flags,omitempty" yaml:"flags,omitempty"`
}
type ChangeRequestReport ¶ added in v0.3.0
type ChangeRequestReport struct {
*ChangeRequest
ActivityName string `json:"activity,omitempty" yaml:"activity,omitempty"`
}
func NewChangeRequestReport ¶ added in v0.3.0
func NewChangeRequestReport(cr *ChangeRequest, activity string) *ChangeRequestReport
type Client ¶
type Client struct {
Name string `json:"name" yaml:"name"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
File string `json:"-" yaml:"-"`
ActivitiesDirs []string `json:"activities_dirs,omitempty" yaml:"activities_dirs,omitempty"`
Activities []Activity `json:"activities,omitempty" yaml:"activities,omitempty"`
}
func (*Client) AddActivity ¶
func (*Client) GetActivities ¶
func (*Client) GetActivityByName ¶
type Resource ¶
type Resource struct {
User string `json:"user" yaml:"user"`
Name string `json:"name" yaml:"name"`
Email []string `json:"email,omitempty" yaml:"email,omitempty"`
Phone []string `json:"phone,omitempty" yaml:"phone,omitempty"`
File string `json:"-" yaml:"-"`
Holidays []ResourceHolidays `json:"holidays,omitempty" yaml:"holidays,omitempty"`
Sick []ResourceSick `json:"sick,omitempty" yaml:"sick,omitempty"`
Unemployed []ResourceUnemployed `json:"unemployed,omitempty" yaml:"unemployed,omitempty"`
}
func NewResource ¶
func (*Resource) AddHoliday ¶
func (r *Resource) AddHoliday(rh ResourceHolidays)
func (*Resource) AddSick ¶
func (r *Resource) AddSick(s ResourceSick)
func (*Resource) AddUnemployed ¶
func (r *Resource) AddUnemployed(ru ResourceUnemployed)
type ResourceCost ¶
type ResourceHolidays ¶
type ResourceHolidays struct {
*Period
}
type ResourceRate ¶
type ResourceSick ¶
type ResourceSick struct {
*Period
}
type ResourceTimesheet ¶
type ResourceTimesheet struct {
*Period
User string `json:"user" yaml:"user"`
Task string `json:"task" yaml:"task"`
Duration string `json:"duration" yaml:"duration"`
Note string `json:"note,omitempty" yaml:"note,omitempty"`
// Internal
Cost float64 `json:"cost,omitempty" yaml:"cost,omitempty"`
Revenue float64 `json:"revenue,omitempty" yaml:"revenue,omitempty"`
}
ResourceTimesheet contains the description of the user timesheet for one single day. Multiple days range aren't supported.
func NewResourceTimesheet ¶
func NewResourceTimesheet(user, startDate, task, duration string) *ResourceTimesheet
func (*ResourceTimesheet) GetDate ¶
func (rt *ResourceTimesheet) GetDate(onlyDate bool) (string, error)
func (*ResourceTimesheet) GetDateUnix ¶
func (rt *ResourceTimesheet) GetDateUnix(onlyDate bool) (int64, error)
func (*ResourceTimesheet) GetMapKey ¶
func (rt *ResourceTimesheet) GetMapKey(opts TimesheetResearch, onlyDate bool) (string, error)
func (*ResourceTimesheet) GetMonth ¶
func (rt *ResourceTimesheet) GetMonth(onlyDate bool) (string, error)
func (*ResourceTimesheet) GetSeconds ¶
func (rt *ResourceTimesheet) GetSeconds(workHours int) (int64, error)
func (*ResourceTimesheet) ResolveActivityByName ¶
func (rt *ResourceTimesheet) ResolveActivityByName() string
func (*ResourceTimesheet) SetCost ¶
func (rt *ResourceTimesheet) SetCost(c float64)
func (*ResourceTimesheet) SetRevenue ¶
func (rt *ResourceTimesheet) SetRevenue(r float64)
type ResourceTsAggregated ¶
type ResourceTsAggregated struct {
*Period
User string `json:"user,omitempty" yaml:"user,omitempty"`
Task string `json:"task,omitempty" yaml:"task,omitempty"`
Duration string `json:"duration" yaml:"duration"`
Seconds int64 `json:"-" yaml:"-"`
Cost float64 `json:"cost,omitempty" yaml:"cost,omitempty"`
Revenue float64 `json:"revenue,omitempty" yaml:"revenue,omitempty"`
}
func NewResourceTsAggregated ¶
func NewResourceTsAggregated(date, user, task string) *ResourceTsAggregated
func (*ResourceTsAggregated) AddResourceTimesheet ¶
func (rta *ResourceTsAggregated) AddResourceTimesheet(rt *ResourceTimesheet, workHours int) error
func (*ResourceTsAggregated) CalculateDuration ¶
func (rta *ResourceTsAggregated) CalculateDuration() (ans error)
func (*ResourceTsAggregated) GetCost ¶
func (rta *ResourceTsAggregated) GetCost() float64
func (*ResourceTsAggregated) GetDuration ¶
func (rta *ResourceTsAggregated) GetDuration() string
func (*ResourceTsAggregated) GetRevenue ¶
func (rta *ResourceTsAggregated) GetRevenue() float64
func (*ResourceTsAggregated) GetSeconds ¶
func (rta *ResourceTsAggregated) GetSeconds() int64
type ResourceUnemployed ¶
type ResourceUnemployed struct {
*Period
}
type Scenario ¶
type Scenario struct {
Name string `json:"name" yaml:"name"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
File string `json:"-" yaml:"-"`
ResourceCosts []ResourceCost `json:"resources_cost,omitempty" yaml:"resources_cost,omitempty"`
Rates []ResourceRate `json:"rates,omitempty" yaml:"rates,omitempty"`
NowTime string `json:"now,omitempty" yaml:"now,omitempty"`
Scheduler string `json:"scheduler,omitempty" yaml:"scheduler,omitempty"`
// For scheduler simple
Tasks []ScenarioTask `json:"task_prorities,omitempty" yaml:"task_prorities,omitempty"`
Activities []ScenarioActivity `json:"activities_priorities,omitempty" yaml:"activities_priorities,omitempty"`
}
func (*Scenario) GetResourceCost4Date ¶
func (*Scenario) GetResourceRate4Date ¶
type ScenarioActivity ¶
type ScenarioSchedule ¶
type ScenarioSchedule struct {
*Scenario
File string `json:"-" yaml:"-"`
Schedule []TaskScheduled `json:schedule,omitempty yaml:"schedule,omitempty`
}
func ScenarioScheduleFromFile ¶
func ScenarioScheduleFromFile(file string) (*ScenarioSchedule, error)
func ScenarioScheduleFromYaml ¶
func ScenarioScheduleFromYaml(data []byte, file string) (*ScenarioSchedule, error)
func (*ScenarioSchedule) GetAllResourceTimesheets ¶
func (s *ScenarioSchedule) GetAllResourceTimesheets() *AgendaTimesheets
func (*ScenarioSchedule) Write2File ¶
func (s *ScenarioSchedule) Write2File(f string) error
type ScenarioTask ¶
type Task ¶
type Task struct {
*Period
Name string `json:"name" yaml:"name"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Note string `json:"note,omitempty" yaml:"note,omitempty"`
Priority int `json:"priority,omitempty" yaml:"priority,omitempty"`
Effort string `json:"effort,omitempty" yaml:"effort,omitempty"`
Completed bool `json:"completed,omitempty" yaml:"completed,omitempty"`
AllocatedResource []string `json:"resources,omitempty" yaml:"resources,omitempty"`
Milestone string `json:"milestone,omitempty" yaml:"milestone,omitempty"`
Flags []string `json:"flags,omitempty" yaml:"flags,omitempty"`
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
Tasks []Task `json:"subtasks,omitempty" yaml:"subtasks,omitempty"`
Depends []string `json:"depends,omitempty" yaml:"depends,omitempty"`
// Recursive options
Recursive TaskRecursiveOpts `json:"recursive,omitempty" yaml:"recursive,omitempty"`
}
General task structure for files specs
func (*Task) GetAllTasksAndSubTasksList ¶
func (*Task) GetPlannedEffortTotSecs ¶
func (*Task) GetSubTasks ¶
func (*Task) HasLabelKey ¶
func (*Task) InitDefaultPriority ¶
func (*Task) IsCompleted ¶
type TaskRecursiveOpts ¶
type TaskRecursiveOpts struct {
Enable bool `json:"enable" yaml:"enable"`
// Type of recursion: weekly (default) | monthly | daily
Mode string `json:"mode,omitempty" yaml:"mode,omitempty"`
Duration string `json:"duration,omitempty" yaml:"duration,omitempty"`
Exclude []Period `json:"exclude,omitempty" yaml:"exclude,omitempty"`
}
func (*TaskRecursiveOpts) GetDuration ¶
func (ts *TaskRecursiveOpts) GetDuration() string
func (*TaskRecursiveOpts) GetMode ¶
func (ts *TaskRecursiveOpts) GetMode() string
func (*TaskRecursiveOpts) GetSeconds ¶
func (ts *TaskRecursiveOpts) GetSeconds(workHours int) (int64, error)
func (*TaskRecursiveOpts) IsAvailable ¶
func (ts *TaskRecursiveOpts) IsAvailable(workDate string) (bool, error)
type TaskReport ¶
type TaskReport struct {
*Task `json:"task,omitempty" yaml:"task,omitempty"`
Name string `json:"name" yaml:"name"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Work string `json:"work,omitempty" yaml:"work,omitempty"`
WorkSec int64 `json:"work_sec,omitempty" yaml:"work_sec,omitempty"`
Effort string `json:"effort" yaml:"effort"`
EffortSec int64 `json:"effort_sec" yaml:"effort_sec"`
Cost float64 `json:"cost,omitempty" yaml:"cost,omitempty"`
}
type TaskResearch ¶
type TaskSchedPrioritySorter ¶
type TaskSchedPrioritySorter []TaskScheduled
func (TaskSchedPrioritySorter) Len ¶
func (t TaskSchedPrioritySorter) Len() int
func (TaskSchedPrioritySorter) Less ¶
func (t TaskSchedPrioritySorter) Less(i, j int) bool
func (TaskSchedPrioritySorter) Swap ¶
func (t TaskSchedPrioritySorter) Swap(i, j int)
type TaskScheduled ¶
type TaskScheduled struct {
*Task
*Period
// We don't need this on yaml because could be stored with clients
Activity *Activity `json:"-" yaml:"-"`
Client *Client `json:"client" yaml:"client"`
Progress float64 `json:"progress,omitempty" yaml:"progress,omitempty"`
WorkTime int64 `json:"work_time,omitempty" yaml:"work_time,omitempty"`
LeftTime int64 `json:"-" yaml:"-"`
Underestimated bool `json:"understimated,omitempty" yaml:"understimated,omitempty"`
Timesheets []ResourceTimesheet `json:"timesheets,omitempty" yaml:"timesheets,omitempty"`
}
func (*TaskScheduled) AddTimesheet ¶
func (t *TaskScheduled) AddTimesheet(rt *ResourceTimesheet)
func (*TaskScheduled) ElaborateTimesheets ¶
func (t *TaskScheduled) ElaborateTimesheets(onlyDate bool, workHours int, withPlan bool) error
type TimeMasterConfig ¶
type TimeMasterConfig struct {
Viper *v.Viper `yaml:"-" json:"-"`
General TimeMasterConfigGeneral `mapstructure:"general" json:"general,omitempty" yaml:"general,omitempty"`
Logging TimeMasterConfigLogging `mapstructure:"logging" json:"logging,omitempty" yaml:"logging,omitempty"`
Work TimeMasterConfigWork `mapstructure:"work,omitempty" json:"work,omitempty" yaml:"work,omitempty"`
ClientsDirs []string `mapstructure:"clients_dirs,omitempty" json:"clients_dirs,omitempty" yaml:"clients_dirs,omitempty"`
ResourcesDirs []string `mapstructure:"resources_dirs,omitempty" json:"resources_dirs,omitempty" yaml:"resources_dirs,omitempty"`
ScenariosDirs []string `mapstructure:"scenarios_dirs,omitempty" json:"scenarios_dirs,omitempty" yaml:"scenarios_dirs,omitempty"`
TimesheetsDirs []string `mapstructure:"timesheets_dirs,omitempty" json:"timesheets_dirs,omitempty" yaml:"timesheets_dirs,omitempty"`
}
func NewTimeMasterConfig ¶
func NewTimeMasterConfig(viper *v.Viper) *TimeMasterConfig
func (*TimeMasterConfig) GetClientsDirs ¶
func (c *TimeMasterConfig) GetClientsDirs() []string
func (*TimeMasterConfig) GetGeneral ¶
func (c *TimeMasterConfig) GetGeneral() *TimeMasterConfigGeneral
func (*TimeMasterConfig) GetLogging ¶
func (c *TimeMasterConfig) GetLogging() *TimeMasterConfigLogging
func (*TimeMasterConfig) GetResourcesDirs ¶
func (c *TimeMasterConfig) GetResourcesDirs() []string
func (*TimeMasterConfig) GetScenariosDirs ¶
func (c *TimeMasterConfig) GetScenariosDirs() []string
func (*TimeMasterConfig) GetTimesheetsDirs ¶
func (c *TimeMasterConfig) GetTimesheetsDirs() []string
func (*TimeMasterConfig) GetWork ¶
func (c *TimeMasterConfig) GetWork() *TimeMasterConfigWork
func (*TimeMasterConfig) Unmarshal ¶
func (c *TimeMasterConfig) Unmarshal() error
func (*TimeMasterConfig) Yaml ¶
func (c *TimeMasterConfig) Yaml() ([]byte, error)
type TimeMasterConfigGeneral ¶
type TimeMasterConfigGeneral struct {
Debug bool `mapstructure:"debug,omitempty" json:"debug,omitempty" yaml:"debug,omitempty"`
}
func (*TimeMasterConfigGeneral) HasDebug ¶
func (g *TimeMasterConfigGeneral) HasDebug() bool
type TimeMasterConfigLogging ¶
type TimeMasterConfigLogging struct {
// Path of the logfile
Path string `mapstructure:"path,omitempty" json:"path,omitempty" yaml:"path,omitempty"`
// Enable/Disable logging to file
EnableLogFile bool `mapstructure:"enable_logfile,omitempty" json:"enable_logfile,omitempty" yaml:"enable_logfile,omitempty"`
// Enable JSON format logging in file
JsonFormat bool `mapstructure:"json_format,omitempty" json:"json_format,omitempty" yaml:"json_format,omitempty"`
// Log level
Level string `mapstructure:"level,omitempty" json:"level,omitempty" yaml:"level,omitempty"`
// Enable emoji
EnableEmoji bool `mapstructure:"enable_emoji,omitempty" json:"enable_emoji,omitempty" yaml:"enable_emoji,omitempty"`
// Enable/Disable color in logging
Color bool `mapstructure:"color,omitempty" json:"color,omitempty" yaml:"color,omitempty"`
}
type TimeMasterConfigWork ¶
type TimeMasterConfigWork struct {
// Default number of hours for day
WorkHours int `mapstructure:"work_hours,omitempty" json:"work_hours,omitempty" yaml:"work_hours,omitempty"`
TaskDefaultPriority int `mapstructure:"task_default_priority,omitempty" json:"task_default_priority,omitempty" yaml:"task_default_priority,omitempty"`
}
type TimesheetReport ¶
type TimesheetReport struct {
User string `json:"user,omitempty" yaml:"user,omitempty"`
Date string `json:"date,omitempty" yaml:"date,omitempty"`
Task string `json:"task,omitempty" yaml:"task,omitempty"`
Activity string `json:"activity,omitempty" yaml:"activity,omitempty"`
Effort string `json:"effort,omitempty" yaml:"effort,omitempty"`
EffortSec int64 `json:"effort_sec,omitempty" yaml:"effort_sec,omitempty"`
}
type TimesheetReportEvent ¶
type TimesheetReportPerUser ¶
type TimesheetReportPerUser struct {
User string `json:"user,omitempty" yaml:"user,omitempty"`
Events []TimesheetReportEvent `json:"events,omitempty", yaml:"events,omitempty"`
TotEffortSec int64 `json:"tot_effort_sec,omitempty" yaml:"tot_effort_sec,omitempty"`
TotEffort string `json:"tot_effort,omitempty" yaml:"tot_effort,omitempty"`
}