Documentation ¶
Index ¶
- Constants
- Variables
- type ChainHttpClient
- type EthHttpClient
- func (c *EthHttpClient) FetchFactoryLog(ctx context.Context, address common.Address, startHeight uint64, ...) (events []*factory.FactoryNFTCreated, nextStart uint64, err error)
- func (c *EthHttpClient) FetchNFTInfo(ctx context.Context, d *data.NFTContract) (err error)
- func (c *EthHttpClient) FetchTransferLog(ctx context.Context, address common.Address, startHeight uint64, ...) (events []*ierc721.ContractTransfer, nextStart uint64, err error)
- func (c *EthHttpClient) GetTokenMeta(ctx context.Context, d *data.Token) (err error)
- func (c *EthHttpClient) WatchFactoryLog(ctx context.Context, address common.Address, ...) error
- func (c *EthHttpClient) WatchTransferLog(ctx context.Context, addresses []common.Address, ...) error
- type ImageDownloadClient
- type LocalImageDownloadClient
- type MockChainClient
- func (c *MockChainClient) EmitErr(err error)
- func (c *MockChainClient) FetchFactoryLog(ctx context.Context, address common.Address, startHeight uint64, ...) (events []*factory.FactoryNFTCreated, nextStart uint64, err error)
- func (c *MockChainClient) FetchNFTInfo(ctx context.Context, d *data.NFTContract) (err error)
- func (c *MockChainClient) FetchTransferLog(ctx context.Context, address common.Address, startHeight uint64, ...) (events []*ierc721.ContractTransfer, nextStart uint64, err error)
- func (c *MockChainClient) GetTokenMeta(ctx context.Context, d *data.Token) (err error)
- func (c *MockChainClient) WatchFactoryLog(ctx context.Context, address common.Address, ...) error
- func (c *MockChainClient) WatchTransferLog(ctx context.Context, addresses []common.Address, ...) error
- type MockImageClient
Constants ¶
View Source
const ( DefaultCacheSize = 64 DefaultCacheTTL = 60 * 60 * 24 // 1day MaxRetrivalLogs = 256 )
View Source
const ( LocalImageDownloadClientTimeout = int64(20) // 20s DefaultBaseDownloadLocation = "./static" DefaultBaseImageURL = "http://127.0.0.1:3000/image" CommonTag = "common" )
Variables ¶
View Source
var ( ErrImageNotFound = errors.New("err image not found") ErrImageAlreadyExists = errors.New("err image already exists") )
View Source
var (
ErrConnectRefused = errors.New("connection endppint refused")
)
Functions ¶
This section is empty.
Types ¶
type ChainHttpClient ¶
type ChainHttpClient interface { FetchTransferLog(ctx context.Context, address common.Address, startHeight uint64, endHeight *uint64) (events []*ierc721.ContractTransfer, nextStart uint64, err error) FetchFactoryLog(ctx context.Context, address common.Address, startHeight uint64, endHeight *uint64) (events []*factory.FactoryNFTCreated, nextStart uint64, err error) WatchTransferLog(ctx context.Context, addresses []common.Address, callback func(*ierc721.ContractTransfer) error) error WatchFactoryLog(ctx context.Context, address common.Address, callback func(*factory.FactoryNFTCreated) error) error FetchNFTInfo(ctx context.Context, d *data.NFTContract) (err error) GetTokenMeta(ctx context.Context, d *data.Token) (err error) }
type EthHttpClient ¶
type EthHttpClient struct {
// contains filtered or unexported fields
}
TODO: add delay of calling rpc
func NewChainClient ¶
func (*EthHttpClient) FetchFactoryLog ¶
func (*EthHttpClient) FetchNFTInfo ¶
func (c *EthHttpClient) FetchNFTInfo(ctx context.Context, d *data.NFTContract) (err error)
func (*EthHttpClient) FetchTransferLog ¶
func (*EthHttpClient) GetTokenMeta ¶
func (*EthHttpClient) WatchFactoryLog ¶
func (c *EthHttpClient) WatchFactoryLog(ctx context.Context, address common.Address, callback func(*factory.FactoryNFTCreated) error) error
func (*EthHttpClient) WatchTransferLog ¶
func (c *EthHttpClient) WatchTransferLog(ctx context.Context, addresses []common.Address, callback func(*ierc721.ContractTransfer) error) error
type ImageDownloadClient ¶
type LocalImageDownloadClient ¶
type LocalImageDownloadClient struct {
// contains filtered or unexported fields
}
func NewLocalImageDownloadClient ¶
func NewLocalImageDownloadClient(ctx context.Context, baseDownloadLocation, baseImageURL string) (c LocalImageDownloadClient, err error)
type MockChainClient ¶
TODO: add delay of calling rpc
func NewMockChainClient ¶
func NewMockChainClient(fe []*factory.FactoryNFTCreated, te []*ierc721.ContractTransfer, endHeight *uint64, delay int) (c MockChainClient)
func (*MockChainClient) EmitErr ¶
func (c *MockChainClient) EmitErr(err error)
func (*MockChainClient) FetchFactoryLog ¶
func (*MockChainClient) FetchNFTInfo ¶
func (c *MockChainClient) FetchNFTInfo(ctx context.Context, d *data.NFTContract) (err error)
func (*MockChainClient) FetchTransferLog ¶
func (*MockChainClient) GetTokenMeta ¶
func (*MockChainClient) WatchFactoryLog ¶
func (c *MockChainClient) WatchFactoryLog(ctx context.Context, address common.Address, callback func(*factory.FactoryNFTCreated) error) error
func (*MockChainClient) WatchTransferLog ¶
func (c *MockChainClient) WatchTransferLog(ctx context.Context, addresses []common.Address, callback func(*ierc721.ContractTransfer) error) error
type MockImageClient ¶
func NewMockImageClient ¶
func NewMockImageClient(URLToFilename map[string]string) (c MockImageClient)
Click to show internal directories.
Click to hide internal directories.