store

package
v0.29.0-beta Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 51 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrComponentDefinitionNotFound = fmt.Errorf("component definition not found")

ErrComponentDefinitionNotFound is returned when trying to access an inexistent component definition.

Functions

This section is empty.

Types

type ComponentSecrets

type ComponentSecrets map[string]map[string]any

ComponentSecrets contains the global config secrets of each implemented component (referenced by ID). Components may use these secrets to skip the component configuration step and have a ready-to-run config.

type ExecutionParams

type ExecutionParams struct {
	// Component ID is the ID of the component *as defined in the recipe*.
	ComponentID string

	// ComponentDefinitionID determines the type of component to be executed.
	ComponentDefinitionID string

	// SystemVariables contains information about the pipeline trigger in which
	// the component is being executed.
	SystemVariables map[string]any

	// Setup may contain the configuration to connect to an external service.
	Setup *structpb.Struct

	// Task determines the task that the execution will carry out. It defines
	// the input and output of the execution.
	Task string
}

ExecutionParams contains the information needed to execute a component.

type Store

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

Store holds in-memory information about the initialized components.

func Init

func Init(
	logger *zap.Logger,
	secrets ComponentSecrets,
	usageHandlerCreator base.UsageHandlerCreator,
) *Store

Init initializes the components implemented in this repository and loads their information to memory.

func (*Store) CreateExecution

func (s *Store) CreateExecution(p ExecutionParams) (*base.ExecutionWrapper, error)

CreateExecution initializes the execution of a component.

func (*Store) GetDefinitionByID

func (s *Store) GetDefinitionByID(defID string, sysVars map[string]any, compConfig *base.ComponentConfig) (*pb.ComponentDefinition, error)

GetDefinitionByID returns a component definition by its ID.

func (*Store) GetDefinitionByUID

func (s *Store) GetDefinitionByUID(defUID uuid.UUID, sysVars map[string]any, compConfig *base.ComponentConfig) (*pb.ComponentDefinition, error)

GetDefinitionByUID returns a component definition by its UID.

func (*Store) HandleVerificationEvent

func (s *Store) HandleVerificationEvent(defID string, header map[string][]string, req *structpb.Struct, setup map[string]any) (bool, *structpb.Struct, error)

func (*Store) Import

func (s *Store) Import(comp base.IComponent)

Import loads the component definitions into memory.

func (*Store) IsSecretField

func (s *Store) IsSecretField(defUID uuid.UUID, target string) (bool, error)

func (*Store) ListDefinitions

func (s *Store) ListDefinitions(sysVars map[string]any, returnTombstone bool) []*pb.ComponentDefinition

ListDefinitions returns all the loaded component definitions.

Jump to

Keyboard shortcuts

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