impl

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// SystemTablesPrefix is the prefix used in table names that
	// aren't owned by users, but the system.
	SystemTablesPrefix = "system_"

	// RegistryTableName is a special system table (not owned by user)
	// that has information about all tables owned by users.
	RegistryTableName = "registry"

	// 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

This section is empty.

Functions

func NewInstrumentedSystemSQLStoreService

func NewInstrumentedSystemSQLStoreService(system system.SystemService) (system.SystemService, error)

NewInstrumentedSystemSQLStoreService creates a new InstrumentedSystemSQLStoreService.

func NewSystemMockErrService

func NewSystemMockErrService() system.SystemService

NewSystemMockErrService creates a new SystemMockErrService.

func NewSystemMockService

func NewSystemMockService() system.SystemService

NewSystemMockService creates a new SystemMockService.

func NewSystemSQLStoreService

func NewSystemSQLStoreService(
	stores map[tableland.ChainID]sqlstore.SystemStore,
	extURLPrefix string,
	metadataRendererURI string,
	animationRendererURI string,
) (system.SystemService, error)

NewSystemSQLStoreService creates a new SystemSQLStoreService.

Types

type InstrumentedSystemSQLStoreService

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

InstrumentedSystemSQLStoreService implements the SystemService interface using SQLStore.

func (*InstrumentedSystemSQLStoreService) GetReceiptByTransactionHash

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

GetReceiptByTransactionHash implements system.SystemService.

func (*InstrumentedSystemSQLStoreService) GetSchemaByTableName

func (s *InstrumentedSystemSQLStoreService) GetSchemaByTableName(
	ctx context.Context,
	tableName string,
) (sqlstore.TableSchema, error)

GetSchemaByTableName returns the schema of a table by its name.

func (*InstrumentedSystemSQLStoreService) GetTableMetadata

GetTableMetadata returns table's metadata fetched from SQLStore.

func (*InstrumentedSystemSQLStoreService) GetTablesByController

func (s *InstrumentedSystemSQLStoreService) GetTablesByController(ctx context.Context,
	controller string,
) ([]sqlstore.Table, error)

GetTablesByController returns table's fetched from SQLStore by controller address.

func (*InstrumentedSystemSQLStoreService) GetTablesByStructure

func (s *InstrumentedSystemSQLStoreService) GetTablesByStructure(
	ctx context.Context,
	structure string,
) ([]sqlstore.Table, error)

GetTablesByStructure returns all tables that share the same structure.

type SystemMockErrService

type SystemMockErrService struct{}

SystemMockErrService is a dummy implementation that returns a fixed value.

func (*SystemMockErrService) GetReceiptByTransactionHash

func (*SystemMockErrService) GetReceiptByTransactionHash(context.Context, common.Hash) (sqlstore.Receipt, bool, error)

GetReceiptByTransactionHash implements system.SystemService.

func (*SystemMockErrService) GetSchemaByTableName

func (s *SystemMockErrService) GetSchemaByTableName(_ context.Context, _ string) (sqlstore.TableSchema, error)

GetSchemaByTableName returns the schema of a table by its name.

func (*SystemMockErrService) GetTableMetadata

GetTableMetadata returns a fixed value for testing and demo purposes.

func (*SystemMockErrService) GetTablesByController

func (s *SystemMockErrService) GetTablesByController(_ context.Context, _ string) ([]sqlstore.Table, error)

GetTablesByController returns table's fetched from SQLStore by controller address.

func (*SystemMockErrService) GetTablesByStructure

func (s *SystemMockErrService) GetTablesByStructure(_ context.Context, _ string) ([]sqlstore.Table, error)

GetTablesByStructure returns all tables that share the same structure.

type SystemMockService

type SystemMockService struct{}

SystemMockService is a dummy implementation that returns a fixed value.

func (*SystemMockService) GetReceiptByTransactionHash

func (*SystemMockService) GetReceiptByTransactionHash(context.Context, common.Hash) (sqlstore.Receipt, bool, error)

GetReceiptByTransactionHash implements system.SystemService.

func (*SystemMockService) GetSchemaByTableName

func (s *SystemMockService) GetSchemaByTableName(_ context.Context, _ string) (sqlstore.TableSchema, error)

GetSchemaByTableName returns the schema of a table by its name.

func (*SystemMockService) GetTableMetadata

GetTableMetadata returns a fixed value for testing and demo purposes.

func (*SystemMockService) GetTablesByController

func (s *SystemMockService) GetTablesByController(_ context.Context, _ string) ([]sqlstore.Table, error)

GetTablesByController returns table's fetched from SQLStore by controller address.

func (*SystemMockService) GetTablesByStructure

func (s *SystemMockService) GetTablesByStructure(_ context.Context, _ string) ([]sqlstore.Table, error)

GetTablesByStructure returns all tables that share the same structure.

type SystemSQLStoreService

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

SystemSQLStoreService implements the SystemService interface using SQLStore.

func (*SystemSQLStoreService) GetReceiptByTransactionHash

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

GetReceiptByTransactionHash returns a receipt by transaction hash.

func (*SystemSQLStoreService) GetSchemaByTableName

func (s *SystemSQLStoreService) GetSchemaByTableName(
	ctx context.Context,
	tableName string,
) (sqlstore.TableSchema, error)

GetSchemaByTableName returns the schema of a table by its name.

func (*SystemSQLStoreService) GetTableMetadata

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

GetTableMetadata returns table's metadata fetched from SQLStore.

func (*SystemSQLStoreService) GetTablesByController

func (s *SystemSQLStoreService) GetTablesByController(
	ctx context.Context,
	controller string,
) ([]sqlstore.Table, error)

GetTablesByController returns table's fetched from SQLStore by controller address.

func (*SystemSQLStoreService) GetTablesByStructure

func (s *SystemSQLStoreService) GetTablesByStructure(ctx context.Context, structure string) ([]sqlstore.Table, error)

GetTablesByStructure returns all tables that share the same structure.

Jump to

Keyboard shortcuts

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