infrastructure

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	HasuraURL                         string
	NodeRestUrl                       string
	NodeRPCUrl                        string
	BitcoinNodeUrl                    string
	BitcoinNodePort                   string
	BitcoinNodeUserName               string
	BitcoinNodePassword               string
	FoundryPoolAPIBaseURL             string
	FoundryPoolAPIKey                 string
	DbDriverName                      string
	DbHost                            string
	DbPort                            string
	DbUser                            string
	DbPassword                        string
	DbName                            string
	HasuraActionsURL                  string
	IsTesting                         bool
	AuraPoolBackEndUrl                string
	Network                           string
	CUDOMaintenanceFeePercent         float64
	CUDOFeePayoutAddress              string
	CUDOMaintenanceFeePayoutAddress   string
	CUDOFeeOnAllBTC                   float64
	AuraPoolTestFarmWalletPassword    string
	WorkerProcessIntervalPayment      time.Duration
	WorkerProcessIntervalRetry        time.Duration
	WorkerFailureRetryDelay           time.Duration
	RBFTransactionRetryDelayInSeconds int
	RBFTransactionRetryMaxCount       int
	GlobalPayoutThresholdInBTC        float64
	MailFromAddress                   string
	MailToAddress                     string
	SendgridApiKey                    string
	ServiceMaxErrorCount              int
}

func NewConfig

func NewConfig() *Config

NewConfig New returns a new Config struct

type Helper

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

func NewHelper

func NewHelper(config *Config) *Helper

func (*Helper) Date

func (h *Helper) Date() (year int, month time.Month, day int)

func (*Helper) DaysIn

func (h *Helper) DaysIn(m time.Month, year int) int

We generate a date one month on from the target one (m+1), but set the day of month to 0. Days are 1-indexed, so this has the effect of rolling back one day to the last day of the previous month (our target month of m). Calling Day() then procures the number we want. Returns the length of the month

func (*Helper) SendMail

func (h *Helper) SendMail(message string) error

func (*Helper) Unix

func (h *Helper) Unix() int64

type Provider

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

func NewProvider

func NewProvider(config *Config) *Provider

func (*Provider) InitBtcRpcClient

func (p *Provider) InitBtcRpcClient() (*rpcclient.Client, error)

func (*Provider) InitDBConnection

func (p *Provider) InitDBConnection() (*sqlx.DB, error)

Jump to

Keyboard shortcuts

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