Documentation ¶
Index ¶
- Constants
- type APIConfig
- type Client
- func (c *Client) AllMembersInGroup(ctx context.Context) ([]Member, error)
- func (c *Client) AllTransactionsInGroup(ctx context.Context) ([]Transaction, error)
- func (c *Client) AuthedRequest(req *http.Request) ([]byte, error)
- func (c *Client) CreateTransactionInGroup(ctx context.Context, t Transaction) (*CreateTransactionRes, error)
- func (c *Client) Login(ctx context.Context) (string, error)
- func (c *Client) Request(req *http.Request) ([]byte, error)
- type Config
- type CreateTransactionRes
- type Item
- type Member
- type PayingUser
- type SettleUpConfig
- type SettleUpTime
- type Transaction
Constants ¶
View Source
const (
CurrencyCodeEuro currencyCode = "EUR"
)
View Source
const (
TransactionTypeExpense transactionType = "expense"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIConfig ¶
type APIConfig struct { BaseURL string Key string SettleUpConf SettleUpConfig }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AllMembersInGroup ¶
func (*Client) AllTransactionsInGroup ¶
func (c *Client) AllTransactionsInGroup(ctx context.Context) ([]Transaction, error)
func (*Client) CreateTransactionInGroup ¶
func (c *Client) CreateTransactionInGroup(ctx context.Context, t Transaction) (*CreateTransactionRes, error)
type CreateTransactionRes ¶
type CreateTransactionRes struct {
ID string `json:"name"`
}
type Item ¶
type Item struct { Amount float32 `json:"amount,string"` ForWhom []PayingUser `json:"forWhom"` }
type PayingUser ¶
type SettleUpConfig ¶
type SettleUpTime ¶
func (SettleUpTime) MarshalJSON ¶
func (sut SettleUpTime) MarshalJSON() ([]byte, error)
func (*SettleUpTime) UnmarshalJSON ¶
func (sut *SettleUpTime) UnmarshalJSON(b []byte) error
type Transaction ¶
type Transaction struct { ID *string `json:"id,omitempty"` Category *string `json:"category,omitempty"` CurrencyCode currencyCode `json:"currencyCode"` DateTime SettleUpTime `json:"dateTime"` ExchangeRates any `json:"exchangeRates"` FixedExchangeRate bool `json:"fixedExchangeRate"` Items []Item `json:"items"` Purpose string `json:"purpose"` ReceiptURL *string `json:"receiptUrl,omitempty"` Type transactionType `json:"type"` WhoPaid []PayingUser `json:"whoPaid"` }
Click to show internal directories.
Click to hide internal directories.