Documentation ¶
Overview ¶
Package dayone is for reading Day One (http://dayoneapp.com) journal files.
Index ¶
- Variables
- type Coordinate
- type Creator
- type Entry
- type Journal
- func (j *Journal) EntryStat(uuid string) (os.FileInfo, error)
- func (j *Journal) OpenPhoto(uuid string) (io.ReadCloser, error)
- func (j *Journal) PhotoStat(uuid string) (os.FileInfo, error)
- func (j *Journal) Read(fn ReadFunc) error
- func (j *Journal) ReadEntry(uuid string) (*Entry, error)
- func (j Journal) Write(e *Entry) error
- type Location
- type Music
- type ReadFunc
- type Region
- type Weather
Constants ¶
This section is empty.
Variables ¶
var ErrStopRead = errors.New("stop reading")
ErrStopRead is an error you can return from a ReadFunc to stop reading journal entries.
Functions ¶
This section is empty.
Types ¶
type Coordinate ¶
Coordinate for location data.
type Creator ¶
type Creator struct { DeviceAgent string `plist:"Device Agent"` GenerationDate time.Time `plist:"Generation Date"` HostName string `plist:Host Name"` OSAgent string `plist:OS Agent"` SoftwareAgent string `plist: Software Agent"` }
Creator is the creator of a journal entry.
type Entry ¶
type Entry struct { EntryText string `plist:"Entry Text"` Activity string IgnoreStepCount bool `plist:"Ignore Step Count"` StepCount uint64 `plist:"Step Count"` Starred bool PublishURL string `plist:"Publish URL"` Music *Music Tags []string Weather *Weather Location *Location TimeZone string `plist:"Time Zone"` Creator *Creator CreationDate time.Time `plist:"Creation Date"` // contains filtered or unexported fields }
Entry is the top-level journal entry type.
type Journal ¶
type Journal struct {
// contains filtered or unexported fields
}
Journal is the top-level type for reading Day One journal files.
func NewJournal ¶
NewJournal creates a new Journal for the specified dir.
func (*Journal) EntryStat ¶
EntryStat returns the result of os.Stat() for the entry with the specified uuid.
func (*Journal) OpenPhoto ¶
func (j *Journal) OpenPhoto(uuid string) (io.ReadCloser, error)
OpenPhoto opens an io.ReadCloser for the photo file associated with the specified entry uuid or returns an error.
func (*Journal) PhotoStat ¶
PhotoStat returns the result of os.Stat() for the photo associated with the entry uuid.
func (*Journal) Read ¶
Read enumerates all of the journal entries and calls fn with each entry found. Errors returned by fn are returned by Read. fn can return StopError to halt enumeration at any point.
type Location ¶
type Location struct { AdministrativeArea string `plist:"Adminstrative Area"` Country string Locality string PlaceName string `plist:"Place Name"` Region *Region FoursquareID string Coordinate }
Location of a journal entry.
type Weather ¶
type Weather struct { Celsius string Fahrenheit string Description string IconName string PressureMB float64 `plist:"Pressure MB"` RelativeHumidity float64 `plist:"Relative Humidity"` Service string SunriseDate time.Time `plist:"Sunrise Date"` SunsetDate time.Time `plist:"Sunset Date"` VisibilityKM float64 `plist:"Visibility KM"` WindBearing uint64 `plist:"Wind Bearing"` WindChillCelsius int64 `plist:"Wind Chill Celsius"` WindSpeedKPH float64 `plist:"Wind Speed KPH"` }
Weather data for a journal entry.