Documentation ¶
Index ¶
- Constants
- Variables
- type Field
- type Function
- type FunctionMap
- type Metadata
- func (m *Metadata) GetExportedFunctions() []*Function
- func (m *Metadata) GetTypeDefinition(typ string) (*TypeDefinition, error)
- func (m *Metadata) Name() string
- func (m *Metadata) NameAndVersion() (name string, version string)
- func (m *Metadata) SdkName() string
- func (m *Metadata) SdkNameAndVersion() (name string, version string)
- func (m *Metadata) SdkVersion() string
- func (m *Metadata) Version() string
- type Parameter
- type Result
- type TypeDefinition
- type TypeMap
Constants ¶
View Source
const MetadataVersion = 2
Variables ¶
View Source
var ErrMetadataNotFound = fmt.Errorf("no metadata found in plugin")
Functions ¶
This section is empty.
Types ¶
type Function ¶
type Function struct { Name string `json:"-"` Parameters []*Parameter `json:"parameters,omitempty"` Results []*Result `json:"results,omitempty"` }
func NewFunction ¶
func (*Function) WithNamedResult ¶
func (*Function) WithParameter ¶
func (*Function) WithResult ¶
type FunctionMap ¶
func (*FunctionMap) AddFunction ¶
func (m *FunctionMap) AddFunction(name string) *Function
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 GetMetadataFromCompiledModule ¶
func GetMetadataFromCompiledModule(cm wazero.CompiledModule) (*Metadata, error)
func NewPluginMetadata ¶
func NewPluginMetadata() *Metadata
func (*Metadata) GetExportedFunctions ¶
func (*Metadata) GetTypeDefinition ¶
func (m *Metadata) GetTypeDefinition(typ string) (*TypeDefinition, error)
func (*Metadata) NameAndVersion ¶
func (*Metadata) SdkNameAndVersion ¶
func (*Metadata) SdkVersion ¶
type Parameter ¶
type Parameter struct { Name string `json:"name"` Type string `json:"type"` Default *any `json:"default,omitempty"` }
func (*Parameter) UnmarshalJSON ¶
type TypeDefinition ¶
type TypeDefinition struct { Name string `json:"-"` Id uint32 `json:"id,omitempty"` Fields []*Field `json:"fields,omitempty"` }
func (*TypeDefinition) WithField ¶
func (t *TypeDefinition) WithField(name string, typ string) *TypeDefinition
func (*TypeDefinition) WithId ¶
func (t *TypeDefinition) WithId(id uint32) *TypeDefinition
type TypeMap ¶
type TypeMap map[string]*TypeDefinition
func (*TypeMap) AddType ¶
func (m *TypeMap) AddType(name string) *TypeDefinition
Click to show internal directories.
Click to hide internal directories.