ynab: go.bmvs.io/ynab/api Index | Examples | Files | Directories

package api

import "go.bmvs.io/ynab/api"

Package api implements shared structures and behaviours of the API services



Package Files

client.go date.go error.go filter.go ratelimit.go

func DateFormat Uses

func DateFormat(date Date) string

DateFormat creates a new string from a given api.Date formatted as dateLayout

type ClientReader Uses

type ClientReader interface {
    GET(url string, responseModel interface{}) error

ClientReader contract for a read only client

type ClientReaderWriter Uses

type ClientReaderWriter interface {

ClientReaderWriter contract for a read-write client

type ClientWriter Uses

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

type Date Uses

type Date struct {

Date represents a budget date

func DateFromString Uses

func DateFromString(s string) (Date, error)

DateFromString creates a new Date from a given string date formatted as dateLayout


date, _ := api.DateFromString("2020-01-20")


2020-01-20 00:00:00 +0000 UTC

func (*Date) MarshalJSON Uses

func (d *Date) MarshalJSON() ([]byte, error)

MarshalJSON parses the expected format for a Date

func (*Date) UnmarshalJSON Uses

func (d *Date) UnmarshalJSON(b []byte) error

UnmarshalJSON parses the expected format for a Date

type Error Uses

type Error struct {
    ID     string `json:"id"`
    Name   string `json:"name"`
    Detail string `json:"detail"`

Error represents an API Error

func (Error) Error Uses

func (e Error) Error() string

Error returns the string version of the error

type Filter Uses

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

func (*Filter) ToQuery Uses

func (f *Filter) ToQuery() string

ToQuery returns the filters as a HTTP query string

type RateLimit Uses

type RateLimit struct {
    // contains filtered or unexported fields

RateLimit represents an API rate limit

func ParseRateLimit Uses

func ParseRateLimit(rateLimit string) (*RateLimit, error)

ParseRateLimit returns a *RateLimit for a given rate limit string


r, _ := api.ParseRateLimit("1/200")



func (*RateLimit) Total Uses

func (r *RateLimit) Total() uint64

Total represents the total rate limit

func (*RateLimit) Used Uses

func (r *RateLimit) Used() uint64

Used represents the used rate limit


accountPackage account implements account entities and services
budgetPackage budget implements budget entities and services
categoryPackage category implements category entities and services
monthPackage month implements month entities and services
payeePackage payee implements payee entities and services
transactionPackage transaction implements transaction entities and services
userPackage 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.