plugin

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolData

type BoolData bool

func (BoolData) Any

func (d BoolData) Any() any

func (BoolData) AsJQData

func (d BoolData) AsJQData() Data

type Content

type Content struct {
	Markdown string
}

type ContentProvider

type ContentProvider struct {
	ContentFunc ProvideContentFunc
	Args        hcldec.Spec
	Config      hcldec.Spec
}

func (*ContentProvider) Execute

func (cg *ContentProvider) Execute(ctx context.Context, params *ProvideContentParams) (*Content, hcl.Diagnostics)

func (*ContentProvider) Validate

func (cg *ContentProvider) Validate() hcl.Diagnostics

type ContentProviders

type ContentProviders map[string]*ContentProvider

func (ContentProviders) Validate

func (cp ContentProviders) Validate() hcl.Diagnostics

type ConvListData

type ConvListData []ConvertableData

func (ConvListData) Any

func (d ConvListData) Any() any

func (ConvListData) AsJQData

func (d ConvListData) AsJQData() Data

type ConvMapData

type ConvMapData map[string]ConvertableData

func (ConvMapData) Any

func (d ConvMapData) Any() any

func (ConvMapData) AsJQData

func (d ConvMapData) AsJQData() Data

type ConvertableData

type ConvertableData interface {
	AsJQData() Data
}

type Data

type Data interface {
	Any() any

	ConvertableData
	// contains filtered or unexported methods
}

func ParseDataAny

func ParseDataAny(v any) (Data, error)

func UnmarshalJSONData

func UnmarshalJSONData(data []byte) (Data, error)

type DataSource

type DataSource struct {
	DataFunc RetrieveDataFunc
	Args     hcldec.Spec
	Config   hcldec.Spec
}

func (*DataSource) Execute

func (ds *DataSource) Execute(ctx context.Context, params *RetrieveDataParams) (Data, hcl.Diagnostics)

func (*DataSource) Validate

func (ds *DataSource) Validate() hcl.Diagnostics

type DataSources

type DataSources map[string]*DataSource

func (DataSources) Validate

func (ds DataSources) Validate() hcl.Diagnostics

type ListData

type ListData []Data

func (ListData) Any

func (d ListData) Any() any

func (ListData) AsJQData

func (d ListData) AsJQData() Data

type MapData

type MapData map[string]Data

func ParseDataMapAny

func ParseDataMapAny(v map[string]any) (MapData, error)

func (MapData) Any

func (d MapData) Any() any

func (MapData) AsJQData

func (d MapData) AsJQData() Data

type NumberData

type NumberData float64

func (NumberData) Any

func (d NumberData) Any() any

func (NumberData) AsJQData

func (d NumberData) AsJQData() Data

type ProvideContentFunc

type ProvideContentFunc func(ctx context.Context, params *ProvideContentParams) (*Content, hcl.Diagnostics)

type ProvideContentParams

type ProvideContentParams struct {
	Config      cty.Value
	Args        cty.Value
	DataContext MapData
}

type RetrieveDataFunc

type RetrieveDataFunc func(ctx context.Context, params *RetrieveDataParams) (Data, hcl.Diagnostics)

type RetrieveDataParams

type RetrieveDataParams struct {
	Config cty.Value
	Args   cty.Value
}

type Schema

type Schema struct {
	Name             string
	Version          string
	DataSources      DataSources
	ContentProviders ContentProviders
}

func (*Schema) ProvideContent

func (p *Schema) ProvideContent(ctx context.Context, name string, params *ProvideContentParams) (*Content, hcl.Diagnostics)

func (*Schema) RetrieveData

func (p *Schema) RetrieveData(ctx context.Context, name string, params *RetrieveDataParams) (Data, hcl.Diagnostics)

func (*Schema) Validate

func (p *Schema) Validate() hcl.Diagnostics

type StringData

type StringData string

func (StringData) Any

func (d StringData) Any() any

func (StringData) AsJQData

func (d StringData) AsJQData() Data

Directories

Path Synopsis
pluginapi
v1

Jump to

Keyboard shortcuts

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