import "go.bmvs.io/ynab/api"
Package api implements shared structures and behaviours of the API services
client.go date.go error.go filter.go ratelimit.go
DateFormat creates a new string from a given api.Date formatted as dateLayout
ClientReader contract for a read only client
type ClientReaderWriter interface { ClientReader ClientWriter }
ClientReaderWriter contract for a read-write client
type ClientWriter interface { POST(url string, responseModel interface{}, requestBody []byte) error PUT(url string, responseModel interface{}, requestBody []byte) error PATCH(url string, responseModel interface{}, requestBody []byte) error }
ClientWriter contract for a write only client
Date represents a budget date
DateFromString creates a new Date from a given string date formatted as dateLayout
Code:
date, _ := api.DateFromString("2020-01-20") fmt.Println(date)
Output:
2020-01-20 00:00:00 +0000 UTC
MarshalJSON parses the expected format for a Date
UnmarshalJSON parses the expected format for a Date
type Error struct { ID string `json:"id"` Name string `json:"name"` Detail string `json:"detail"` }
Error represents an API Error
Error returns the string version of the error
type Filter struct { // LastKnowledgeOfServer The starting server knowledge. If provided, // only entities that have changed since last_knowledge_of_server // will be included LastKnowledgeOfServer uint64 }
Filter represents the optional version filter while fetching a budget
ToQuery returns the filters as a HTTP query string
type RateLimit struct {
// contains filtered or unexported fields
}
RateLimit represents an API rate limit
ParseRateLimit returns a *RateLimit for a given rate limit string
Code:
r, _ := api.ParseRateLimit("1/200") fmt.Println(r.Used())
Output:
1
Total represents the total rate limit
Used represents the used rate limit
Path | Synopsis |
---|---|
account | Package account implements account entities and services |
budget | Package budget implements budget entities and services |
category | Package category implements category entities and services |
month | Package month implements month entities and services |
payee | Package payee implements payee entities and services |
transaction | Package transaction implements transaction entities and services |
user | Package user implements transaction user and services |
Package api imports 6 packages (graph) and is imported by 8 packages. Updated 2020-01-11. Refresh now. Tools for package owners.