Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewService ¶
func NewService(apiKey string, rt http.RoundTripper) (*sheets.Service, error)
NewService is a shortcut for creating a sheets.Service using an API key and a custom HTTP RoundTripper. If RoundTripper is not provided, http.DefaultTransport will be used
Types ¶
type Calendar ¶
Calendar is and ordered list of Weeks and shows all available stocking data for a specific water
func (Calendar) DetailFormat ¶
DetailFormat creates string with detailed explanation of the Calendar and accepts a few boolean controls
func (Calendar) Format ¶
Format all dates in the Calendar. If hideEmpty is set, it will exclude non-stocking days
type Program ¶ added in v0.2.0
type Program string
Program is an enum type for AZ GFD stocking programs: cfp (community fishing program), winter, spring, and summer (spring/summer are the same)
func ParseProgram ¶ added in v0.2.0
ParseProgram parses a string to return a valid Program
type StockingData ¶ added in v0.4.0
type StockingData []Calendar
StockingData is a slice of stocking Calendars for different waters
func Get ¶
func Get(srv *sheets.Service, program Program, waters []string) (StockingData, error)
Get will parse the Google Sheet for the specified Program. If waters are provided, it will only return data for these waters. Otherwise, it provides for all
func (StockingData) Sort ¶ added in v0.4.0
func (s StockingData) Sort(compare func(Calendar, Calendar) int)
Sort allows sorting the data by a compare function and will sort alphabetically if compare is equal
func (StockingData) SortLast ¶ added in v0.4.0
func (s StockingData) SortLast()
SortLast sorts by most-recently stocked waters
func (StockingData) SortNext ¶ added in v0.4.0
func (s StockingData) SortNext()
SortNext sorts by closest upcoming stocking dates