Documentation ¶
Overview ¶
Package aplos provides basic support for the Aplos API, see https://www.aplos.com/api This package is very much still under development.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadPrivateKey ¶
func LoadPrivateKey(dat []byte) (*rsa.PrivateKey, error)
LoadPrivateKey parses PKCS8-formatted bytes into an RSA key.
func LoadPrivateKeyFromFile ¶
func LoadPrivateKeyFromFile(fp string) (*rsa.PrivateKey, error)
LoadPrivateKeyFromFile loads a base64-encoded, PKCS8-formatted RSA key file from disk. This is the format returned from the Aplos UI when creating and downloading an API key.
Types ¶
type AccountGroup ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an authenticated API client for connecting to Aplos.
func New ¶
func New(clientID string, pk *rsa.PrivateKey) (*Client, error)
New returns an Aplos API client initialized with the given key credentials. If the credentials are invalid (expired, mismatched, malformed, etc), this call with fail.
func (*Client) Transaction ¶
func (*Client) Transactions ¶
func (c *Client) Transactions(ctx context.Context, opts ...ListTransactionOption) ([]Transaction, error)
Transactions returns a list of transactions satisfying the given options.
type Date ¶
func (*Date) UnmarshalJSON ¶
type ListAccountOption ¶
type ListAccountOption func(*listAccountsOpts)
func WithAccountName ¶
func WithAccountName(acctName string) ListAccountOption
type ListTransactionOption ¶
type ListTransactionOption func(*listTransactionsOpts)
func WithAccountNumber ¶
func WithAccountNumber(acctNumber int) ListTransactionOption
func WithRangeEnd ¶
func WithRangeEnd(year int, month time.Month, day int) ListTransactionOption
func WithRangeStart ¶
func WithRangeStart(year int, month time.Month, day int) ListTransactionOption
type Time ¶
Time wraps the standard library's time.Time and supports the format returned by the Aplos API for time fields.
func (*Time) UnmarshalJSON ¶
type Transaction ¶
type Transaction struct { ID int Memo string Date Date IDNumber int `json:"id_number"` Created Time Amount float64 InClosedPeriod bool `json:"in_closed_period"` // Lines is only populated in the "get single transaction details" endpoint, e.g. GET /.../v1/transactions/{transactionID} Lines []TransactionLine }
Transaction represents a single transaction recorded in a register.