metadata

package
v0.0.0-...-fd63c1f Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeInvalid = iota
	EventTypeUpdate
	EventTypeMerge
	EventTypeRemove
	EventTypeResolve
)
View Source
const (
	NsDomain = "tzdomain"
)
View Source
const (
	NsProfile = "tzprofile"
)

Variables

This section is empty.

Functions

func ListSchemas

func ListSchemas() []string

func LoadExtensions

func LoadExtensions() error

func LoadSchema

func LoadSchema(name string, buf []byte, tpl interface{})

func RegisterDecoder

func RegisterDecoder(h uint64, fn NewDecoderFunc)

func RegisterSchema

func RegisterSchema(s Schema)

Types

type Alias

type Alias struct {
	Name        string   `json:"name"`
	Kind        string   `json:"kind"`
	Description string   `json:"description,omitempty"`
	Category    string   `json:"category,omitempty"`
	Tags        []string `json:"tags,omitempty"`
}

func (Alias) Namespace

func (d Alias) Namespace() string

func (Alias) Validate

func (d Alias) Validate() error

type Asset

type Asset struct {
	Standard string           `json:"standard,omitempty"`
	Tokens   map[string]Token `json:"tokens,omitempty"`
	Version  string           `json:"version,omitempty"`
	Homepage string           `json:"homepage,omitempty"`
}

func (Asset) Namespace

func (d Asset) Namespace() string

func (Asset) Validate

func (d Asset) Validate() error

type Baker

type Baker struct {
	Status         BakerStatus `json:"status,omitempty"`
	Fee            float64     `json:"fee,omitempty"`
	PayoutDelay    bool        `json:"payout_delay,omitempty"`
	MinPayout      float64     `json:"min_payout,omitempty"`
	MinDelegation  float64     `json:"min_delegation,omitempty"`
	NonDelegatable bool        `json:"non_delegatable,omitempty"`
	IsSponsored    bool        `json:"sponsored,omitempty"`
}

func (Baker) Namespace

func (d Baker) Namespace() string

func (Baker) Validate

func (d Baker) Validate() error

type BakerStatus

type BakerStatus string
const (
	BakerStatusInvalid BakerStatus = ""
	BakerStatusPublic  BakerStatus = "public"
	BakerStatusPrivate BakerStatus = "private"
	BakerStatusClosing BakerStatus = "closing"
	BakerStatusClosed  BakerStatus = "closed"
)

func ParseBakerStatus

func ParseBakerStatus(s string) BakerStatus

func (BakerStatus) IsValid

func (s BakerStatus) IsValid() bool

func (*BakerStatus) UnmarshalText

func (s *BakerStatus) UnmarshalText(data []byte) error

type Decoder

type Decoder interface {
	OnOperation(context.Context, *model.Op) ([]*Event, error)
	OnTaskComplete(context.Context, *model.Metadata, *task.TaskResult) ([]*Event, error)
	Namespace() string
}

func LookupDecoder

func LookupDecoder(h uint64) (dec Decoder, ok bool)

type Descriptor

type Descriptor interface {
	// Returns the schema's unique namespace which is used as value prefix.
	Namespace() string

	// Validates descriptor against built-in schema and returns an error when
	// validation fails.
	Validate() error
}

type Event

type Event struct {
	Owner tezos.Address
	Type  EventType
	Flags int64
	Data  any
}

type EventType

type EventType byte

func ParseEventType

func ParseEventType(s string) EventType

func (EventType) IsValid

func (t EventType) IsValid() bool

func (EventType) MarshalText

func (t EventType) MarshalText() ([]byte, error)

func (EventType) String

func (e EventType) String() string

func (*EventType) UnmarshalText

func (t *EventType) UnmarshalText(data []byte) error

type Location

type Location struct {
	Country   iso.Country      `json:"country,omitempty"`
	City      iata.AirportCode `json:"city,omitempty"`
	Latitude  float64          `json:"lon,omitempty"`
	Longitude float64          `json:"lat,omitempty"`
	Altitude  float64          `json:"alt,omitempty"`
}

func (Location) Namespace

func (d Location) Namespace() string

func (Location) Validate

func (d Location) Validate() error

type NewDecoderFunc

type NewDecoderFunc func(uint64) Decoder

type Payout

type Payout []tezos.Address

reference to baker

func (Payout) Namespace

func (d Payout) Namespace() string

func (Payout) Validate

func (d Payout) Validate() error

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (Registry) Get

func (r Registry) Get(name string) (Schema, bool)

func (Registry) ListSchemas

func (r Registry) ListSchemas() []string

func (*Registry) Register

func (r *Registry) Register(s Schema)

type Schema

type Schema interface {
	// Returns the schema's unique namespace which is used as value prefix.
	Namespace() string

	// Validates JSON encoded data against built-in schema and returns
	// an error when validation fails.
	ValidateBytes([]byte) error

	// Validates a Go type against built-in schema and returns an error when
	// validation fails.
	Validate(interface{}) error

	// Creates a schema-compatible descriptor as Go type
	NewDescriptor() Descriptor
}

func GetSchema

func GetSchema(name string) (Schema, bool)

func NewSchema

func NewSchema(name string, data []byte, tpl interface{}) (Schema, error)

type Social

type Social struct {
	Twitter   string `json:"twitter,omitempty"`
	Instagram string `json:"instagram,omitempty"`
	Reddit    string `json:"reddit,omitempty"`
	Github    string `json:"github,omitempty"`
	Website   string `json:"website,omitempty"`
}

func (Social) Namespace

func (d Social) Namespace() string

func (Social) Validate

func (d Social) Validate() error

type TezosDomains

type TezosDomains struct {
	Name string `json:"name"`
}

func (TezosDomains) Namespace

func (d TezosDomains) Namespace() string

func (TezosDomains) Validate

func (d TezosDomains) Validate() error

type TezosProfile

type TezosProfile struct {
	Alias       string `json:"alias,omitempty"`
	Description string `json:"description,omitempty"`
	Website     string `json:"website,omitempty"`
	Twitter     string `json:"twitter,omitempty"`
	Ethereum    string `json:"ethereum,omitempty"`
	DomainName  string `json:"domain_name,omitempty"`
	Discord     string `json:"discord,omitempty"`
	Github      string `json:"github,omitempty"`
	Serial      uint64 `json:"serial,omitempty"`
}

func (TezosProfile) Namespace

func (d TezosProfile) Namespace() string

func (TezosProfile) Validate

func (d TezosProfile) Validate() error

type Token

type Token struct {
	Name     string `json:"name"`
	Symbol   string `json:"symbol"`
	Decimals int    `json:"decimals"`
}

fungible and non-fungible assets

type Tz16

type Tz16 struct {
	Name        string       `json:"name"`
	Description string       `json:"description,omitempty"`
	Version     string       `json:"version,omitempty"`
	License     *Tz16License `json:"license,omitempty"`
	Authors     []string     `json:"authors,omitempty"`
	Homepage    string       `json:"homepage,omitempty"`
	Source      *Tz16Source  `json:"source,omitempty"`
	Interfaces  []string     `json:"interfaces,omitempty"`
	Errors      []Tz16Error  `json:"errors,omitempty"`
	Views       []Tz16View   `json:"views,omitempty"`
}

func (Tz16) Namespace

func (d Tz16) Namespace() string

func (Tz16) Validate

func (d Tz16) Validate() error

type Tz16Error

type Tz16Error struct {
	Error     *micheline.Prim `json:"error,omitempty"`
	Expansion *micheline.Prim `json:"expansion,omitempty"`
	Languages []string        `json:"languages,omitempty"`
	View      string          `json:"view,omitempty"`
}

type Tz16License

type Tz16License struct {
	Name    string `json:"name"`
	Details string `json:"details,omitempty"`
}

type Tz16Source

type Tz16Source struct {
	Tools    []string `json:"tools"`
	Location string   `json:"location,omitempty"`
}

type Tz16View

type Tz16View struct {
	Name            string        `json:"name"`
	Description     string        `json:"description,omitempty"`
	Pure            bool          `json:"pure,omitempty"`
	Implementations []interface{} `json:"implementations,omitempty"`
}

type Tz21

type Tz21 struct {
	Tz21Asset
}

func (Tz21) Namespace

func (d Tz21) Namespace() string

func (Tz21) Validate

func (d Tz21) Validate() error

type Tz21Asset

type Tz21Asset struct {
	Description        string          `json:"description"`
	Minter             tezos.Address   `json:"minter"`
	Creators           []string        `json:"creators"`
	Contributors       []string        `json:"contributors"`
	Publishers         []string        `json:"publishers"`
	Date               time.Time       `json:"date"`
	BlockLevel         int64           `json:"blockLevel"`
	Type               string          `json:"type"`
	Tags               []string        `json:"tags"`
	Genres             []string        `json:"genres"`
	Language           string          `json:"language"`
	Identifier         string          `json:"identifier"`
	Rights             string          `json:"rights"`
	RightUri           string          `json:"rightUri"`
	ArtifactUri        string          `json:"artifactUri"`
	DisplayUri         string          `json:"displayUri"`
	ThumbnailUri       string          `json:"thumbnailUri"`
	ExternalUri        string          `json:"externalUri"`
	IsTransferable     bool            `json:"isTransferable"`
	IsBooleanAmount    bool            `json:"isBooleanAmount"`
	ShouldPreferSymbol bool            `json:"shouldPreferSymbol"`
	Formats            []Tz21Format    `json:"formats"`
	Attributes         []Tz21Attribute `json:"attributes"`
	Assets             []Tz21Asset     `json:"assets"`
}

type Tz21Attribute

type Tz21Attribute struct {
	Name  string `json:"name"`
	Value string `json:"value"`
	Type  string `json:"type,omitempty"`
}

type Tz21DataRate

type Tz21DataRate struct {
	Value string `json:"value"`
	Unit  string `json:"unit"`
}

type Tz21Dimension

type Tz21Dimension struct {
	Value string `json:"value"`
	Unit  string `json:"unit"`
}

type Tz21Format

type Tz21Format struct {
	Uri        string        `json:"uri"`
	Hash       string        `json:"hash"`
	MimeType   string        `json:"mimeType"`
	FileSize   int64         `json:"fileSize"`
	FileName   string        `json:"fileName"`
	Duration   string        `json:"duration"`
	Dimensions Tz21Dimension `json:"dimensions"`
	DataRate   Tz21DataRate  `json:"dataRate"`
}

type Updated

type Updated struct {
	Hash   tezos.BlockHash `json:"hash"`
	Height int64           `json:"height"`
	Time   time.Time       `json:"time"`
}

func (Updated) Namespace

func (d Updated) Namespace() string

func (Updated) Validate

func (d Updated) Validate() error

Directories

Path Synopsis
decoder

Jump to

Keyboard shortcuts

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