go-dayone: github.com/jpoehls/go-dayone Index | Files

package dayone

import "github.com/jpoehls/go-dayone"

Package dayone is for reading Day One (http://dayoneapp.com) journal files.

Index

Package Files

doc.go entry.go journal.go

Variables

var ErrStopRead = errors.New("stop reading")

ErrStopRead is an error you can return from a ReadFunc to stop reading journal entries.

type Coordinate Uses

type Coordinate struct {
    Latitude  float64
    Longitude float64
}

Coordinate for location data.

type Creator Uses

type Creator struct {
    DeviceAgent    string
    GenerationDate time.Time
    HostName       string
    OSAgent        string
    SoftwareAgent  string
}

Creator is the creator of a journal entry.

type Entry Uses

type Entry struct {
    EntryText string

    Activity        string
    IgnoreStepCount bool
    StepCount       uint64

    Starred    bool
    PublishURL string
    Music      *Music

    Tags     []string
    Weather  *Weather
    Location *Location

    TimeZone     string
    Creator      *Creator
    CreationDate time.Time
    // contains filtered or unexported fields
}

Entry is the top-level journal entry type.

func (*Entry) UUID Uses

func (e *Entry) UUID() string

UUID gets the unique ID of the entry.

type Journal Uses

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

Journal is the top-level type for reading Day One journal files.

func NewJournal Uses

func NewJournal(dir string) *Journal

NewJournal creates a new Journal for the specified dir.

func (*Journal) EntryStat Uses

func (j *Journal) EntryStat(uuid string) (os.FileInfo, error)

EntryStat returns the result of os.Stat() for the entry with the specified uuid.

func (*Journal) OpenPhoto Uses

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 Uses

func (j *Journal) PhotoStat(uuid string) (os.FileInfo, error)

PhotoStat returns the result of os.Stat() for the photo associated with the entry uuid.

func (*Journal) Read Uses

func (j *Journal) Read(fn ReadFunc) error

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.

func (*Journal) ReadEntry Uses

func (j *Journal) ReadEntry(uuid string) (*Entry, error)

ReadEntry reads the entry with the specified id.

type Location Uses

type Location struct {
    AdministrativeArea string
    Country            string
    Locality           string
    PlaceName          string
    Region             *Region
    FoursquareID       string

    Coordinate
}

Location of a journal entry.

type Music Uses

type Music struct {
    Album     string
    Artist    string
    Track     string
    AlbumYear string
}

Music data for a journal entry.

type ReadFunc Uses

type ReadFunc func(e *Entry, err error) error

ReadFunc is the func to use when enumerating journal entries.

type Region Uses

type Region struct {
    Center *Coordinate
    Radius float64
}

Region location data.

type Weather Uses

type Weather struct {
    Celsius          string
    Fahrenheit       string
    Description      string
    IconName         string
    PressureMB       float64
    RelativeHumidity float64
    Service          string
    SunriseDate      time.Time
    SunsetDate       time.Time
    VisibilityKM     float64
    WindBearing      uint64
    WindChillCelsius int64
    WindSpeedKPH     float64
}

Weather data for a journal entry.

Package dayone imports 10 packages (graph). Updated 2016-07-16. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).