Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const DateLayout = "2006-01-02"
DateLayout expected layout format for the Date type
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientReader ¶
ClientReader contract for a read only client
type ClientReaderWriter ¶
type ClientReaderWriter interface { ClientReader ClientWriter }
ClientReaderWriter contract for a read-write client
type ClientWriter ¶
type ClientWriter interface { POST(url string, responseModel interface{}, requestBody []byte) error PUT(url string, responseModel interface{}, requestBody []byte) error }
ClientWriter contract for a write only client
type Date ¶
Date represents a budget date
func DateFromString ¶
DateFromString creates a new Date from a given string date formatted as DateLayout
Example ¶
package main import ( "fmt" "go.bmvs.io/ynab/api" ) func main() { date, _ := api.DateFromString("2020-01-20") fmt.Println(date) }
Output: 2020-01-20 00:00:00 +0000 UTC
func (*Date) MarshalJSON ¶
MarshalJSON parses the expected format for a Date
func (*Date) UnmarshalJSON ¶
UnmarshalJSON parses the expected format for a Date
type RateLimit ¶ added in v1.1.0
type RateLimit struct {
// contains filtered or unexported fields
}
RateLimit represents an API rate limit
func ParseRateLimit ¶ added in v1.1.0
ParseRateLimit returns a *RateLimit for a given rate limit string
Example ¶
package main import ( "fmt" "go.bmvs.io/ynab/api" ) func main() { r, _ := api.ParseRateLimit("1/200") fmt.Println(r.Used()) }
Output: 1
Click to show internal directories.
Click to hide internal directories.