gateway

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT, Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultMetadataImage is the default image for table's metadata.
	DefaultMetadataImage = "https://bafkreifhuhrjhzbj4onqgbrmhpysk2mop2jimvdvfut6taiyzt2yqzt43a.ipfs.dweb.link"

	// DefaultAnimationURL is an empty string. It means that the attribute will not appear in the JSON metadata.
	DefaultAnimationURL = ""
)

Variables

View Source
var ErrTableNotFound = errors.New("table not found")

ErrTableNotFound indicates that the table doesn't exist.

Functions

This section is empty.

Types

type Gateway

type Gateway interface {
	RunReadQuery(ctx context.Context, stmt string) (*tableland.TableData, error)
	GetTableMetadata(context.Context, tables.TableID) (sqlstore.TableMetadata, error)
	GetReceiptByTransactionHash(context.Context, common.Hash) (sqlstore.Receipt, bool, error)
}

Gateway defines the gateway operations.

func NewGateway

func NewGateway(
	parser parsing.SQLValidator,
	stores map[tableland.ChainID]sqlstore.SystemStore,
	extURLPrefix string,
	metadataRendererURI string,
	animationRendererURI string,
) (Gateway, error)

NewGateway creates a new gateway service.

func NewInstrumentedGateway

func NewInstrumentedGateway(gateway Gateway) (Gateway, error)

NewInstrumentedGateway creates a new InstrumentedGateway.

type GatewayService

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

GatewayService implements the Gateway interface using SQLStore.

func (*GatewayService) GetReceiptByTransactionHash

func (g *GatewayService) GetReceiptByTransactionHash(
	ctx context.Context,
	txnHash common.Hash,
) (sqlstore.Receipt, bool, error)

GetReceiptByTransactionHash returns a receipt by transaction hash.

func (*GatewayService) GetTableMetadata

func (g *GatewayService) GetTableMetadata(ctx context.Context, id tables.TableID) (sqlstore.TableMetadata, error)

GetTableMetadata returns table's metadata fetched from SQLStore.

func (*GatewayService) RunReadQuery

func (g *GatewayService) RunReadQuery(ctx context.Context, statement string) (*tableland.TableData, error)

RunReadQuery allows the user to run SQL.

type InstrumentedGateway

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

InstrumentedGateway implements the Gateway interface using SQLStore.

func (*InstrumentedGateway) GetReceiptByTransactionHash

func (g *InstrumentedGateway) GetReceiptByTransactionHash(
	ctx context.Context,
	hash common.Hash,
) (sqlstore.Receipt, bool, error)

GetReceiptByTransactionHash implements system.SystemService.

func (*InstrumentedGateway) GetTableMetadata

func (g *InstrumentedGateway) GetTableMetadata(
	ctx context.Context,
	id tables.TableID,
) (sqlstore.TableMetadata, error)

GetTableMetadata returns table's metadata fetched from SQLStore.

func (*InstrumentedGateway) RunReadQuery

func (g *InstrumentedGateway) RunReadQuery(ctx context.Context, statement string) (*tableland.TableData, error)

RunReadQuery allows the user to run SQL.

Jump to

Keyboard shortcuts

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