irc

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IRC27SchemaURL = "https://raw.githubusercontent.com/iotaledger/tips/main/tips/TIP-0027/irc27.schema.json"
	IRC30SchemaURL = "https://raw.githubusercontent.com/iotaledger/tips/main/tips/TIP-0030/irc30.schema.json"
)
View Source
const (
	APIRoute = "/api/irc-metadata/v1"

	// ParameterNFTID is used to identify a NFT by its ID.
	ParameterNFTID = "nftID"

	// ParameterNativeTokenID is used to identify a native token by its ID.
	ParameterNativeTokenID = "tokenID"

	RouteIRC27 = "/nfts/:" + ParameterNFTID
	RouteIRC30 = "/tokens/:" + ParameterNativeTokenID
)

Variables

View Source
var (
	ErrLoadMetadataNotFound = errors.New("metadata not found")
	ErrLoadMetadataInvalid  = errors.New("invalid metadata")
)
View Source
var (
	Component *app.Component
)
View Source
var ParamsRestAPI = &ParametersRestAPI{}

Functions

This section is empty.

Types

type MetadataValidator

type MetadataValidator[K comparable] struct {
	// contains filtered or unexported fields
}

func NewMetadataValidator

func NewMetadataValidator[K comparable](schemaURL string, cacheSize int, parseKeyFunc func(c echo.Context) (K, error), loadValueFunc func(ctx context.Context, key K) ([]byte, error)) (*MetadataValidator[K], error)

func (*MetadataValidator[K]) HandleRequest

func (v *MetadataValidator[K]) HandleRequest(c echo.Context) error

type ParametersRestAPI

type ParametersRestAPI struct {
	// BindAddress defines the bind address on which the IRC-Metadata HTTP server listens.
	BindAddress string `default:"localhost:9687" usage:"the bind address on which the IRC-Metadata HTTP server listens"`

	// AdvertiseAddress defines the address of the IRC-Metadata HTTP server which is advertised to the INX Server (optional).
	AdvertiseAddress string `default:"" usage:"the address of the IRC-Metadata HTTP server which is advertised to the INX Server (optional)"`

	// DebugRequestLoggerEnabled defines whether the debug logging for requests should be enabled.
	DebugRequestLoggerEnabled bool `default:"false" usage:"whether the debug logging for requests should be enabled"`

	// MetadataCacheSize defines the size of the cache for each IRC standard.
	MetadataCacheSize int `default:"1000" usage:"defines the size of the cache for each IRC standard"`
}

ParametersRestAPI contains the definition of the parameters used by the IRC-Metadata HTTP server.

Jump to

Keyboard shortcuts

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