Documentation
¶
Overview ¶
Package dest defines where normalized activities are delivered (portfolio trackers, budgeting apps, files) and keeps the registry of destinations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(d Definition)
Types ¶
type Account ¶
type Account struct {
ID string `json:"id"`
Name string `json:"name"`
Currency string `json:"currency,omitempty"`
}
Account is a place in the destination activities can go to.
type Batch ¶
type Batch struct {
SourceName string
Account string // Account.ID chosen for this source
Activities []model.Activity
// Costs: what an incoming asset cost, by activity id, in the account's
// currency (see model.Costs). Missing when no price is known.
Costs map[string]decimal.Decimal
// Transfers: for a deposit or withdrawal between two of your own
// accounts, the name of the source on the other side, by activity id.
Transfers map[string]string
}
Batch is the activities of one source going to one destination account.
type Definition ¶
type Definition struct {
Kind string `json:"kind"`
Name string `json:"name"`
Description string `json:"description"`
Fields []source.Field `json:"fields"`
Setup string `json:"setup,omitempty"`
New func(cfg source.Config) (Destination, error) `json:"-"`
}
Definition describes a kind of destination.
func Get ¶
func Get(kind string) (Definition, error)
func List ¶
func List() []Definition
type Destination ¶
type Destination interface {
// Accounts lists where activities can go, for the mapping screen.
Accounts(ctx context.Context) ([]Account, error)
// Push writes the activities and reports each one's fate. It must be
// safe to call again with activities that were already delivered.
Push(ctx context.Context, b Batch) ([]Result, error)
}
Destination is a configured target.
type Result ¶
type Result struct {
ActivityID string `json:"activityId"`
Status Status `json:"status"`
ExternalID string `json:"externalId,omitempty"`
Message string `json:"message,omitempty"`
}
Result for one activity.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ghostfolio delivers activities to a Ghostfolio server through its REST API (POST /api/v1/import), signed in with the user's security token (POST /api/v1/auth/anonymous gives a JWT, renewed when it is refused).
|
Package ghostfolio delivers activities to a Ghostfolio server through its REST API (POST /api/v1/import), signed in with the user's security token (POST /api/v1/auth/anonymous gives a JWT, renewed when it is refused). |
|
Package wealthfolio delivers activities to a Wealthfolio server through its MCP endpoint (import pipeline: validate, then commit as one run).
|
Package wealthfolio delivers activities to a Wealthfolio server through its MCP endpoint (import pipeline: validate, then commit as one run). |
Click to show internal directories.
Click to hide internal directories.