Documentation
¶
Overview ¶
Package config provides configuation definitions and config loading utilities for Temporal (https://github.com/RTradeLtd/Temporal), an easy-to-use interface into distributed and decentralized storage technologies for personal and enterprise use cases.
Index ¶
- func GenerateConfig(configPath string) error
- type API
- type APIKeys
- type AWS
- type Database
- type Ethereum
- type IPFS
- type IPFSCluster
- type Krab
- type KrabFallback
- type Lens
- type Nexus
- type Pay
- type RTNS
- type RabbitMQ
- type Sendgrid
- type Services
- type Stripe
- type TemporalConfig
- type V3
- type V3API
- type V3Gateway
- type V3JWT
- type V3TLS
- type Wallets
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateConfig ¶
GenerateConfig writes a empty TemporalConfig template to given filepath
Types ¶
type API ¶
type API struct {
Connection struct {
Certificates struct {
CertPath string `json:"cert_path"`
KeyPath string `json:"key_path"`
} `json:"certificates"`
ListenAddress string `json:"listen_address"`
// defines parameters for prometheus metric collector
Prometheus struct {
IP string `json:"ip"`
Port string `json:"port"`
} `json:"prometheus"`
CORS struct {
AllowedOrigins []string `json:"allowed_origins"`
} `json:"cors"`
// define the maximum number of people allowed to connect to the API
Limit string `json:"limit"`
} `json:"connection"`
JWT struct {
Key string `json:"key"`
Realm string `json:"realm"`
} `json:"jwt"`
SizeLimitInGigaBytes string `json:"size_limit_in_giga_bytes"`
}
API configures the Temporal API
type APIKeys ¶
type APIKeys struct {
ChainRider string `json:"chain_rider"`
}
APIKeys are the various API keys we use
type Database ¶
type Database struct {
Name string `json:"name"`
URL string `json:"url"`
Port string `json:"port"`
Username string `json:"username"`
Password string `json:"password"`
}
Database configures Temporal's connection to a Postgres database
type Ethereum ¶
type Ethereum struct {
Account struct {
Address string `json:"address"`
KeyFile string `json:"key_file"`
KeyPass string `json:"key_pass"`
} `json:"account"`
Connection struct {
RPC struct {
IP string `json:"ip"`
Port string `json:"port"`
} `json:"rpc"`
IPC struct {
Path string `json:"path"`
} `json:"ipc"`
INFURA struct {
URL string `json:"url"`
} `json:"infura"`
} `json:"connection"`
Contracts struct {
RTCAddress string `json:"rtc_address"`
PaymentContractAddress string `json:"payment_contract_address"`
} `json:"contracts"`
}
Ethereum configures Temporal's connection, and interaction with the Ethereum blockchain
type IPFS ¶
type IPFS struct {
APIConnection struct {
Host string `json:"host"`
Port string `json:"port"`
} `json:"api_connection"`
KeystorePath string `json:"keystore_path"`
}
IPFS configures Temporal's connection to an IPFS node
type IPFSCluster ¶
type IPFSCluster struct {
APIConnection struct {
Host string `json:"host"`
Port string `json:"port"`
} `json:"api_connection"`
}
IPFSCluster configures Temporal's connection to an IPFS cluster
type Krab ¶
type Krab struct {
URL string `json:"url"`
TLS struct {
CertPath string `json:"cert_path"`
KeyFile string `json:"key_file"`
}
AuthKey string `json:"auth_key"`
LogFile string `json:"log_file"`
KeystorePassword string `json:"keystore_password"`
}
Krab is used to for key management
type KrabFallback ¶
type KrabFallback Krab
KrabFallback is a fallback configuration for connecting to a secondary krab server
type Lens ¶
type Lens struct {
URL string `json:"url"`
TLS struct {
CertPath string `json:"cert_path"`
KeyFile string `json:"key_file"`
} `json:"tls"`
AuthKey string `json:"auth_key"`
Options struct {
Engine struct {
StorePath string `json:"store_path"`
Queue struct {
Rate int `json:"rate"`
Batch int `json:"batch"`
} `json:"queue"`
} `json:"engine"`
} `json:"options"`
}
Lens defines options for the Lens search engine
type Nexus ¶
type Nexus struct {
Host string `json:"host"`
Port string `json:"port"`
Key string `json:"key"`
TLS struct {
CertPath string `json:"cert"`
KeyPath string `json:"key"`
} `json:"tls"`
Delegator struct {
Port string `json:"port"`
} `json:"delegator"`
}
Nexus defines options for the Nexus, our private network management tool for IPFS.
type Pay ¶
type Pay struct {
Address string `json:"address"`
Port string `json:"port"`
Protocol string `json:"protocol"`
TLS struct {
CertPath string `json:"cert"`
KeyPath string `json:"key"`
} `json:"tls"`
AuthKey string `json:"auth_key"`
}
Pay configures connection to our payment processor
type RTNS ¶ added in v2.1.5
type RTNS struct {
MultiAddresses []string `json:"multi_addresses,omitempty"`
// name of the private key stored within krab
KeyName string `json:"pk_name,omitempty"`
// path to persistent data store
DatastorePath string `json:"datastore_path"`
}
RTNS is used to configure our RTNS publishing service
type RabbitMQ ¶
type RabbitMQ struct {
URL string `json:"url"`
TLSConfig struct {
CertFile string `json:"cert_file"`
KeyFile string `json:"key_file"`
CACertFile string `json:"ca_cert_file"`
} `json:"tls_config"`
}
RabbitMQ configures Temporal's connection to a RabbitMQ instance
type Sendgrid ¶
type Sendgrid struct {
APIKey string `json:"api_key"`
EmailAddress string `json:"email_address"`
EmailName string `json:"email_name"`
}
Sendgrid configures Temporal's connection to Sendgrid
type Services ¶
type Services struct {
MoneroRPC string `json:"monero_rpc"`
Lens `json:"lens"`
Nexus `json:"nexus"`
MongoDB struct {
URL string `json:"url"`
DB string `json:"db"`
UploadCollection string `json:"uploads"`
} `json:"mongodb"`
Raven struct {
URL string `json:"url"`
User string `json:"user"`
Pass string `json:"pass"`
} `json:"raven"`
BchGRPC struct {
URL string `json:"url"`
CertFile string `json:"cert_file"`
KeyFile string `json:"key_file"`
// Wallet defines connection information
// to the bchwallet gRPC service
Wallet struct {
URL string `json:"url"`
CertFile string `json:"cert_file"`
KeyFile string `json:"key_file"`
} `json:"wallet"`
} `json:"bch_grpc"`
Krab `json:"krab"`
KrabFallback Krab `json:"krab_fallback"`
RTNS `json:"rtns"`
}
Services are various endpoints we connect to
type Stripe ¶
type Stripe struct {
PublishableKey string `json:"publishable_key"`
SecretKey string `json:"secret_key"`
}
Stripe is used to configure our connection with stripe api
type TemporalConfig ¶
type TemporalConfig struct {
V3 `json:"v3,omitempty" envconfig:"optional"`
API `json:"api,omitempty" envconfig:"optional"`
APIKeys `json:"api_keys,omitempty" envconfig:"optional"`
AWS `json:"aws,omitempty" envconfig:"optional"`
Database `json:"database,omitempty" envconfig:"optional"`
Services `json:"services,omitempty" envconfig:"optional"`
Ethereum `json:"ethereum,omitempty" envconfig:"optional"`
IPFSCluster `json:"ipfs_cluster,omitempty" envconfig:"optional"`
IPFS `json:"ipfs,omitempty" envconfig:"optional"`
Pay `json:"pay,omitempty" envconfig:"optional"`
RabbitMQ `json:"rabbitmq,omitempty" envconfig:"optional"`
Sendgrid `json:"sendgrid,omitempty" envconfig:"optional"`
Stripe `json:"stripe,omitempty" envconfig:"optional"`
Wallets `json:"wallets,omitempty" envconfig:"optional"`
LogDir string `json:"log_dir,omitempty" envconfig:"optional"`
}
TemporalConfig defines Temporal configuration fields
func LoadConfig ¶
func LoadConfig(configPath string) (*TemporalConfig, error)
LoadConfig loads a TemporalConfig from given filepath
func LoadConfigFromEnv ¶ added in v2.2.0
func LoadConfigFromEnv() (*TemporalConfig, error)
LoadConfigFromEnv is used to load a TemporalConfig object us env vars