plugin

package
v0.22.6 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Prefix     = "optimus-plugin-"
	Suffix     = ".yaml"
	PluginsDir = ".plugins"
)

Variables

View Source
var ErrNoSuchSpec = errors.New("spec not found")
View Source
var ErrUnsupportedPlugin = errors.New("unsupported plugin requested, make sure its correctly installed")

Functions

This section is empty.

Types

type Assets added in v0.10.2

type Assets map[string]string

type Entrypoint added in v0.20.7

type Entrypoint struct {
	Shell string `yaml:"shell,omitempty"`
	// Setup  string `yaml:"setup,omitempty"`
	Script string `yaml:"script,omitempty"`
}

type Evaluator added in v0.20.7

type Evaluator struct {
	Env      string `yaml:"env,omitempty"`
	FilePath string `yaml:"filepath,omitempty"`
	Selector string `yaml:"selector,omitempty"`
}

type EvaluatorFactory added in v0.10.2

type EvaluatorFactory interface {
	GetFileEvaluator(filepath string) (evaluator.Evaluator, error)
	GetYamlPathEvaluator(filepath, selector string) (evaluator.Evaluator, error)
	GetEnvEvaluator(env string) (evaluator.Evaluator, error)
}

type ParserType added in v0.20.7

type ParserType string
const (
	BQParser         ParserType = "bq"
	MaxcomputeParser ParserType = "maxcompute"

	DefaultVersion = "default"
)

type PluginGetter added in v0.10.2

type PluginGetter interface {
	GetByName(name string) (*Spec, error)
}

type PluginService added in v0.10.2

type PluginService struct {
	// contains filtered or unexported fields
}

func NewPluginService added in v0.10.2

func NewPluginService(logger log.Logger, pluginGetter PluginGetter, upstreamIdentifierFactory UpstreamIdentifierFactory, evaluatorFactory EvaluatorFactory) (*PluginService, error)

func (PluginService) ConstructDestinationURN added in v0.10.2

func (s PluginService) ConstructDestinationURN(_ context.Context, taskName string, compiledConfig map[string]string) (resource.URN, error)

func (PluginService) IdentifyUpstreams added in v0.10.2

func (s PluginService) IdentifyUpstreams(ctx context.Context, taskName string, compiledConfig, assets map[string]string) ([]resource.URN, error)

func (PluginService) Info added in v0.10.2

func (s PluginService) Info(_ context.Context, taskName string) (*Spec, error)

type Spec added in v0.20.7

type Spec struct {
	SpecVersion int    `yaml:"version"`
	Name        string `yaml:"name"`
	Description string `yaml:"description"`

	DestinationURNTemplate string `yaml:"destination_urn_template,omitempty"`

	AssetParsers  map[ParserType][]Evaluator `yaml:"asset_parsers,omitempty"`
	PluginVersion map[string]VersionDetails  `yaml:"plugin_versions,omitempty"`
	DefaultConfig map[string]string          `yaml:"default_config,omitempty"`
}

func Load added in v0.20.7

func Load(pluginPath string) (*Spec, error)

func (*Spec) GetEntrypoint added in v0.20.7

func (s *Spec) GetEntrypoint(version string) (Entrypoint, error)

func (*Spec) GetImage added in v0.20.7

func (s *Spec) GetImage(version string) (string, error)

func (*Spec) Validate added in v0.20.7

func (s *Spec) Validate() error

type Store added in v0.20.7

type Store struct {
	// contains filtered or unexported fields
}

func InitStore added in v0.20.7

func InitStore(pluginPaths []string, l log.Logger) (*Store, error)

func LoadPluginToStore added in v0.20.7

func LoadPluginToStore(l log.Logger, location string) (*Store, error)

func NewPluginStore added in v0.20.7

func NewPluginStore() *Store

func (*Store) Add added in v0.20.7

func (s *Store) Add(pluginSpec *Spec) error

func (*Store) All added in v0.20.7

func (s *Store) All(yield func(spec *Spec) bool)

func (*Store) GetByName added in v0.20.7

func (s *Store) GetByName(name string) (*Spec, error)

type UpstreamIdentifierFactory added in v0.10.2

type UpstreamIdentifierFactory interface {
	GetBQUpstreamIdentifier(ctx context.Context, svcAcc string, evaluators ...evaluator.Evaluator) (upstreamidentifier.UpstreamIdentifier, error)
	GetMaxcomputeUpstreamIdentifier(ctx context.Context, svcAcc string, evaluators ...evaluator.Evaluator) (upstreamidentifier.UpstreamIdentifier, error)
}

type VersionDetails added in v0.20.7

type VersionDetails struct {
	Image      string     `yaml:"image,omitempty"`
	Tag        string     `yaml:"tag,omitempty"`
	Entrypoint Entrypoint `yaml:"entrypoint,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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