Documentation ¶
Index ¶
- func CollectReadQueryMetric(ctx context.Context, statement string, config formatter.FormatConfig, ...)
- func HealthHandler(w http.ResponseWriter, _ *http.Request)
- type Attribute
- type AttributeConfig
- type InfraController
- type Metadata
- type MetadataConfig
- type SQLRunner
- type SystemController
- func (c *SystemController) GetReceiptByTransactionHash(rw http.ResponseWriter, r *http.Request)
- func (c *SystemController) GetSchemaByTableName(rw http.ResponseWriter, r *http.Request)
- func (c *SystemController) GetTable(rw http.ResponseWriter, r *http.Request)
- func (c *SystemController) GetTablesByController(rw http.ResponseWriter, r *http.Request)
- func (c *SystemController) GetTablesByStructureHash(rw http.ResponseWriter, r *http.Request)
- type UserController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectReadQueryMetric ¶
func CollectReadQueryMetric(ctx context.Context, statement string, config formatter.FormatConfig, took time.Duration)
CollectReadQueryMetric collects read query metric. It is used for JSON-RPC service. When that is deleted we can make this private.
func HealthHandler ¶
func HealthHandler(w http.ResponseWriter, _ *http.Request)
HealthHandler serves health check requests.
Types ¶
type Attribute ¶
type Attribute struct { DisplayType string `json:"display_type,omitempty"` TraitType string `json:"trait_type"` Value interface{} `json:"value"` }
Attribute is a single entry in the "attributes" field of Metadata.
type AttributeConfig ¶
type AttributeConfig struct { Column string `query:"column"` DisplayType string `query:"display_type"` TraitType string `query:"trait_type"` }
AttributeConfig provides formatting for a column used to drive an Attribute when using format=erc721 query param.
type InfraController ¶
type InfraController struct{}
InfraController defines the HTTP handlers for infrastructure APIs.
func NewInfraController ¶
func NewInfraController() *InfraController
NewInfraController creates a new InfraController.
func (*InfraController) Version ¶
func (c *InfraController) Version(rw http.ResponseWriter, _ *http.Request)
Version returns git information of the running binary.
type Metadata ¶
type Metadata struct { Image interface{} `json:"image,omitempty"` ImageTransparent interface{} `json:"image_transparent,omitempty"` ImageData interface{} `json:"image_data,omitempty"` ExternalURL interface{} `json:"external_url,omitempty"` Description interface{} `json:"description,omitempty"` Name interface{} `json:"name,omitempty"` Attributes []Attribute `json:"attributes,omitempty"` BackgroundColor interface{} `json:"background_color,omitempty"` AnimationURL interface{} `json:"animation_url,omitempty"` YoutubeURL interface{} `json:"youtube_url,omitempty"` }
Metadata represents erc721 metadata. Ref: https://docs.opensea.io/docs/metadata-standards
type MetadataConfig ¶
type MetadataConfig struct { Image string `query:"image"` ImageTransparent string `query:"image_transparent"` ImageData string `query:"image_data"` ExternalURL string `query:"external_url"` Description string `query:"description"` Name string `query:"name"` Attributes []AttributeConfig `query:"attributes"` BackgroundColor string `query:"background_color"` AnimationURL string `query:"animation_url"` YoutubeURL string `query:"youtube_url"` }
MetadataConfig defines columns should be mapped to erc721 metadata when using format=erc721 query param.
type SQLRunner ¶
type SQLRunner interface {
RunReadQuery(ctx context.Context, stmt string) (*tableland.TableData, error)
}
SQLRunner defines the run SQL interface of Tableland.
type SystemController ¶
type SystemController struct {
// contains filtered or unexported fields
}
SystemController defines the HTTP handlers for interacting with system operations.
func NewSystemController ¶
func NewSystemController(svc system.SystemService) *SystemController
NewSystemController creates a new SystemController.
func (*SystemController) GetReceiptByTransactionHash ¶
func (c *SystemController) GetReceiptByTransactionHash(rw http.ResponseWriter, r *http.Request)
GetReceiptByTransactionHash handles request asking for a transaction receipt.
func (*SystemController) GetSchemaByTableName ¶
func (c *SystemController) GetSchemaByTableName(rw http.ResponseWriter, r *http.Request)
GetSchemaByTableName handles the GET /schema/{table_name} call. TODO(json-rpc): delete when droppping support.
func (*SystemController) GetTable ¶
func (c *SystemController) GetTable(rw http.ResponseWriter, r *http.Request)
GetTable handles the GET /chain/{chainID}/tables/{tableId} call.
func (*SystemController) GetTablesByController ¶
func (c *SystemController) GetTablesByController(rw http.ResponseWriter, r *http.Request)
GetTablesByController handles the GET /chain/{chainID}/tables/controller/{address} call. TODO(json-rpc): delete when dropping support.
func (*SystemController) GetTablesByStructureHash ¶
func (c *SystemController) GetTablesByStructureHash(rw http.ResponseWriter, r *http.Request)
GetTablesByStructureHash handles the GET /chain/{id}/tables/structure/{hash} call. TODO(json-rpc): delete when dropping support.
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
UserController defines the HTTP handlers for interacting with user tables.
func NewUserController ¶
func NewUserController(runner SQLRunner) *UserController
NewUserController creates a new UserController.
func (*UserController) GetTableQuery ¶
func (c *UserController) GetTableQuery(rw http.ResponseWriter, r *http.Request)
GetTableQuery handles the GET /query?s=[statement] call. Use mode=columns|rows|json|lines query param to control output format.
func (*UserController) GetTableRow ¶
func (c *UserController) GetTableRow(rw http.ResponseWriter, r *http.Request)
GetTableRow handles the GET /chain/{chainID}/tables/{id}/{key}/{value} call. Use format=erc721 query param to generate JSON for ERC721 metadata. TODO(json-rpc): delete method when dropping support.