controllers

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT, Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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(gateway gateway.Gateway) *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) GetTable

func (c *Controller) GetTable(rw http.ResponseWriter, r *http.Request)

GetTable handles the GET /tables/{chainID}/{tableId} call.

func (*Controller) GetTableQuery

func (c *Controller) GetTableQuery(rw http.ResponseWriter, r *http.Request)

GetTableQuery handles the GET /query?statement=[statement] call. Use format=objects|table query param to control output format.

func (*Controller) PostTableQuery added in v1.10.0

func (c *Controller) PostTableQuery(rw http.ResponseWriter, r *http.Request)

PostTableQuery handles the POST /query call.

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.

Directories

Path Synopsis
* Tableland Validator - OpenAPI 3.0 * * In Tableland, Validators are the execution unit/actors of the protocol.
* Tableland Validator - OpenAPI 3.0 * * In Tableland, Validators are the execution unit/actors of the protocol.

Jump to

Keyboard shortcuts

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