Documentation ¶
Index ¶
- Variables
- func NewEthClient(ctx context.Context, services *eth.ClientServices, config *EthereumConfig) (*eth.Client, error)
- func NewEthClientWithDeps(ctx context.Context, deps *eth.ClientDeps) (*eth.Client, error)
- type BackendConfig
- type BackendProvider
- type ClientFactory
- type ClientFactoryFunc
- type ClientServices
- type Config
- type Deps
- type ErrUnknownBackend
- type EthereumConfig
- type RequestManagerFactory
- type RequestManagerFactoryFunc
- type WalletConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrEkidenBackendNotImplemented = errors.New("ekiden backend is not implemented")
)
View Source
var NewBackendClient = ClientFactoryFunc(func(ctx context.Context, services *ClientServices, config *Config) (core.Client, error) { switch config.Provider { case BackendEthereum: return NewEthClient(ctx, ð.ClientServices{ Logger: services.Logger, Callbacks: services.Callbacks, }, config.BackendConfig.(*EthereumConfig)) case BackendEkiden: return nil, ErrEkidenBackendNotImplemented default: return nil, ErrUnknownBackend{Backend: config.Provider.String()} } })
View Source
var NewRequestManagerWithDeps = RequestManagerFactoryFunc(func(ctx context.Context, deps *Deps) (*core.RequestManager, error) { return core.NewRequestManager(core.RequestManagerProperties{ MQueue: deps.MQueue, Client: deps.Client, Logger: deps.Logger, }), nil })
Functions ¶
func NewEthClient ¶
func NewEthClient(ctx context.Context, services *eth.ClientServices, config *EthereumConfig) (*eth.Client, error)
func NewEthClientWithDeps ¶
Types ¶
type BackendConfig ¶
type BackendConfig interface { log.Loggable config.Binder ID() BackendProvider }
type BackendProvider ¶
type BackendProvider string
const ( BackendEthereum BackendProvider = "ethereum" BackendEkiden BackendProvider = "ekiden" )
func (BackendProvider) String ¶
func (m BackendProvider) String() string
type ClientFactory ¶
type ClientFactoryFunc ¶
func (ClientFactoryFunc) New ¶
func (f ClientFactoryFunc) New(ctx context.Context, services *ClientServices, config *Config) (core.Client, error)
type Config ¶
type Config struct { Provider BackendProvider BackendConfig BackendConfig }
type ErrUnknownBackend ¶
type ErrUnknownBackend struct {
Backend string
}
func (ErrUnknownBackend) Error ¶
func (e ErrUnknownBackend) Error() string
type EthereumConfig ¶
type EthereumConfig struct { URL string WalletConfig WalletConfig }
func (*EthereumConfig) ID ¶
func (c *EthereumConfig) ID() BackendProvider
func (*EthereumConfig) Log ¶
func (c *EthereumConfig) Log(fields log.Fields)
type RequestManagerFactory ¶
type RequestManagerFactoryFunc ¶
func (RequestManagerFactoryFunc) New ¶
func (f RequestManagerFactoryFunc) New(ctx context.Context, deps *Deps) (*core.RequestManager, error)
type WalletConfig ¶
type WalletConfig struct { // PrivateKeys for the wallet PrivateKeys []string }
WalletConfig holds the configuration of a single wallet
func (*WalletConfig) Log ¶
func (c *WalletConfig) Log(fields log.Fields)
Click to show internal directories.
Click to hide internal directories.