Documentation
¶
Index ¶
Constants ¶
const ( PROD_URL = "https://api.bunq.com/v1" SANDBOX_URL = "https://public-api.sandbox.bunq.com/v1/" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FilePersistence ¶
type FilePersistence struct {
// contains filtered or unexported fields
}
FilePersistence stores an Installation as a file.
func NewFilePersistence ¶
func NewFilePersistence(filename string) FilePersistence
func (FilePersistence) GetInstallation ¶
func (f FilePersistence) GetInstallation() (*Installation, error)
func (FilePersistence) StoreInstallation ¶
func (f FilePersistence) StoreInstallation(ins Installation) error
type Installation ¶
Installation is the metadata of this deployment.
type Persistence ¶
type Persistence interface {
StoreInstallation(Installation) error
GetInstallation() (*Installation, error)
}
Persistence stores the Installation for bunq. It should only be created once.
type SDK ¶ added in v0.1.1
SDK is a bunq SDK. Access the API through the Client object.
func New ¶
func New(apiURL string, persistence Persistence, key *rsa.PrivateKey, logger *slog.Logger) (*SDK, error)
New creates a new bunq SDK. It cannot be used until Init is called.
func (*SDK) CreateDevice ¶ added in v0.1.1
CreateDevice must be called once for a deployment. The authToken can be retrieved from a successful OAuth login or by passing the API key directly. PermittedIPs is an optional list of IP addresses that may access the API with this token. It defaults to the current outgoing IP. It accepts wildcards.
func (*SDK) CreateSession ¶ added in v0.1.1
CreateSession creates a session from an existing token. The values from this session can be used to call the API.
type Session ¶
type Session struct {
// AccessToken is the token that grants access to the API.
AccessToken string
// APIKeyID should be used in place of the userID for API endpoints if using OAuth2.
APIKeyID int
// The UserID is the id of the logged in user (if using OAuth2) or the API key owner.
UserID int
// The Nickname is the nickname of the logged in user (if using OAuth2) or the API key owner.
Nickname string
// Expires is the expiry time of this session.
Expires time.Time
}
Session contains the most important info from a Bunq API session.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package client provides primitives to interact with the openapi HTTP API.
|
Package client provides primitives to interact with the openapi HTTP API. |
|
oauth provides http handlers for the bunq oauth flow.
|
oauth provides http handlers for the bunq oauth flow. |