Documentation ¶
Overview ¶
Package letseat is the main thing that decides where to go for dindin
Index ¶
- Constants
- func ParseDuration(s string) (time.Duration, error)
- func Stars(num float64, icon string) string
- func WithDB(db *bolt.DB) func(*Diary)
- func WithDBFilename(fn string) func(*Diary)
- func WithEntries(e Entries) func(*Diary)
- func WithFilter(f EntryFilter) func(*Diary)
- func WithFormat(f Format) func(*Place)
- func WithName(n string) func(*Place)
- type Diary
- type Entries
- type Entry
- type EntryFilter
- type Format
- type Person
- type Place
- type PlaceDetail
- type PlaceDetails
- type Places
Constants ¶
const ( // PeopleBucket is the name of the bucket that contains all the People entries PeopleBucket = "people" // EntriesBucket is the name of the bucket that contains all the Entries entries EntriesBucket = "entries" // PlacesBucket is the name of the bucket that contains all the Places entries PlacesBucket = "places" )
Variables ¶
This section is empty.
Functions ¶
func ParseDuration ¶
ParseDuration is a duration parser that supports things greater than an hour
func WithDBFilename ¶
WithDBFilename uses a given file for the db
func WithEntries ¶
WithEntries sets the diary entries on a new Diary object
func WithFormat ¶
WithFormat sets the format of a place using functional options
Types ¶
type Diary ¶
type Diary struct {
// contains filtered or unexported fields
}
Diary is the thing holding all of your visits and info
func (Diary) MostPopularPlace ¶
MostPopularPlace just returns the most popular place
func (Diary) PlaceDetails ¶
func (d Diary) PlaceDetails() PlaceDetails
PlaceDetails is just some detail summary pieces of the places in your diary
type Entries ¶
type Entries []Entry
Entries is multiple DiaryEntry objects
func (*Entries) PeopleEnhanced ¶
PeopleEnhanced returns all the details on people
func (*Entries) UniquePlaceNames ¶
UniquePlaceNames are just the simple place names as strings
type Entry ¶
type Entry struct { Place string `yaml:"place"` Cost int `yaml:"cost,omitempty"` Date *time.Time `yaml:"date"` IsTakeout bool `yaml:"takeout,omitempty"` Ratings map[string]int `yaml:"ratings,omitempty"` }
Entry represents a log about your visit to a restaurant
type EntryFilter ¶
type EntryFilter struct { Place string OnlyTakeout bool OnlyDineIn bool Earliest *time.Time Latest *time.Time }
EntryFilter defiines how to filter a list of entries
type Place ¶
type Place struct { Name string `yaml:"name"` Slug string `yaml:"slug"` Tier int `yaml:"tier"` Format Format `yaml:"format"` }
Place is a restaurant, or place you can eat
func MustNewPlace ¶
MustNewPlace returns a new place or panics on error
type PlaceDetail ¶
PlaceDetail is the overview detail thing of a place
type PlaceDetails ¶
type PlaceDetails []PlaceDetail
PlaceDetails represents multiple PlaceDetail items. Satisfies the Sortable interface
func (PlaceDetails) Less ¶
func (p PlaceDetails) Less(i, j int) bool
Less returns if items are less than other items. Satisfies the Sortable interface
func (PlaceDetails) Swap ¶
func (p PlaceDetails) Swap(i, j int)
Swap swaps 2 items in PlaceDetails. Satisfies the Sortable interface