Documentation ¶
Index ¶
- Constants
- type MongoCollection
- type MongoDBReceiptStoreConf
- type MongoDatabase
- type MongoQuery
- type RESTGateway
- func (g *RESTGateway) CobraInit(cmdName string) (cmd *cobra.Command)
- func (g *RESTGateway) Conf() *RESTGatewayConf
- func (g *RESTGateway) DispatchMsgAsync(ctx context.Context, msg map[string]interface{}, ack bool) (*maidenlanedmessages.AsyncSentMsg, error)
- func (g *RESTGateway) SetConf(conf *RESTGatewayConf)
- func (g *RESTGateway) Start() (err error)
- func (g *RESTGateway) ValidateConf() (err error)
- type RESTGatewayConf
- type ReceiptStoreConf
- type ReceiptStorePersistence
- type WebhooksDirectConf
Constants ¶
const (
// MaxHeaderSize max size of content
MaxHeaderSize = 16 * 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoCollection ¶
type MongoCollection interface { Insert(...interface{}) error Create(info *mgo.CollectionInfo) error EnsureIndex(index mgo.Index) error Find(query interface{}) MongoQuery }
MongoCollection is the subset of mgo that we use, allowing stubbing
type MongoDBReceiptStoreConf ¶
type MongoDBReceiptStoreConf struct { ReceiptStoreConf URL string `json:"url"` Database string `json:"database"` Collection string `json:"collection"` ConnectTimeoutMS int `json:"connectTimeout"` }
MongoDBReceiptStoreConf is the configuration for a MongoDB receipt store
type MongoDatabase ¶
type MongoDatabase interface { Connect(url string, timeout time.Duration) error GetCollection(database string, collection string) MongoCollection }
MongoDatabase is a subset of mgo that we use, allowing stubbing.
type MongoQuery ¶
type MongoQuery interface { Limit(n int) *mgo.Query Skip(n int) *mgo.Query Sort(fields ...string) *mgo.Query All(result interface{}) error One(result interface{}) error }
MongoQuery is the subset of mgo that we use, allowing stubbing
type RESTGateway ¶
type RESTGateway struct {
// contains filtered or unexported fields
}
RESTGateway as the HTTP gateway interface for zeroxyz
func NewRESTGateway ¶
func NewRESTGateway(printYAML *bool) (g *RESTGateway)
NewRESTGateway constructor
func (*RESTGateway) CobraInit ¶
func (g *RESTGateway) CobraInit(cmdName string) (cmd *cobra.Command)
CobraInit retruns a cobra command to configure this KafkaBridge
func (*RESTGateway) Conf ¶
func (g *RESTGateway) Conf() *RESTGatewayConf
Conf gets the config for this bridge
func (*RESTGateway) DispatchMsgAsync ¶
func (g *RESTGateway) DispatchMsgAsync(ctx context.Context, msg map[string]interface{}, ack bool) (*maidenlanedmessages.AsyncSentMsg, error)
DispatchMsgAsync is the rest2eth interface method for async dispatching of messages (via our webhook logic)
func (*RESTGateway) SetConf ¶
func (g *RESTGateway) SetConf(conf *RESTGatewayConf)
SetConf sets the config for this bridge
func (*RESTGateway) Start ¶
func (g *RESTGateway) Start() (err error)
Start kicks off the HTTP listener and router
func (*RESTGateway) ValidateConf ¶
func (g *RESTGateway) ValidateConf() (err error)
ValidateConf validates the config
type RESTGatewayConf ¶
type RESTGatewayConf struct { Kafka maidenlanedkafka.KafkaCommonConf `json:"kafka"` MongoDB MongoDBReceiptStoreConf `json:"mongodb"` MemStore ReceiptStoreConf `json:"memstore"` OpenAPI maidenlanedcontracts.SmartContractGatewayConf `json:"openapi"` HTTP struct { LocalAddr string `json:"localAddr"` Port int `json:"port"` TLS maidenlanedutils.TLSConfig `json:"tls"` } `json:"http"` WebhooksDirectConf }
RESTGatewayConf defines the YAML config structure for a webhooks bridge instance
type ReceiptStoreConf ¶
ReceiptStoreConf is the common configuration for all receipt stores
type ReceiptStorePersistence ¶
type ReceiptStorePersistence interface { GetReceipts(skip, limit int, ids []string, sinceEpochMS int64, from, to string) (*[]map[string]interface{}, error) GetReceipt(requestID string) (*map[string]interface{}, error) AddReceipt(receipt *map[string]interface{}) error }
ReceiptStorePersistence interface implemented by persistence layers
type WebhooksDirectConf ¶
type WebhooksDirectConf struct { MaxInFlight int `json:"maxInFlight"` maidenlanedtx.TxnProcessorConf maidenlanedeth.RPCConf }
WebhooksDirectConf defines the YAML structore for a Webhooks direct to RPC bridge