formancesdkgo

package module
v3.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 13 Imported by: 2

README ΒΆ

github.com/formancehq/formance-sdk-go/v2

πŸ— Welcome to your new SDK! πŸ—

It has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps:

Summary

Formance Stack API: Open, modular foundation for unique payments flows

Introduction

This API is documented in OpenAPI format.

Authentication

Formance Stack offers one forms of authentication:

  • OAuth2 OAuth2 - an open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications.

Table of Contents

SDK Installation

To add the SDK as a dependency to your project:

go get github.com/formancehq/formance-sdk-go

SDK Example Usage

Example
package main

import (
	"context"
	formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
	"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
	"log"
)

func main() {
	s := formancesdkgo.New(
		formancesdkgo.WithSecurity(shared.Security{
			ClientID:     formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
			ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
		}),
	)

	ctx := context.Background()
	res, err := s.GetVersions(ctx)
	if err != nil {
		log.Fatal(err)
	}
	if res.GetVersionsResponse != nil {
		// handle response
	}
}

Available Resources and Operations

Available methods
Auth
Auth.V1
Formance SDK
Ledger
Ledger.V1
Ledger.V2
Orchestration
Orchestration.V1
Orchestration.V2
Payments
Payments.V1
Reconciliation
Reconciliation.V1
Search.V1
Wallets
Wallets.V1
Webhooks
Webhooks.V1

Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both.

By Default, an API error will return sdkerrors.SDKError. When custom error responses are specified for an operation, the SDK may also return their associated error. You can refer to respective Errors tables in SDK docs for more details on possible error types for each operation.

For example, the CreateTransactions function may return the following errors:

Error Type Status Code Content Type
sdkerrors.ErrorResponse default application/json
sdkerrors.SDKError 4XX, 5XX */*
Example
package main

import (
	"context"
	"errors"
	formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
	"github.com/formancehq/formance-sdk-go/v3/pkg/models/operations"
	"github.com/formancehq/formance-sdk-go/v3/pkg/models/sdkerrors"
	"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
	"log"
	"math/big"
)

func main() {
	s := formancesdkgo.New(
		formancesdkgo.WithSecurity(shared.Security{
			ClientID:     formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
			ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
		}),
	)

	ctx := context.Background()
	res, err := s.Ledger.V1.CreateTransactions(ctx, operations.CreateTransactionsRequest{
		Transactions: shared.Transactions{
			Transactions: []shared.TransactionData{
				shared.TransactionData{
					Postings: []shared.Posting{
						shared.Posting{
							Amount:      big.NewInt(100),
							Asset:       "COIN",
							Destination: "users:002",
							Source:      "users:001",
						},
						shared.Posting{
							Amount:      big.NewInt(100),
							Asset:       "COIN",
							Destination: "users:002",
							Source:      "users:001",
						},
						shared.Posting{
							Amount:      big.NewInt(100),
							Asset:       "COIN",
							Destination: "users:002",
							Source:      "users:001",
						},
					},
					Reference: formancesdkgo.String("ref:001"),
				},
			},
		},
		Ledger: "ledger001",
	})
	if err != nil {

		var e *sdkerrors.ErrorResponse
		if errors.As(err, &e) {
			// handle error
			log.Fatal(e.Error())
		}

		var e *sdkerrors.SDKError
		if errors.As(err, &e) {
			// handle error
			log.Fatal(e.Error())
		}
	}
}

Server Selection

Select Server by Index

You can override the default server globally using the WithServerIndex(serverIndex int) option when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

# Server Variables Default values
0 http://localhost
1 https://{organization}.{environment}.formance.cloud environment ServerEnvironment
organization string
"sandbox"
"orgID-stackID"

If the selected server has variables, you may override their default values using their associated option(s):

  • WithEnvironment(environment ServerEnvironment)
  • WithOrganization(organization string)
Example
package main

import (
	"context"
	formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
	"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
	"log"
)

func main() {
	s := formancesdkgo.New(
		formancesdkgo.WithServerIndex(1),
		formancesdkgo.WithSecurity(shared.Security{
			ClientID:     formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
			ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
		}),
	)

	ctx := context.Background()
	res, err := s.GetVersions(ctx)
	if err != nil {
		log.Fatal(err)
	}
	if res.GetVersionsResponse != nil {
		// handle response
	}
}

Override Server URL Per-Client

The default server can also be overridden globally using the WithServerURL(serverURL string) option when initializing the SDK client instance. For example:

package main

import (
	"context"
	formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
	"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
	"log"
)

func main() {
	s := formancesdkgo.New(
		formancesdkgo.WithServerURL("http://localhost"),
		formancesdkgo.WithSecurity(shared.Security{
			ClientID:     formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
			ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
		}),
	)

	ctx := context.Background()
	res, err := s.GetVersions(ctx)
	if err != nil {
		log.Fatal(err)
	}
	if res.GetVersionsResponse != nil {
		// handle response
	}
}

Custom HTTP Client

The Go SDK makes API calls that wrap an internal HTTP client. The requirements for the HTTP client are very simple. It must match this interface:

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

The built-in net/http client satisfies this interface and a default client based on the built-in is provided by default. To replace this default with a client of your own, you can implement this interface yourself or provide your own client configured as desired. Here's a simple example, which adds a client with a 30 second timeout.

import (
	"net/http"
	"time"
	"github.com/myorg/your-go-sdk"
)

var (
	httpClient = &http.Client{Timeout: 30 * time.Second}
	sdkClient  = sdk.New(sdk.WithClient(httpClient))
)

This can be a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration.

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

Name Type Scheme
ClientID
ClientSecret
oauth2 OAuth2 Client Credentials Flow

You can configure it using the WithSecurity option when initializing the SDK client instance. For example:

package main

import (
	"context"
	formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
	"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
	"log"
)

func main() {
	s := formancesdkgo.New(
		formancesdkgo.WithSecurity(shared.Security{
			ClientID:     formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
			ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
		}),
	)

	ctx := context.Background()
	res, err := s.GetVersions(ctx)
	if err != nil {
		log.Fatal(err)
	}
	if res.GetVersionsResponse != nil {
		// handle response
	}
}

Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide a retry.Config object to the call by using the WithRetries option:

package main

import (
	"context"
	formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
	"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
	"github.com/formancehq/formance-sdk-go/v3/pkg/retry"
	"log"
	"pkg/models/operations"
)

func main() {
	s := formancesdkgo.New(
		formancesdkgo.WithSecurity(shared.Security{
			ClientID:     formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
			ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
		}),
	)

	ctx := context.Background()
	res, err := s.GetVersions(ctx, operations.WithRetries(
		retry.Config{
			Strategy: "backoff",
			Backoff: &retry.BackoffStrategy{
				InitialInterval: 1,
				MaxInterval:     50,
				Exponent:        1.1,
				MaxElapsedTime:  100,
			},
			RetryConnectionErrors: false,
		}))
	if err != nil {
		log.Fatal(err)
	}
	if res.GetVersionsResponse != nil {
		// handle response
	}
}

If you'd like to override the default retry strategy for all operations that support retries, you can use the WithRetryConfig option at SDK initialization:

package main

import (
	"context"
	formancesdkgo "github.com/formancehq/formance-sdk-go/v3"
	"github.com/formancehq/formance-sdk-go/v3/pkg/models/shared"
	"github.com/formancehq/formance-sdk-go/v3/pkg/retry"
	"log"
)

func main() {
	s := formancesdkgo.New(
		formancesdkgo.WithRetryConfig(
			retry.Config{
				Strategy: "backoff",
				Backoff: &retry.BackoffStrategy{
					InitialInterval: 1,
					MaxInterval:     50,
					Exponent:        1.1,
					MaxElapsedTime:  100,
				},
				RetryConnectionErrors: false,
			}),
		formancesdkgo.WithSecurity(shared.Security{
			ClientID:     formancesdkgo.String("<YOUR_CLIENT_ID_HERE>"),
			ClientSecret: formancesdkgo.String("<YOUR_CLIENT_SECRET_HERE>"),
		}),
	)

	ctx := context.Background()
	res, err := s.GetVersions(ctx)
	if err != nil {
		log.Fatal(err)
	}
	if res.GetVersionsResponse != nil {
		// handle response
	}
}

Development

Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!

SDK Created by Speakeasy

Documentation ΒΆ

Index ΒΆ

Constants ΒΆ

This section is empty.

Variables ΒΆ

View Source
var ServerList = []string{

	"http://localhost",

	"https://{organization}.{environment}.formance.cloud",
}

ServerList contains the list of servers available to the SDK

Functions ΒΆ

func Bool ΒΆ

func Bool(b bool) *bool

Bool provides a helper function to return a pointer to a bool

func Float32 ΒΆ

func Float32(f float32) *float32

Float32 provides a helper function to return a pointer to a float32

func Float64 ΒΆ

func Float64(f float64) *float64

Float64 provides a helper function to return a pointer to a float64

func Int ΒΆ

func Int(i int) *int

Int provides a helper function to return a pointer to an int

func Int64 ΒΆ

func Int64(i int64) *int64

Int64 provides a helper function to return a pointer to an int64

func Pointer ΒΆ

func Pointer[T any](v T) *T

Pointer provides a helper function to return a pointer to a type

func String ΒΆ

func String(s string) *string

String provides a helper function to return a pointer to a string

Types ΒΆ

type Auth ΒΆ

type Auth struct {
	V1 *V1
	// contains filtered or unexported fields
}

type Formance ΒΆ

type Formance struct {
	Auth           *Auth
	Ledger         *Ledger
	Orchestration  *Orchestration
	Payments       *Payments
	Reconciliation *Reconciliation
	Search         *Search
	Wallets        *Wallets
	Webhooks       *Webhooks
	// contains filtered or unexported fields
}

Formance Stack API: Open, modular foundation for unique payments flows

# Introduction This API is documented in **OpenAPI format**.

# Authentication Formance Stack offers one forms of authentication:

  • OAuth2

OAuth2 - an open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications. <SecurityDefinitions />

func New ΒΆ

func New(opts ...SDKOption) *Formance

New creates a new instance of the SDK with the provided options

func (*Formance) GetVersions ΒΆ

func (s *Formance) GetVersions(ctx context.Context, opts ...operations.Option) (*operations.GetVersionsResponse, error)

GetVersions - Show stack version information

type FormanceOrchestrationV1 ΒΆ

type FormanceOrchestrationV1 struct {
	// contains filtered or unexported fields
}

func (*FormanceOrchestrationV1) CancelEvent ΒΆ

CancelEvent - Cancel a running workflow Cancel a running workflow

func (*FormanceOrchestrationV1) CreateTrigger ΒΆ

CreateTrigger - Create trigger Create trigger

func (*FormanceOrchestrationV1) CreateWorkflow ΒΆ

CreateWorkflow - Create workflow Create a workflow

func (*FormanceOrchestrationV1) DeleteTrigger ΒΆ

DeleteTrigger - Delete trigger Read trigger

func (*FormanceOrchestrationV1) DeleteWorkflow ΒΆ

DeleteWorkflow - Delete a flow by id Delete a flow by id

func (*FormanceOrchestrationV1) GetInstance ΒΆ

GetInstance - Get a workflow instance by id Get a workflow instance by id

func (*FormanceOrchestrationV1) GetInstanceHistory ΒΆ

GetInstanceHistory - Get a workflow instance history by id Get a workflow instance history by id

func (*FormanceOrchestrationV1) GetInstanceStageHistory ΒΆ

GetInstanceStageHistory - Get a workflow instance stage history Get a workflow instance stage history

func (*FormanceOrchestrationV1) GetWorkflow ΒΆ

GetWorkflow - Get a flow by id Get a flow by id

func (*FormanceOrchestrationV1) ListInstances ΒΆ

ListInstances - List instances of a workflow List instances of a workflow

func (*FormanceOrchestrationV1) ListTriggers ΒΆ

ListTriggers - List triggers List triggers

func (*FormanceOrchestrationV1) ListTriggersOccurrences ΒΆ

ListTriggersOccurrences - List triggers occurrences List triggers occurrences

func (*FormanceOrchestrationV1) ListWorkflows ΒΆ

ListWorkflows - List registered workflows List registered workflows

func (*FormanceOrchestrationV1) OrchestrationgetServerInfo ΒΆ

OrchestrationgetServerInfo - Get server info

func (*FormanceOrchestrationV1) ReadTrigger ΒΆ

ReadTrigger - Read trigger Read trigger

func (*FormanceOrchestrationV1) RunWorkflow ΒΆ

RunWorkflow - Run workflow Run workflow

func (*FormanceOrchestrationV1) SendEvent ΒΆ

SendEvent - Send an event to a running workflow Send an event to a running workflow

type FormancePaymentsV1 ΒΆ

type FormancePaymentsV1 struct {
	// contains filtered or unexported fields
}

func (*FormancePaymentsV1) AddAccountToPool ΒΆ

AddAccountToPool - Add an account to a pool Add an account to a pool

func (*FormancePaymentsV1) ConnectorsTransfer ΒΆ

ConnectorsTransfer - Transfer funds between Connector accounts Execute a transfer between two accounts.

func (*FormancePaymentsV1) CreateAccount ΒΆ

CreateAccount - Create an account Create an account

func (*FormancePaymentsV1) CreateBankAccount ΒΆ

CreateBankAccount - Create a BankAccount in Payments and on the PSP Create a bank account in Payments and on the PSP.

func (*FormancePaymentsV1) CreatePayment ΒΆ

CreatePayment - Create a payment Create a payment

func (*FormancePaymentsV1) CreatePool ΒΆ

CreatePool - Create a Pool Create a Pool

func (*FormancePaymentsV1) CreateTransferInitiation ΒΆ

CreateTransferInitiation - Create a TransferInitiation Create a transfer initiation

func (*FormancePaymentsV1) DeletePool ΒΆ

DeletePool - Delete a Pool Delete a pool by its id.

func (*FormancePaymentsV1) DeleteTransferInitiation ΒΆ

DeleteTransferInitiation - Delete a transfer initiation Delete a transfer initiation by its id.

func (*FormancePaymentsV1) ForwardBankAccount ΒΆ

ForwardBankAccount - Forward a bank account to a connector

func (*FormancePaymentsV1) GetAccountBalances ΒΆ

GetAccountBalances - Get account balances

func (*FormancePaymentsV1) GetBankAccount ΒΆ

GetBankAccount - Get a bank account created by user on Formance

func (*FormancePaymentsV1) GetConnectorTask ΒΆ

GetConnectorTask - Read a specific task of the connector Get a specific task associated to the connector.

Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.

func (*FormancePaymentsV1) GetConnectorTaskV1 ΒΆ

GetConnectorTaskV1 - Read a specific task of the connector Get a specific task associated to the connector.

func (*FormancePaymentsV1) GetPayment ΒΆ

GetPayment - Get a payment

func (*FormancePaymentsV1) GetPool ΒΆ

GetPool - Get a Pool

func (*FormancePaymentsV1) GetPoolBalances ΒΆ

GetPoolBalances - Get pool balances

func (*FormancePaymentsV1) GetTransferInitiation ΒΆ

GetTransferInitiation - Get a transfer initiation

func (*FormancePaymentsV1) InstallConnector ΒΆ

InstallConnector - Install a connector Install a connector by its name and config.

func (*FormancePaymentsV1) ListAllConnectors ΒΆ

ListAllConnectors - List all installed connectors List all installed connectors.

func (*FormancePaymentsV1) ListBankAccounts ΒΆ

ListBankAccounts - List bank accounts created by user on Formance List all bank accounts created by user on Formance.

func (*FormancePaymentsV1) ListConfigsAvailableConnectors ΒΆ

func (s *FormancePaymentsV1) ListConfigsAvailableConnectors(ctx context.Context, opts ...operations.Option) (*operations.ListConfigsAvailableConnectorsResponse, error)

ListConfigsAvailableConnectors - List the configs of each available connector List the configs of each available connector.

func (*FormancePaymentsV1) ListConnectorTasks ΒΆ

ListConnectorTasks - List tasks from a connector List all tasks associated with this connector.

Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.

func (*FormancePaymentsV1) ListConnectorTasksV1 ΒΆ

ListConnectorTasksV1 - List tasks from a connector List all tasks associated with this connector.

func (*FormancePaymentsV1) ListPayments ΒΆ

ListPayments - List payments

func (*FormancePaymentsV1) ListPools ΒΆ

ListPools - List Pools

func (*FormancePaymentsV1) ListTransferInitiations ΒΆ

ListTransferInitiations - List Transfer Initiations

func (*FormancePaymentsV1) PaymentsgetAccount ΒΆ

PaymentsgetAccount - Get an account

func (*FormancePaymentsV1) PaymentsgetServerInfo ΒΆ

PaymentsgetServerInfo - Get server info

func (*FormancePaymentsV1) PaymentslistAccounts ΒΆ

PaymentslistAccounts - List accounts

func (*FormancePaymentsV1) ReadConnectorConfig ΒΆ

ReadConnectorConfig - Read the config of a connector Read connector config

Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.

func (*FormancePaymentsV1) ReadConnectorConfigV1 ΒΆ

ReadConnectorConfigV1 - Read the config of a connector Read connector config

func (*FormancePaymentsV1) RemoveAccountFromPool ΒΆ

RemoveAccountFromPool - Remove an account from a pool Remove an account from a pool by its id.

func (*FormancePaymentsV1) ResetConnector ΒΆ

ResetConnector - Reset a connector Reset a connector by its name. It will remove the connector and ALL PAYMENTS generated with it.

Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.

func (*FormancePaymentsV1) ResetConnectorV1 ΒΆ

ResetConnectorV1 - Reset a connector Reset a connector by its name. It will remove the connector and ALL PAYMENTS generated with it.

func (*FormancePaymentsV1) RetryTransferInitiation ΒΆ

RetryTransferInitiation - Retry a failed transfer initiation Retry a failed transfer initiation

func (*FormancePaymentsV1) ReverseTransferInitiation ΒΆ

ReverseTransferInitiation - Reverse a transfer initiation Reverse transfer initiation

func (*FormancePaymentsV1) UdpateTransferInitiationStatus ΒΆ

UdpateTransferInitiationStatus - Update the status of a transfer initiation Update a transfer initiation status

func (*FormancePaymentsV1) UninstallConnector ΒΆ

UninstallConnector - Uninstall a connector Uninstall a connector by its name.

Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.

func (*FormancePaymentsV1) UninstallConnectorV1 ΒΆ

UninstallConnectorV1 - Uninstall a connector Uninstall a connector by its name.

func (*FormancePaymentsV1) UpdateBankAccountMetadata ΒΆ

UpdateBankAccountMetadata - Update metadata of a bank account

func (*FormancePaymentsV1) UpdateConnectorConfigV1 ΒΆ

UpdateConnectorConfigV1 - Update the config of a connector Update connector config

func (*FormancePaymentsV1) UpdateMetadata ΒΆ

UpdateMetadata - Update metadata

type FormanceReconciliationV1 ΒΆ

type FormanceReconciliationV1 struct {
	// contains filtered or unexported fields
}

func (*FormanceReconciliationV1) CreatePolicy ΒΆ

CreatePolicy - Create a policy Create a policy

func (*FormanceReconciliationV1) DeletePolicy ΒΆ

DeletePolicy - Delete a policy Delete a policy by its id.

func (*FormanceReconciliationV1) GetPolicy ΒΆ

GetPolicy - Get a policy

func (*FormanceReconciliationV1) GetReconciliation ΒΆ

GetReconciliation - Get a reconciliation

func (*FormanceReconciliationV1) ListPolicies ΒΆ

ListPolicies - List policies

func (*FormanceReconciliationV1) ListReconciliations ΒΆ

ListReconciliations - List reconciliations

func (*FormanceReconciliationV1) Reconcile ΒΆ

Reconcile using a policy Reconcile using a policy

func (*FormanceReconciliationV1) ReconciliationgetServerInfo ΒΆ

ReconciliationgetServerInfo - Get server info

type FormanceSearchV1 ΒΆ

type FormanceSearchV1 struct {
	// contains filtered or unexported fields
}

func (*FormanceSearchV1) Search ΒΆ

Search - search.v1 Elasticsearch.v1 query engine

Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.

func (*FormanceSearchV1) SearchgetServerInfo ΒΆ

SearchgetServerInfo - Get server info

Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.

type FormanceV1 ΒΆ

type FormanceV1 struct {
	// contains filtered or unexported fields
}

func (*FormanceV1) AddMetadataOnTransaction ΒΆ

AddMetadataOnTransaction - Set the metadata of a transaction by its ID

func (*FormanceV1) AddMetadataToAccount ΒΆ

AddMetadataToAccount - Add metadata to an account

func (*FormanceV1) CountAccounts ΒΆ

CountAccounts - Count the accounts from a ledger

func (*FormanceV1) CountTransactions ΒΆ

CountTransactions - Count the transactions from a ledger

func (*FormanceV1) CreateTransaction ΒΆ

CreateTransaction - Create a new transaction to a ledger

func (*FormanceV1) CreateTransactions ΒΆ

CreateTransactions - Create a new batch of transactions to a ledger

func (*FormanceV1) GetAccount ΒΆ

GetAccount - Get account by its address

func (*FormanceV1) GetBalances ΒΆ

GetBalances - Get the balances from a ledger's account

func (*FormanceV1) GetBalancesAggregated ΒΆ

GetBalancesAggregated - Get the aggregated balances from selected accounts

func (*FormanceV1) GetInfo ΒΆ

GetInfo - Show server information

func (*FormanceV1) GetLedgerInfo ΒΆ

GetLedgerInfo - Get information about a ledger

func (*FormanceV1) GetMapping ΒΆ

GetMapping - Get the mapping of a ledger

func (*FormanceV1) GetTransaction ΒΆ

GetTransaction - Get transaction from a ledger by its ID

func (*FormanceV1) ListAccounts ΒΆ

ListAccounts - List accounts from a ledger List accounts from a ledger, sorted by address in descending order.

func (*FormanceV1) ListLogs ΒΆ

ListLogs - List the logs from a ledger List the logs from a ledger, sorted by ID in descending order.

func (*FormanceV1) ListTransactions ΒΆ

ListTransactions - List transactions from a ledger List transactions from a ledger, sorted by txid in descending order.

func (*FormanceV1) ReadStats ΒΆ

ReadStats - Get statistics from a ledger Get statistics from a ledger. (aggregate metrics on accounts and transactions)

func (*FormanceV1) RevertTransaction ΒΆ

RevertTransaction - Revert a ledger transaction by its ID

func (*FormanceV1) RunScript ΒΆ

RunScript - Execute a Numscript This route is deprecated, and has been merged into `POST /{ledger}/transactions`.

Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.

func (*FormanceV1) UpdateMapping ΒΆ

UpdateMapping - Update the mapping of a ledger

type FormanceV2 ΒΆ

type FormanceV2 struct {
	// contains filtered or unexported fields
}

func (*FormanceV2) CancelEvent ΒΆ

CancelEvent - Cancel a running workflow Cancel a running workflow

func (*FormanceV2) CreateTrigger ΒΆ

CreateTrigger - Create trigger Create trigger

func (*FormanceV2) CreateWorkflow ΒΆ

CreateWorkflow - Create workflow Create a workflow

func (*FormanceV2) DeleteTrigger ΒΆ

DeleteTrigger - Delete trigger Read trigger

func (*FormanceV2) DeleteWorkflow ΒΆ

DeleteWorkflow - Delete a flow by id Delete a flow by id

func (*FormanceV2) GetInstance ΒΆ

GetInstance - Get a workflow instance by id Get a workflow instance by id

func (*FormanceV2) GetInstanceHistory ΒΆ

GetInstanceHistory - Get a workflow instance history by id Get a workflow instance history by id

func (*FormanceV2) GetInstanceStageHistory ΒΆ

GetInstanceStageHistory - Get a workflow instance stage history Get a workflow instance stage history

func (*FormanceV2) GetServerInfo ΒΆ

GetServerInfo - Get server info

func (*FormanceV2) GetWorkflow ΒΆ

GetWorkflow - Get a flow by id Get a flow by id

func (*FormanceV2) ListInstances ΒΆ

ListInstances - List instances of a workflow List instances of a workflow

func (*FormanceV2) ListTriggers ΒΆ

ListTriggers - List triggers List triggers

func (*FormanceV2) ListTriggersOccurrences ΒΆ

ListTriggersOccurrences - List triggers occurrences List triggers occurrences

func (*FormanceV2) ListWorkflows ΒΆ

ListWorkflows - List registered workflows List registered workflows

func (*FormanceV2) ReadTrigger ΒΆ

ReadTrigger - Read trigger Read trigger

func (*FormanceV2) RunWorkflow ΒΆ

RunWorkflow - Run workflow Run workflow

func (*FormanceV2) SendEvent ΒΆ

SendEvent - Send an event to a running workflow Send an event to a running workflow

func (*FormanceV2) TestTrigger ΒΆ

TestTrigger - Test trigger Test trigger

type FormanceWalletsV1 ΒΆ

type FormanceWalletsV1 struct {
	// contains filtered or unexported fields
}

func (*FormanceWalletsV1) ConfirmHold ΒΆ

ConfirmHold - Confirm a hold

func (*FormanceWalletsV1) CreateBalance ΒΆ

CreateBalance - Create a balance

func (*FormanceWalletsV1) CreateWallet ΒΆ

CreateWallet - Create a new wallet

func (*FormanceWalletsV1) CreditWallet ΒΆ

CreditWallet - Credit a wallet

func (*FormanceWalletsV1) DebitWallet ΒΆ

DebitWallet - Debit a wallet

func (*FormanceWalletsV1) GetBalance ΒΆ

GetBalance - Get detailed balance

func (*FormanceWalletsV1) GetHold ΒΆ

GetHold - Get a hold

func (*FormanceWalletsV1) GetHolds ΒΆ

GetHolds - Get all holds for a wallet

func (*FormanceWalletsV1) GetTransactions ΒΆ

func (*FormanceWalletsV1) GetWallet ΒΆ

GetWallet - Get a wallet

func (*FormanceWalletsV1) GetWalletSummary ΒΆ

GetWalletSummary - Get wallet summary

func (*FormanceWalletsV1) ListBalances ΒΆ

ListBalances - List balances of a wallet

func (*FormanceWalletsV1) ListWallets ΒΆ

ListWallets - List all wallets

func (*FormanceWalletsV1) UpdateWallet ΒΆ

UpdateWallet - Update a wallet

func (*FormanceWalletsV1) VoidHold ΒΆ

VoidHold - Cancel a hold

func (*FormanceWalletsV1) WalletsgetServerInfo ΒΆ

WalletsgetServerInfo - Get server info

type FormanceWebhooksV1 ΒΆ

type FormanceWebhooksV1 struct {
	// contains filtered or unexported fields
}

func (*FormanceWebhooksV1) ActivateConfig ΒΆ

ActivateConfig - Activate one config Activate a webhooks config by ID, to start receiving webhooks to its endpoint.

func (*FormanceWebhooksV1) ChangeConfigSecret ΒΆ

ChangeConfigSecret - Change the signing secret of a config Change the signing secret of the endpoint of a webhooks config.

If not passed or empty, a secret is automatically generated. The format is a random string of bytes of size 24, base64 encoded. (larger size after encoding)

func (*FormanceWebhooksV1) DeactivateConfig ΒΆ

DeactivateConfig - Deactivate one config Deactivate a webhooks config by ID, to stop receiving webhooks to its endpoint.

func (*FormanceWebhooksV1) DeleteConfig ΒΆ

DeleteConfig - Delete one config Delete a webhooks config by ID.

func (*FormanceWebhooksV1) GetManyConfigs ΒΆ

GetManyConfigs - Get many configs Sorted by updated date descending

func (*FormanceWebhooksV1) InsertConfig ΒΆ

InsertConfig - Insert a new config Insert a new webhooks config.

The endpoint should be a valid https URL and be unique.

The secret is the endpoint's verification secret. If not passed or empty, a secret is automatically generated. The format is a random string of bytes of size 24, base64 encoded. (larger size after encoding)

All eventTypes are converted to lower-case when inserted.

func (*FormanceWebhooksV1) TestConfig ΒΆ

TestConfig - Test one config Test a config by sending a webhook to its endpoint.

type HTTPClient ΒΆ

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient provides an interface for suplying the SDK with a custom HTTP client

type Ledger ΒΆ

type Ledger struct {
	V1 *FormanceV1
	V2 *V2
	// contains filtered or unexported fields
}

type Orchestration ΒΆ

type Orchestration struct {
	V1 *FormanceOrchestrationV1
	V2 *FormanceV2
	// contains filtered or unexported fields
}

type Payments ΒΆ

type Payments struct {
	V1 *FormancePaymentsV1
	// contains filtered or unexported fields
}

type Reconciliation ΒΆ

type Reconciliation struct {
	V1 *FormanceReconciliationV1
	// contains filtered or unexported fields
}

type SDKOption ΒΆ

type SDKOption func(*Formance)

func WithClient ΒΆ

func WithClient(client HTTPClient) SDKOption

WithClient allows the overriding of the default HTTP client used by the SDK

func WithEnvironment ΒΆ

func WithEnvironment(environment ServerEnvironment) SDKOption

WithEnvironment allows setting the environment variable for url substitution

func WithOrganization ΒΆ

func WithOrganization(organization string) SDKOption

WithOrganization allows setting the organization variable for url substitution

func WithRetryConfig ΒΆ

func WithRetryConfig(retryConfig retry.Config) SDKOption

func WithSecurity ΒΆ

func WithSecurity(security shared.Security) SDKOption

WithSecurity configures the SDK to use the provided security details

func WithSecuritySource ΒΆ

func WithSecuritySource(security func(context.Context) (shared.Security, error)) SDKOption

WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication

func WithServerIndex ΒΆ

func WithServerIndex(serverIndex int) SDKOption

WithServerIndex allows the overriding of the default server by index

func WithServerURL ΒΆ

func WithServerURL(serverURL string) SDKOption

WithServerURL allows the overriding of the default server URL

func WithTemplatedServerURL ΒΆ

func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption

WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters

func WithTimeout ΒΆ

func WithTimeout(timeout time.Duration) SDKOption

WithTimeout Optional request timeout applied to each operation

type Search struct {
	V1 *FormanceSearchV1
	// contains filtered or unexported fields
}

type ServerEnvironment ΒΆ

type ServerEnvironment string

ServerEnvironment - The environment name. Defaults to the production environment.

const (
	ServerEnvironmentSandbox ServerEnvironment = "sandbox"
	ServerEnvironmentEuWest1 ServerEnvironment = "eu-west-1"
	ServerEnvironmentUsEast1 ServerEnvironment = "us-east-1"
)

func (ServerEnvironment) ToPointer ΒΆ

func (e ServerEnvironment) ToPointer() *ServerEnvironment

func (*ServerEnvironment) UnmarshalJSON ΒΆ

func (e *ServerEnvironment) UnmarshalJSON(data []byte) error

type V1 ΒΆ

type V1 struct {
	// contains filtered or unexported fields
}

func (*V1) CreateClient ΒΆ

func (s *V1) CreateClient(ctx context.Context, request *shared.CreateClientRequest, opts ...operations.Option) (*operations.CreateClientResponse, error)

CreateClient - Create client

func (*V1) CreateSecret ΒΆ

CreateSecret - Add a secret to a client

func (*V1) DeleteClient ΒΆ

DeleteClient - Delete client

func (*V1) DeleteSecret ΒΆ

DeleteSecret - Delete a secret from a client

func (*V1) GetOIDCWellKnowns ΒΆ

func (s *V1) GetOIDCWellKnowns(ctx context.Context, opts ...operations.Option) (*operations.GetOIDCWellKnownsResponse, error)

GetOIDCWellKnowns - Retrieve OpenID connect well-knowns.

func (*V1) GetServerInfo ΒΆ

func (s *V1) GetServerInfo(ctx context.Context, opts ...operations.Option) (*operations.GetServerInfoResponse, error)

GetServerInfo - Get server info

func (*V1) ListClients ΒΆ

func (s *V1) ListClients(ctx context.Context, opts ...operations.Option) (*operations.ListClientsResponse, error)

ListClients - List clients

func (*V1) ListUsers ΒΆ

func (s *V1) ListUsers(ctx context.Context, opts ...operations.Option) (*operations.ListUsersResponse, error)

ListUsers - List users List users

func (*V1) ReadClient ΒΆ

ReadClient - Read client

func (*V1) ReadUser ΒΆ

ReadUser - Read user Read user

func (*V1) UpdateClient ΒΆ

UpdateClient - Update client

type V2 ΒΆ

type V2 struct {
	// contains filtered or unexported fields
}

func (*V2) AddMetadataOnTransaction ΒΆ

AddMetadataOnTransaction - Set the metadata of a transaction by its ID

func (*V2) AddMetadataToAccount ΒΆ

AddMetadataToAccount - Add metadata to an account

func (*V2) CountAccounts ΒΆ

CountAccounts - Count the accounts from a ledger

func (*V2) CountTransactions ΒΆ

CountTransactions - Count the transactions from a ledger

func (*V2) CreateBulk ΒΆ

CreateBulk - Bulk request

func (*V2) CreateLedger ΒΆ

CreateLedger - Create a ledger

func (*V2) CreateTransaction ΒΆ

CreateTransaction - Create a new transaction to a ledger

func (*V2) DeleteAccountMetadata ΒΆ

DeleteAccountMetadata - Delete metadata by key Delete metadata by key

func (*V2) DeleteLedgerMetadata ΒΆ

DeleteLedgerMetadata - Delete ledger metadata by key

func (*V2) DeleteTransactionMetadata ΒΆ

DeleteTransactionMetadata - Delete metadata by key Delete metadata by key

func (*V2) ExportLogs ΒΆ

ExportLogs - Export logs

func (*V2) GetAccount ΒΆ

GetAccount - Get account by its address

func (*V2) GetBalancesAggregated ΒΆ

GetBalancesAggregated - Get the aggregated balances from selected accounts

func (*V2) GetInfo ΒΆ

func (s *V2) GetInfo(ctx context.Context, opts ...operations.Option) (*operations.V2GetInfoResponse, error)

GetInfo - Show server information

func (*V2) GetLedger ΒΆ

GetLedger - Get a ledger

func (*V2) GetLedgerInfo ΒΆ

GetLedgerInfo - Get information about a ledger

func (*V2) GetTransaction ΒΆ

GetTransaction - Get transaction from a ledger by its ID

func (*V2) GetVolumesWithBalances ΒΆ

GetVolumesWithBalances - Get list of volumes with balances for (account/asset)

func (*V2) ListAccounts ΒΆ

ListAccounts - List accounts from a ledger List accounts from a ledger, sorted by address in descending order.

func (*V2) ListLedgers ΒΆ

ListLedgers - List ledgers

func (*V2) ListLogs ΒΆ

ListLogs - List the logs from a ledger List the logs from a ledger, sorted by ID in descending order.

func (*V2) ListTransactions ΒΆ

ListTransactions - List transactions from a ledger List transactions from a ledger, sorted by id in descending order.

func (*V2) ReadStats ΒΆ

ReadStats - Get statistics from a ledger Get statistics from a ledger. (aggregate metrics on accounts and transactions)

func (*V2) RevertTransaction ΒΆ

RevertTransaction - Revert a ledger transaction by its ID

func (*V2) UpdateLedgerMetadata ΒΆ

UpdateLedgerMetadata - Update ledger metadata

type Wallets ΒΆ

type Wallets struct {
	V1 *FormanceWalletsV1
	// contains filtered or unexported fields
}

type Webhooks ΒΆ

type Webhooks struct {
	V1 *FormanceWebhooksV1
	// contains filtered or unexported fields
}

Directories ΒΆ

Path Synopsis
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL