Documentation ¶
Index ¶
- func CollectReadQueryMetric(ctx context.Context, statement string, config formatter.FormatConfig, ...)
- func HealthHandler(w http.ResponseWriter, _ *http.Request)
- type Attribute
- type AttributeConfig
- type Controller
- func (c *Controller) GetReceiptByTransactionHash(rw http.ResponseWriter, r *http.Request)
- func (c *Controller) GetSchemaByTableName(rw http.ResponseWriter, r *http.Request)
- func (c *Controller) GetTable(rw http.ResponseWriter, r *http.Request)
- func (c *Controller) GetTableQuery(rw http.ResponseWriter, r *http.Request)
- func (c *Controller) GetTableRow(rw http.ResponseWriter, r *http.Request)
- func (c *Controller) GetTablesByController(rw http.ResponseWriter, r *http.Request)
- func (c *Controller) GetTablesByStructureHash(rw http.ResponseWriter, r *http.Request)
- func (c *Controller) Version(rw http.ResponseWriter, _ *http.Request)
- type Metadata
- type MetadataConfig
- type SQLRunner
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 Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller defines the HTTP handlers for interacting with user tables.
func NewController ¶
func NewController(runner SQLRunner, svc system.SystemService) *Controller
NewController creates a new Controller.
func (*Controller) GetReceiptByTransactionHash ¶
func (c *Controller) GetReceiptByTransactionHash(rw http.ResponseWriter, r *http.Request)
GetReceiptByTransactionHash handles request asking for a transaction receipt.
func (*Controller) GetSchemaByTableName ¶
func (c *Controller) GetSchemaByTableName(rw http.ResponseWriter, r *http.Request)
GetSchemaByTableName handles the GET /schema/{table_name} call. TODO(json-rpc): delete when droppping support.
func (*Controller) GetTable ¶
func (c *Controller) GetTable(rw http.ResponseWriter, r *http.Request)
GetTable handles the GET /chain/{chainID}/tables/{tableId} call.
func (*Controller) GetTableQuery ¶
func (c *Controller) 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 (*Controller) GetTableRow ¶
func (c *Controller) 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.
func (*Controller) GetTablesByController ¶
func (c *Controller) 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 (*Controller) GetTablesByStructureHash ¶
func (c *Controller) GetTablesByStructureHash(rw http.ResponseWriter, r *http.Request)
GetTablesByStructureHash handles the GET /chain/{id}/tables/structure/{hash} call. TODO(json-rpc): delete when dropping support.
func (*Controller) Version ¶
func (c *Controller) 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.