Documentation ¶
Index ¶
- Variables
- func Destroy(ps Destroyable) error
- func HmFromD(d time.Duration) hoursMins
- func Load(ps Persistable) error
- func LoadFromPath(path string, ps Persistable) error
- func Persisted(ps Persistable) bool
- func PrintProjectLog(project *Project)
- func PrintProjectStatus(month int)
- func Save(ps Persistable) error
- func Update(ps Persistable) error
- type Destroyable
- type Dropbox
- type Entry
- func (e *Entry) EndedTime() (*time.Time, error)
- func (this *Entry) GetBillable() bool
- func (this *Entry) GetContent() string
- func (this *Entry) GetCreator() *Person
- func (this *Entry) GetDuration() int64
- func (this *Entry) GetEnded() int64
- func (this *Entry) GetId() string
- func (this *Entry) GetProject() *Project
- func (this *Entry) GetStarted() int64
- func (this *Entry) GetTags() []string
- func (this *Entry) GetType() Entry_Type
- func (e *Entry) HoursMins() hoursMins
- func (e *Entry) Location() string
- func (e *Entry) Minutes() float64
- func (*Entry) ProtoMessage()
- func (this *Entry) Reset()
- func (e *Entry) StartedTime() (*time.Time, error)
- func (this *Entry) String() string
- type Entry_Type
- type Persistable
- type Person
- type Project
- func (project *Project) CreateEntry(content string, billable bool) *Entry
- func (project *Project) CreateEntryWithDuration(content string, duration time.Duration, billable bool) *Entry
- func (p *Project) Entries() (entries []*Entry)
- func (this *Project) GetCompany() string
- func (this *Project) GetHide() bool
- func (this *Project) GetName() string
- func (this *Project) GetSha() string
- func (p *Project) GetShaFromName() string
- func (p *Project) Location() string
- func (project *Project) OnClock() (bool, *Timer)
- func (*Project) ProtoMessage()
- func (this *Project) Reset()
- func (project *Project) StartTimer() (err error)
- func (project *Project) Status(statues chan *ProjectStatus)
- func (project *Project) StopTimer(c string, bill bool) (err error)
- func (this *Project) String() string
- type ProjectStatus
- type Timer
- func (t *Timer) Duration() time.Duration
- func (this *Timer) GetProject() *Project
- func (this *Timer) GetStarted() int64
- func (t *Timer) Location() string
- func (*Timer) ProtoMessage()
- func (this *Timer) Reset()
- func (t *Timer) Start()
- func (t *Timer) StartedTime() (*time.Time, error)
- func (t *Timer) Stop(e *Entry) error
- func (this *Timer) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var Entry_Type_name = map[int32]string{
0: "CHORE",
1: "FUN",
2: "WORK",
}
View Source
var Entry_Type_value = map[string]int32{
"CHORE": 0,
"FUN": 1,
"WORK": 2,
}
Functions ¶
func Destroy ¶
func Destroy(ps Destroyable) error
func Load ¶
func Load(ps Persistable) error
func LoadFromPath ¶
func LoadFromPath(path string, ps Persistable) error
func Persisted ¶
func Persisted(ps Persistable) bool
func PrintProjectLog ¶
func PrintProjectLog(project *Project)
func PrintProjectStatus ¶
func PrintProjectStatus(month int)
func Update ¶
func Update(ps Persistable) error
Types ¶
type Destroyable ¶
type Destroyable interface {
// contains filtered or unexported methods
}
type Dropbox ¶
type Dropbox struct {
BasePath string
}
var (
DB *Dropbox
)
func (*Dropbox) EntryDirPath ¶
func (*Dropbox) Init ¶
reads ~/.dropbox/host.db and detects location of Dropbox folder and create BasePath directory if doesn't exists
func (*Dropbox) MkProjectDir ¶
func (*Dropbox) ProjectDirPath ¶
type Entry ¶
type Entry struct { Id *string `protobuf:"bytes,1,req,name=id" json:"id,omitempty"` Duration *int64 `protobuf:"varint,2,req,name=duration" json:"duration,omitempty"` Content *string `protobuf:"bytes,3,opt,name=content" json:"content,omitempty"` Creator *Person `protobuf:"bytes,4,opt,name=creator" json:"creator,omitempty"` Started *int64 `protobuf:"varint,5,opt,name=started" json:"started,omitempty"` Ended *int64 `protobuf:"varint,6,opt,name=ended" json:"ended,omitempty"` Type *Entry_Type `protobuf:"varint,7,opt,name=type,enum=data.Entry_Type,def=2" json:"type,omitempty"` Project *Project `protobuf:"bytes,8,opt,name=project" json:"project,omitempty"` Billable *bool `protobuf:"varint,9,opt,name=billable" json:"billable,omitempty"` Tags []string `protobuf:"bytes,10,rep,name=tags" json:"tags,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*Entry) GetBillable ¶
func (*Entry) GetContent ¶
func (*Entry) GetCreator ¶
func (*Entry) GetDuration ¶
func (*Entry) GetProject ¶
func (*Entry) GetStarted ¶
func (*Entry) GetType ¶
func (this *Entry) GetType() Entry_Type
func (*Entry) ProtoMessage ¶
func (*Entry) ProtoMessage()
type Entry_Type ¶
type Entry_Type int32
const ( Entry_CHORE Entry_Type = 0 Entry_FUN Entry_Type = 1 Entry_WORK Entry_Type = 2 )
const Default_Entry_Type Entry_Type = Entry_WORK
func (Entry_Type) Enum ¶
func (x Entry_Type) Enum() *Entry_Type
func (Entry_Type) MarshalJSON ¶
func (x Entry_Type) MarshalJSON() ([]byte, error)
func (Entry_Type) String ¶
func (x Entry_Type) String() string
func (*Entry_Type) UnmarshalJSON ¶
func (x *Entry_Type) UnmarshalJSON(data []byte) error
type Persistable ¶
type Person ¶
type Person struct { Email *string `protobuf:"bytes,1,req,name=email" json:"email,omitempty"` Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*Person) ProtoMessage ¶
func (*Person) ProtoMessage()
type Project ¶
type Project struct { Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` Company *string `protobuf:"bytes,2,opt,name=company" json:"company,omitempty"` Hide *bool `protobuf:"varint,3,opt,name=hide" json:"hide,omitempty"` Sha *string `protobuf:"bytes,4,opt,name=sha" json:"sha,omitempty"` XXX_unrecognized []byte `json:"-"` }
func CreateProject ¶
func (*Project) CreateEntry ¶
func (*Project) CreateEntryWithDuration ¶
func (*Project) GetCompany ¶
func (*Project) GetShaFromName ¶
func (*Project) ProtoMessage ¶
func (*Project) ProtoMessage()
func (*Project) StartTimer ¶
func (*Project) Status ¶
func (project *Project) Status(statues chan *ProjectStatus)
fetch status of project in goroutine and return on channel
type ProjectStatus ¶
type Timer ¶
type Timer struct { Project *Project `protobuf:"bytes,1,req,name=project" json:"project,omitempty"` Started *int64 `protobuf:"varint,2,req,name=started" json:"started,omitempty"` XXX_unrecognized []byte `json:"-"` }
func CreateTimer ¶
func (*Timer) GetProject ¶
func (*Timer) GetStarted ¶
func (*Timer) ProtoMessage ¶
func (*Timer) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.