data

package
v0.0.0-...-57c44c3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2014 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

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 HmFromD

func HmFromD(d time.Duration) hoursMins

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 Save

func Save(ps Persistable) error

Saves Protocol Message to file

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 (d *Dropbox) EntryDirPath(e *Entry) string

func (*Dropbox) Init

func (d *Dropbox) Init() error

reads ~/.dropbox/host.db and detects location of Dropbox folder and create BasePath directory if doesn't exists

func (*Dropbox) MkProjectDir

func (d *Dropbox) MkProjectDir(p *Project) (err error)

func (*Dropbox) ProjectDirPath

func (d *Dropbox) ProjectDirPath(p *Project) string

func (*Dropbox) Projects

func (d *Dropbox) Projects() (projects []*Project)

func (Dropbox) String

func (d Dropbox) String() string

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) EndedTime

func (e *Entry) EndedTime() (*time.Time, error)

func (*Entry) GetBillable

func (this *Entry) GetBillable() bool

func (*Entry) GetContent

func (this *Entry) GetContent() string

func (*Entry) GetCreator

func (this *Entry) GetCreator() *Person

func (*Entry) GetDuration

func (this *Entry) GetDuration() int64

func (*Entry) GetEnded

func (this *Entry) GetEnded() int64

func (*Entry) GetId

func (this *Entry) GetId() string

func (*Entry) GetProject

func (this *Entry) GetProject() *Project

func (*Entry) GetStarted

func (this *Entry) GetStarted() int64

func (*Entry) GetTags

func (this *Entry) GetTags() []string

func (*Entry) GetType

func (this *Entry) GetType() Entry_Type

func (*Entry) HoursMins

func (e *Entry) HoursMins() hoursMins

func (*Entry) Location

func (e *Entry) Location() string

func (*Entry) Minutes

func (e *Entry) Minutes() float64

func (*Entry) ProtoMessage

func (*Entry) ProtoMessage()

func (*Entry) Reset

func (this *Entry) Reset()

func (*Entry) StartedTime

func (e *Entry) StartedTime() (*time.Time, error)

func (*Entry) String

func (this *Entry) String() string

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 Persistable interface {
	proto.Message
	// contains filtered or unexported methods
}

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) GetEmail

func (this *Person) GetEmail() string

func (*Person) GetName

func (this *Person) GetName() string

func (*Person) ProtoMessage

func (*Person) ProtoMessage()

func (*Person) Reset

func (this *Person) Reset()

func (*Person) String

func (this *Person) String() string

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 CreateProject(name string) *Project

func (*Project) CreateEntry

func (project *Project) CreateEntry(content string, billable bool) *Entry

func (*Project) CreateEntryWithDuration

func (project *Project) CreateEntryWithDuration(
	content string,
	duration time.Duration,
	billable bool) *Entry

func (*Project) Entries

func (p *Project) Entries() (entries []*Entry)

func (*Project) GetCompany

func (this *Project) GetCompany() string

func (*Project) GetHide

func (this *Project) GetHide() bool

func (*Project) GetName

func (this *Project) GetName() string

func (*Project) GetSha

func (this *Project) GetSha() string

func (*Project) GetShaFromName

func (p *Project) GetShaFromName() string

func (*Project) Location

func (p *Project) Location() string

func (*Project) OnClock

func (project *Project) OnClock() (bool, *Timer)

func (*Project) ProtoMessage

func (*Project) ProtoMessage()

func (*Project) Reset

func (this *Project) Reset()

func (*Project) StartTimer

func (project *Project) StartTimer() (err error)

func (*Project) Status

func (project *Project) Status(statues chan *ProjectStatus)

fetch status of project in goroutine and return on channel

func (*Project) StopTimer

func (project *Project) StopTimer(c string, bill bool) (err error)

func (*Project) String

func (this *Project) String() string

type ProjectStatus

type ProjectStatus struct {
	Project *Project

	OnClock bool
	// contains filtered or unexported fields
}

func (ProjectStatus) String

func (hm ProjectStatus) String() string

consistent string presentation of hoursMins

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 CreateTimer(project *Project) *Timer

func GetTimer

func GetTimer(project *Project) *Timer

func (*Timer) Duration

func (t *Timer) Duration() time.Duration

func (*Timer) GetProject

func (this *Timer) GetProject() *Project

func (*Timer) GetStarted

func (this *Timer) GetStarted() int64

func (*Timer) Location

func (t *Timer) Location() string

func (*Timer) ProtoMessage

func (*Timer) ProtoMessage()

func (*Timer) Reset

func (this *Timer) Reset()

func (*Timer) Start

func (t *Timer) Start()

func (*Timer) StartedTime

func (t *Timer) StartedTime() (*time.Time, error)

func (*Timer) Stop

func (t *Timer) Stop(e *Entry) error

func (*Timer) String

func (this *Timer) String() string

Jump to

Keyboard shortcuts

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