metadata

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MetadataVersion = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type Docs

type Docs struct {
	Lines []string `json:"lines"`
}

type Field

type Field struct {
	Name string `json:"name"`
	Type string `json:"type"`
	Docs *Docs  `json:"docs,omitempty"`
}

type Function

type Function struct {
	Name       string       `json:"-"`
	Parameters []*Parameter `json:"parameters,omitempty"`
	Results    []*Result    `json:"results,omitempty"`
	Docs       *Docs        `json:"docs,omitempty"`
}

func (*Function) String

func (f *Function) String(m *Metadata) string

type FunctionMap

type FunctionMap map[string]*Function

func (*FunctionMap) SortedKeys

func (m *FunctionMap) SortedKeys() []string

type Metadata

type Metadata struct {
	Plugin    string      `json:"plugin"`
	Module    string      `json:"module"`
	SDK       string      `json:"sdk"`
	BuildId   string      `json:"buildId"`
	BuildTime string      `json:"buildTs"`
	GitRepo   string      `json:"gitRepo,omitempty"`
	GitCommit string      `json:"gitCommit,omitempty"`
	FnExports FunctionMap `json:"fnExports,omitempty"`
	FnImports FunctionMap `json:"fnImports,omitempty"`
	Types     TypeMap     `json:"types,omitempty"`
}

func NewMetadata

func NewMetadata() *Metadata

func (*Metadata) GetImports

func (m *Metadata) GetImports() map[string]string

type Parameter

type Parameter struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Default  *any   `json:"default,omitempty"`
	Optional bool   `json:"-"` // deprecated
}

type Result

type Result struct {
	Name string `json:"name,omitempty"`
	Type string `json:"type"`
}

type TypeDefinition

type TypeDefinition struct {
	Id     uint32   `json:"id"`
	Name   string   `json:"-"`
	Fields []*Field `json:"fields,omitempty"`
	Docs   *Docs    `json:"docs,omitempty"`
}

func (*TypeDefinition) String

func (t *TypeDefinition) String(m *Metadata) string

type TypeMap

type TypeMap map[string]*TypeDefinition

func (*TypeMap) SortedKeys

func (m *TypeMap) SortedKeys(mod string) []string

Jump to

Keyboard shortcuts

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