log

package
v0.0.0-...-291e031 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LegacyTimeFormat string = "2006-01-02T15:04:05"

	CSVDateFormat   string = "1/2/2006"
	CSVTimeFormat   string = "03:04:05 PM"
	CSVDateIndex    int    = 0
	CSVBeginIndex   int    = 1
	CSVEndIndex     int    = 2
	CSVMessageIndex int    = 4
)

Variables

This section is empty.

Functions

func ConvertLegacyRecords

func ConvertLegacyRecords(r *LegacyReport) (records []TimeRecord, projects []Project)

Types

type LegacyProject

type LegacyProject struct {
	TimeRecords  map[string]LegacyTimeRecord
	Name         string
	ProjectTotal float32
	ClockTime    float32
	Report       string
}

func (LegacyProject) String

func (p LegacyProject) String() string

type LegacyReport

type LegacyReport struct {
	ReportDate     string
	Projects       map[string]LegacyProject
	Notes          []string
	UnmatchedLines []string
	TimeRecords    []LegacyTimeRecord
}

func ImportReportFromJSON

func ImportReportFromJSON(r io.Reader) (*LegacyReport, error)

func (LegacyReport) String

func (r LegacyReport) String() string

type LegacyTimeRecord

type LegacyTimeRecord struct {
	BeginTime            string
	EndTime              string
	Fraction             float32
	Notes                string
	ProjectName          string
	TimeSpanMinutes      float32
	TimeSpanQuarterHours float32
	TimeSpanHours        float32
	BillableHours        float32
	ReportLine           string
}

type MongoDB

type MongoDB struct {
	// contains filtered or unexported fields
}

func NewMongoDB

func NewMongoDB(serverlist string) *MongoDB

func (*MongoDB) GetRecords

func (d *MongoDB) GetRecords() []TimeRecord

func (*MongoDB) SaveRecords

func (d *MongoDB) SaveRecords(records []TimeRecord) error

type Project

type Project struct {
	ID   util.UUID `bson:"_id"`
	Name string
}

func NewProject

func NewProject(name string) Project

func (Project) String

func (p Project) String() string

type RelDB

type RelDB struct {
	// contains filtered or unexported fields
}

func NewRelDB

func NewRelDB(path string) *RelDB

func (*RelDB) GetRecords

func (d *RelDB) GetRecords() []TimeRecord

func (*RelDB) Open

func (d *RelDB) Open() func()

func (*RelDB) SaveRecords

func (d *RelDB) SaveRecords(records []TimeRecord) error

type TimeRecord

type TimeRecord struct {
	ID             util.UUID `bson:"_id"`
	Begin          time.Time
	Duration       time.Duration
	DurationString string
	Project        string
	Notes          string
	Tags           []string
}

func ConvertCSVRecords

func ConvertCSVRecords(r io.Reader, project string) ([]TimeRecord, error)

func NewTimeRecord

func NewTimeRecord() TimeRecord

func (*TimeRecord) SetDate

func (r *TimeRecord) SetDate(date time.Time)

func (*TimeRecord) SetEnd

func (r *TimeRecord) SetEnd(t time.Time) error

func (*TimeRecord) SetEndPartial

func (r *TimeRecord) SetEndPartial(t time.Time, fraction float64) error

func (*TimeRecord) String

func (r *TimeRecord) String() string

Jump to

Keyboard shortcuts

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