configuration

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvS3Bucket                        string = "DCA_BUCKET"
	EnvS3ConfigPath                    string = "DCA_CONFIG"
	EnvAllowReal                       string = "DCA_ALLOW_REAL"
	EnvSQSPendingOrdersQueue           string = "DCA_PENDING_ORDERS_QUEUE_URL"
	EnvS3PendingTransaction            string = "DCA_PENDING_ORDER_S3_PREFIX"
	EnvS3ProcessedTransaction          string = "DCA_PROCESSED_ORDER_S3_PREFIX"
	EnvGlueProcessTransactionJob       string = "DCA_GLUE_PROCESS_TRANSACTION_JOB"
	EnvGlueProcessTransactionOperation string = "DCA_GLUE_PROCESS_TRANSACTION_OPERATION"
)

Environment Variable names to retrieve.

Variables

View Source
var (
	SSMKrakenKey    string = "/dca-manager/kraken/key"
	SSMKrakenSecret string = "/dca-manager/kraken/secret"
)

SSM Keys to fetch for Kraken to connect to Kraken.

Functions

This section is empty.

Types

type DCAConfig

type DCAConfig struct {
	Orders []DCAOrder `json:"orders"`
}

DCAConfig is the root object for DCA configuration.

type DCAConfiguration

type DCAConfiguration struct{}

DCAConfiguration gets configuration from an underlying source.

func (DCAConfiguration) GetDCAConfiguration

func (d DCAConfiguration) GetDCAConfiguration(ctx context.Context, s3Client pkg.S3Access, s3Bucket *string, s3ConfigPath *string) (*DCAConfig, error)

GetDCAConfiguration gets DCA configuration from S3

type DCAConfigurationSource

type DCAConfigurationSource interface {
	GetDCAConfiguration(ctx context.Context, s3Client pkg.S3Access, s3Bucket *string, s3ConfigPath *string) (*DCAConfig, error)
}

DCAConfigurationSource is an abstraction to get configuration.

type DCAOrder

type DCAOrder struct {
	Exchange  string `json:"exchange"`
	Direction string `json:"direction"`
	OrderType string `json:"ordertype"`
	Volume    string `json:"volume"`
	Pair      string `json:"pair"`
	Validate  bool   `json:"validate"`
	Enabled   bool   `json:"enabled"`
}

DCAOrder is a single order to be executed

type KrakenConf

type KrakenConf struct{}

KrakenConf gets details to connect to the Kraken Exchange.

func (KrakenConf) GetKrakenDetails

func (k KrakenConf) GetKrakenDetails(ctx context.Context, ssmClient pkg.SSMAccess) (key *string, secret *string, error error)

GetKrakenDetails gets the Kraken Key and Secret.

type KrakenConfiguration

type KrakenConfiguration interface {
	GetKrakenDetails(ctx context.Context, ssmClient pkg.SSMAccess) (key *string, secret *string, error error)
}

KrakenConfiguration is an abstraction to gets details to connect to the Kraken Exchange.

Jump to

Keyboard shortcuts

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