extensionAPI

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const BUCKETFS_PATH_PREFIX = "/buckets/bfsdefault/default/"

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketFsContext

type BucketFsContext interface {
	ResolvePath(fileName string) string
}

type BucketFsUpload

type BucketFsUpload struct {
	Name             string `json:"name"`
	DownloadURL      string `json:"downloadUrl"`
	LicenseURL       string `json:"licenseUrl"`
	FileSize         int    `json:"fileSize"`
	BucketFsFilename string `json:"bucketFsFilename"`
}

type ExaMetadata

type ExaMetadata struct {
	AllScripts        ExaScriptTable         `json:"allScripts"`
	AllVirtualSchemas ExaVirtualSchemasTable `json:"allVirtualSchemas"`
}

type ExaMetadataReader

type ExaMetadataReader interface {
	ReadMetadataTables(tx *sql.Tx, schemaName string) (*ExaMetadata, error)
}

func CreateExaMetaDataReader

func CreateExaMetaDataReader() ExaMetadataReader

type ExaScriptRow

type ExaScriptRow struct {
	Schema     string `json:"schema"`
	Name       string `json:"name"`
	Type       string `json:"type"`
	InputType  string `json:"inputType"`
	ResultType string `json:"resultType"`
	Text       string `json:"text"`
	Comment    string `json:"comment"`
}

type ExaScriptTable

type ExaScriptTable struct {
	Rows []ExaScriptRow `json:"rows"`
}

type ExaVirtualSchemaRow

type ExaVirtualSchemaRow struct {
	Name                string `json:"name"`
	Owner               string `json:"owner"`
	AdapterScriptSchema string `json:"adapterScriptSchema"`
	AdapterScriptName   string `json:"adapterScriptName"`
	AdapterNotes        string `json:"adapterNotes"`
}

type ExaVirtualSchemasTable

type ExaVirtualSchemasTable struct {
	Rows []ExaVirtualSchemaRow `json:"rows"`
}

type ExtensionContext

type ExtensionContext struct {
	ExtensionSchemaName string          `json:"extensionSchemaName"`
	BucketFs            BucketFsContext `json:"bucketFs"`
	SqlClient           SimpleSQLClient `json:"sqlClient"`
}

func CreateContext

func CreateContext(ctx context.Context, extensionSchemaName string, tx *sql.Tx) *ExtensionContext

func CreateContextWithClient

func CreateContextWithClient(extensionSchemaName string, client SimpleSQLClient) *ExtensionContext

type JsExtInstallation

type JsExtInstallation struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type JsExtInstance

type JsExtInstance struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type JsExtension

type JsExtension struct {
	Id                  string
	Name                string
	Description         string
	InstallableVersions []JsExtensionVersion
	BucketFsUploads     []BucketFsUpload
	// contains filtered or unexported fields
}

func LoadExtension

func LoadExtension(id, content string) (*JsExtension, error)

LoadExtension loads an extension from the given file content.

[impl -> dsn~extension-definition~1]

func (*JsExtension) AddInstance

func (e *JsExtension) AddInstance(context *ExtensionContext, version string, params *ParameterValues) (instance *JsExtInstance, errorResult error)

func (*JsExtension) DeleteInstance

func (e *JsExtension) DeleteInstance(context *ExtensionContext, extensionVersion, instanceId string) (errorResult error)

func (*JsExtension) FindInstallations

func (e *JsExtension) FindInstallations(context *ExtensionContext, metadata *ExaMetadata) (installations []*JsExtInstallation, errorResult error)

func (*JsExtension) GetParameterDefinitions

func (e *JsExtension) GetParameterDefinitions(context *ExtensionContext, version string) (definitions []interface{}, errorResult error)

func (*JsExtension) Install

func (e *JsExtension) Install(context *ExtensionContext, version string) (errorResult error)

func (*JsExtension) ListInstances

func (e *JsExtension) ListInstances(context *ExtensionContext, version string) (instances []*JsExtInstance, errorResult error)

func (*JsExtension) Uninstall

func (e *JsExtension) Uninstall(context *ExtensionContext, version string) (errorResult error)

type JsExtensionVersion

type JsExtensionVersion struct {
	Name       string
	Latest     bool
	Deprecated bool
}

type ParameterValue

type ParameterValue struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type ParameterValues

type ParameterValues struct {
	Values []ParameterValue `json:"values"`
}

func (ParameterValues) Find

func (pv ParameterValues) Find(id string) (value ParameterValue, found bool)

Find returns the parameter with the given ID and true if the parameter exists or an empty parameter and false in case none exists.

type SimpleSQLClient

type SimpleSQLClient interface {
	// Execute runs a query that does not return rows, e.g. INSERT or UPDATE.
	Execute(query string, args ...any)

	// Query runs a query that returns rows, typically a SELECT.
	Query(query string, args ...any) backend.QueryResult
}

Extensions use this SQL client to execute queries.

Jump to

Keyboard shortcuts

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