api

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHeaders

func DefaultHeaders(id, key string) map[string]string

Types

type Client

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

func NewClient

func NewClient(cfg *Config) *Client

func (*Client) AllowedDocumentTypes

func (c *Client) AllowedDocumentTypes(ctx context.Context) (*entity.AllowedDocumentTypesResp, error)

func (*Client) AllowedEntityScopes

func (c *Client) AllowedEntityScopes(ctx context.Context) (*entity.AllowedEntityScopesResp, error)

func (*Client) AllowedEntityTypes

func (c *Client) AllowedEntityTypes(ctx context.Context) (*entity.AllowedEntityTypesResp, error)

func (*Client) AllowedNodeTypes added in v0.2.0

func (c *Client) AllowedNodeTypes(ctx context.Context) (*entity.AllowedNodeTypesResp, error)

func (*Client) CreateNode added in v0.2.0

func (c *Client) CreateNode(ctx context.Context, req *entity.CreateNodeReq) (*entity.CreateNodeResp, error)

func (*Client) CreateOAuthKey

func (c *Client) CreateOAuthKey(ctx context.Context, req *entity.CreateOAuthKeyReq) (*entity.CreateOAuthKeyResp, error)

func (*Client) CreateSubnet added in v0.4.0

func (c *Client) CreateSubnet(ctx context.Context, req *entity.CreateSubnetReq) (*entity.CreateSubnetResp, error)

func (*Client) CreateUser

func (c *Client) CreateUser(ctx context.Context, req *entity.CreateUserReq) (*entity.CreateUserResp, error)

func (*Client) GenerateECashBarcode added in v0.2.0

func (*Client) GenerateRefreshToken

func (*Client) GenerateUBODoc

func (c *Client) GenerateUBODoc(ctx context.Context, req *entity.GenerateUBODocReq) (*entity.GenerateUBODocResp, error)

func (*Client) GenerateUserDeviceFingerprint

func (c *Client) GenerateUserDeviceFingerprint(id, key, userID string) string

func (*Client) GetDuplicates

func (c *Client) GetDuplicates(ctx context.Context, req *entity.GetDuplicatesReq) (*entity.GetDuplicatesResp, error)

func (*Client) IdempotencyHeader

func (c *Client) IdempotencyHeader() map[string]string

func (*Client) PushToWallet added in v0.4.0

func (c *Client) PushToWallet(ctx context.Context, req *entity.PushToWalletReq) (*entity.PushToWalletResp, error)

func (*Client) SwapDuplicateUsers

func (*Client) UpdateNode added in v0.2.0

func (c *Client) UpdateNode(ctx context.Context, req *entity.UpdateNodeReq) (*entity.UpdateNodeResp, error)

func (*Client) UpdateSubnet added in v0.4.0

func (c *Client) UpdateSubnet(ctx context.Context, req *entity.UpdateSubnetReq) (*entity.UpdateSubnetResp, error)

func (*Client) UpdateUser

func (c *Client) UpdateUser(ctx context.Context, req *entity.UpdateUserReq) (*entity.UpdateUserResp, error)

func (*Client) UserHeader

func (c *Client) UserHeader(userOAuthKey, userID string) map[string]string

func (*Client) UserIPHeader

func (c *Client) UserIPHeader(ip string) map[string]string

func (*Client) ViewATMs added in v0.2.0

func (c *Client) ViewATMs(ctx context.Context) (*entity.ViewATMsResp, error)

func (*Client) ViewAllNodeSubnets added in v0.4.0

func (*Client) ViewAllUserNodes added in v0.2.0

func (c *Client) ViewAllUserNodes(ctx context.Context, req *entity.ViewAllUserNodesReq) (*entity.ViewAllUserNodesResp, error)

func (*Client) ViewAllUsers added in v0.2.0

func (c *Client) ViewAllUsers(ctx context.Context, req *entity.ViewAllUsersReq) (*entity.ViewAllUsersResp, error)

func (*Client) ViewNode added in v0.2.0

func (c *Client) ViewNode(ctx context.Context, req *entity.ViewNodeReq) (*entity.ViewNodeResp, error)

func (*Client) ViewSubnet added in v0.4.0

func (c *Client) ViewSubnet(ctx context.Context, req *entity.ViewSubnetReq) (*entity.ViewSubnetResp, error)

func (*Client) ViewUser

func (c *Client) ViewUser(ctx context.Context, req *entity.ViewUserReq) (*entity.ViewUserResp, error)

type Config

type Config struct {
	ID string
	// Key is the authentication API key.
	// Most requests to the Synapse API must be authenticated with an API key.
	// You can create an API key in your Settings page after creating a Synapse account.
	// Reference: https://docs.synapsefi.com/intro-to-apis
	Key string
	// Timeout describes total waiting time before a request is treated as timeout.
	// Optional.
	// Default: 1 min.
	Timeout time.Duration
	// RetryCount describes total number of retry in case error occurred.
	// Optional.
	// Default: 0 = disable retry mechanism.
	RetryCount int
	// RetryMaxWaitTime describes total waiting time between each retry.
	// Optional.
	// Default: 2 second.
	RetryMaxWaitTime time.Duration
	// Debug describes the client to enter debug mode.
	// Debug mode will dump the request and response on each API call.
	// Be warn, credentials data will be dumped too.
	// Ensure you're only this mode on safe environment like local.
	// Optional.
	// Default: false.
	Debug bool
	// HostURL describes the host url target.
	// HostURL can be filled with your fake server host url for testing purpose.
	// Optional.
	// Default: https://api.synapsefi.com
	HostURL string
}

Config is the necessary configuration to call API.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates configuration correctness and fill fields with default configuration if left empty.

type OAuthClientItf

type OAuthClientItf interface {
	CreateOAuthKey(ctx context.Context, req *entity.CreateOAuthKeyReq) (*entity.CreateOAuthKeyResp, error)
	GenerateRefreshToken(ctx context.Context, req *entity.GenerateRefreshTokenReq) (*entity.GenerateRefreshTokenResp, error)
}

type ShipmentsClientItf

type ShipmentsClientItf interface {
}

type StatementsClientItf

type StatementsClientItf interface {
}

type SubscriptionsClientItf

type SubscriptionsClientItf interface {
}

type TransactionsClientItf

type TransactionsClientItf interface {
}

Jump to

Keyboard shortcuts

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