data

package
v0.0.0-...-f4344ff Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHeader = "type, date, activity"
)

Variables

This section is empty.

Functions

func ArchiveLog

func ArchiveLog(p string, f string) error

func CreateLogFile

func CreateLogFile(f string) error

func LogExists

func LogExists(f string) bool

func LogNotExists

func LogNotExists(f string) bool

func ReadJsonLog

func ReadJsonLog(path string) ([]byte, error)

func ReadLog

func ReadLog(p string, f string) (string, error)

func UpdateActivity

func UpdateActivity(path string, file string, t string, i int) error

func WorkLogPath

func WorkLogPath(p string, f string) string

func WriteJsonLog

func WriteJsonLog(path string, currentLog []byte) error

func WriteToWorkLog

func WriteToWorkLog(path string, t string, s string) error

Types

type Activity

type Activity struct {
	Type     string `json:"type"`
	Date     string `json:"date"`
	Activity string `json:"activity"`
}

func NewActivity

func NewActivity() *Activity

func (Activity) ToCSVEntry

func (n Activity) ToCSVEntry() string

type Log

type Log struct {
	Header     string      `json:"header,omitempty"`
	Activities []*Activity `json:"activities"`
}

func NewLog

func NewLog(header bool) *Log

func NewLogFromJson

func NewLogFromJson(input []byte) (*Log, error)

func (Log) ToCSV

func (l Log) ToCSV() string

func (Log) ToJSON

func (l Log) ToJSON() (string, error)

Jump to

Keyboard shortcuts

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