ddl

package
v0.28.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EachFile

func EachFile(libdirs []string, cb func(name string, path string) (br bool))

EachFile calls cb with a path to every found data DDL, stops looking when br is true

Types

type DDL

type DDL struct {
	Schema   string                        `json:"$schema"`
	Metadata Metadata                      `json:"metadata"`
	Query    *common.InputItem             `json:"query"`
	Output   map[string]*common.OutputItem `json:"output"`

	SourceLocation string `json:"-"`

	sync.Mutex
}

func Find

func Find(plugin string, libdirs []string) (ddl *DDL, err error)

func New

func New(file string) (*DDL, error)

New creates a new DDL from a JSON file

func (*DDL) RenderConsole added in v0.22.0

func (d *DDL) RenderConsole() ([]byte, error)

RenderConsole create console appropriate output for data provider ddls

func (*DDL) RenderMarkdown added in v0.22.0

func (d *DDL) RenderMarkdown() ([]byte, error)

RenderMarkdown create markdown appropriate output for data provider ddls

func (*DDL) Timeout

func (d *DDL) Timeout() time.Duration

Timeout is the timeout for this data plugin

type FuncMap

type FuncMap map[string]FuncMapEntry

type FuncMapEntry

type FuncMapEntry struct {
	F    any
	Name string
	DDL  *DDL
}

type Metadata

type Metadata struct {
	License     string `json:"license"`
	Author      string `json:"author"`
	Timeout     int    `json:"timeout"`
	Name        string `json:"name"`
	Version     string `json:"version"`
	URL         string `json:"url"`
	Description string `json:"description"`
	Provider    string `json:"provider,omitempty"`
}

Metadata describes an agent at a high level and is required for any agent

Jump to

Keyboard shortcuts

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