Documentation ¶
Index ¶
- Variables
- type BoolData
- type Content
- type ContentElement
- type ContentEmpty
- type ContentMeta
- type ContentProvider
- type ContentProviders
- type ContentResult
- type ContentSection
- func (c *ContentSection) Add(content Content, loc *Location) error
- func (c *ContentSection) AsData() Data
- func (c *ContentSection) AsJQData() Data
- func (c *ContentSection) Compact()
- func (c *ContentSection) ID() uint32
- func (c *ContentSection) Meta() *ContentMeta
- func (c *ContentSection) Print() string
- type ConvListData
- type ConvMapData
- type ConvertableData
- type Data
- type DataSource
- type DataSources
- type InvocationOrder
- type ListData
- type Location
- type LocationEffect
- type MapData
- type NumberData
- type ProvideContentFunc
- type ProvideContentParams
- type RetrieveDataFunc
- type RetrieveDataParams
- type Schema
- type StringData
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrContentLocationNotFound = fmt.Errorf("content location not found")
Functions ¶
This section is empty.
Types ¶
type Content ¶
type Content interface { AsData() Data ID() uint32 AsJQData() Data Meta() *ContentMeta Print() string // contains filtered or unexported methods }
func ParseContentData ¶ added in v0.4.1
type ContentElement ¶ added in v0.4.1
type ContentElement struct { Markdown string // contains filtered or unexported fields }
func (*ContentElement) AsData ¶ added in v0.4.1
func (c *ContentElement) AsData() Data
func (*ContentElement) AsJQData ¶ added in v0.4.1
func (c *ContentElement) AsJQData() Data
func (*ContentElement) ID ¶ added in v0.4.1
func (c *ContentElement) ID() uint32
func (*ContentElement) Meta ¶ added in v0.4.1
func (c *ContentElement) Meta() *ContentMeta
func (*ContentElement) Print ¶ added in v0.4.1
func (c *ContentElement) Print() string
type ContentEmpty ¶ added in v0.4.1
type ContentEmpty struct {
// contains filtered or unexported fields
}
func (*ContentEmpty) AsData ¶ added in v0.4.1
func (n *ContentEmpty) AsData() Data
func (*ContentEmpty) AsJQData ¶ added in v0.4.1
func (n *ContentEmpty) AsJQData() Data
func (*ContentEmpty) ID ¶ added in v0.4.1
func (n *ContentEmpty) ID() uint32
func (*ContentEmpty) Meta ¶ added in v0.4.1
func (n *ContentEmpty) Meta() *ContentMeta
func (*ContentEmpty) Print ¶ added in v0.4.1
func (n *ContentEmpty) Print() string
type ContentMeta ¶ added in v0.4.1
func ParseContentMeta ¶ added in v0.4.1
func ParseContentMeta(data Data) *ContentMeta
func (*ContentMeta) AsData ¶ added in v0.4.1
func (meta *ContentMeta) AsData() Data
type ContentProvider ¶
type ContentProvider struct { ContentFunc ProvideContentFunc Args hcldec.Spec Config hcldec.Spec InvocationOrder InvocationOrder }
func (*ContentProvider) Execute ¶
func (cg *ContentProvider) Execute(ctx context.Context, params *ProvideContentParams) (*ContentResult, 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 ContentResult ¶ added in v0.4.1
type ContentSection ¶ added in v0.4.1
type ContentSection struct { Children []Content // contains filtered or unexported fields }
func (*ContentSection) Add ¶ added in v0.4.1
func (c *ContentSection) Add(content Content, loc *Location) error
Add content to the content tree.
func (*ContentSection) AsData ¶ added in v0.4.1
func (c *ContentSection) AsData() Data
AsData returns the content tree as a map.
func (*ContentSection) AsJQData ¶ added in v0.4.1
func (c *ContentSection) AsJQData() Data
func (*ContentSection) Compact ¶ added in v0.4.1
func (c *ContentSection) Compact()
Compact removes empty sections from the content tree.
func (*ContentSection) ID ¶ added in v0.4.1
func (c *ContentSection) ID() uint32
func (*ContentSection) Meta ¶ added in v0.4.1
func (c *ContentSection) Meta() *ContentMeta
func (*ContentSection) Print ¶ added in v0.4.1
func (c *ContentSection) Print() string
Print returns the content tree as a string.
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 UnmarshalJSONData ¶
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 InvocationOrder ¶ added in v0.4.1
type InvocationOrder int
const ( InvocationOrderUnspecified InvocationOrder = iota InvocationOrderBegin InvocationOrderEnd )
func (InvocationOrder) Weight ¶ added in v0.4.1
func (order InvocationOrder) Weight() int
type Location ¶ added in v0.4.1
type Location struct { Index uint32 Effect LocationEffect }
type LocationEffect ¶ added in v0.4.1
type LocationEffect int
const ( LocationEffectUnspecified LocationEffect = iota LocationEffectBefore LocationEffectAfter )
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) (*ContentResult, hcl.Diagnostics)
type ProvideContentParams ¶
type RetrieveDataFunc ¶
type RetrieveDataFunc func(ctx context.Context, params *RetrieveDataParams) (Data, hcl.Diagnostics)
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) (*ContentResult, hcl.Diagnostics)
func (*Schema) RetrieveData ¶
type StringData ¶
type StringData string
func (StringData) Any ¶
func (d StringData) Any() any
func (StringData) AsJQData ¶
func (d StringData) AsJQData() Data
Source Files ¶
Click to show internal directories.
Click to hide internal directories.