Documentation ¶
Index ¶
- Constants
- Variables
- func CompileInstillAcceptFormats(sch *structpb.Struct) error
- func CompileInstillFormat(sch *structpb.Struct) error
- func ConvertFromStructpb(from *structpb.Struct, to interface{}) error
- func ConvertToStructpb(from interface{}) (*structpb.Struct, error)
- func FormatErrors(inputPath string, e jsonschema.Detailed, errors *[]string)
- func RenderJSON(tasksJSONBytes []byte, additionalJSONBytes map[string][]byte) ([]byte, error)
- func TaskIDToTitle(id string) string
- func TrimBase64Mime(b64 string) string
- func Validate(data []*structpb.Struct, jsonSchema string, target string) error
- type BaseConnector
- func (c *BaseConnector) GetConnectorDefinition(sysVars map[string]any, component *pipelinePB.ConnectorComponent) (*pipelinePB.ConnectorDefinition, error)
- func (c *BaseConnector) GetID() string
- func (c *BaseConnector) GetLogger() *zap.Logger
- func (c *BaseConnector) GetTaskInputSchemas() map[string]string
- func (c *BaseConnector) GetTaskOutputSchemas() map[string]string
- func (c *BaseConnector) GetUID() uuid.UUID
- func (c *BaseConnector) GetUsageHandler() UsageHandler
- func (c *BaseConnector) IsCredentialField(target string) bool
- func (c *BaseConnector) ListCredentialField() ([]string, error)
- func (c *BaseConnector) LoadConnectorDefinition(definitionJSONBytes []byte, tasksJSONBytes []byte, ...) error
- type BaseConnectorExecution
- func (e *BaseConnectorExecution) GetConnection() *structpb.Struct
- func (e *BaseConnectorExecution) GetConnector() IConnector
- func (e *BaseConnectorExecution) GetLogger() *zap.Logger
- func (e *BaseConnectorExecution) GetSystemVariables() map[string]any
- func (e *BaseConnectorExecution) GetTask() string
- func (e *BaseConnectorExecution) GetTaskInputSchema() string
- func (e *BaseConnectorExecution) GetTaskOutputSchema() string
- func (e *BaseConnectorExecution) GetUsageHandler() UsageHandler
- type BaseOperator
- func (o *BaseOperator) GetID() string
- func (o *BaseOperator) GetLogger() *zap.Logger
- func (o *BaseOperator) GetOperatorDefinition(sysVars map[string]any, component *pipelinePB.OperatorComponent) (*pipelinePB.OperatorDefinition, error)
- func (o *BaseOperator) GetTaskInputSchemas() map[string]string
- func (o *BaseOperator) GetTaskOutputSchemas() map[string]string
- func (o *BaseOperator) GetUID() uuid.UUID
- func (o *BaseOperator) GetUsageHandler() UsageHandler
- func (o *BaseOperator) LoadOperatorDefinition(definitionJSONBytes []byte, tasksJSONBytes []byte, ...) error
- type BaseOperatorExecution
- func (e *BaseOperatorExecution) GetLogger() *zap.Logger
- func (e *BaseOperatorExecution) GetOperator() IOperator
- func (e *BaseOperatorExecution) GetSystemVariables() map[string]any
- func (e *BaseOperatorExecution) GetTask() string
- func (e *BaseOperatorExecution) GetTaskInputSchema() string
- func (e *BaseOperatorExecution) GetTaskOutputSchema() string
- func (e *BaseOperatorExecution) GetUsageHandler() UsageHandler
- type ExecutionWrapper
- type IComponent
- type IConnector
- type IConnectorExecution
- type IExecution
- type IOperator
- type IOperatorExecution
- type InstillAcceptFormatsCompiler
- type InstillAcceptFormatsSchema
- type InstillFormatCompiler
- type InstillFormatSchema
- type UsageHandler
Constants ¶
const OpenAPITemplate = `` /* 1538-byte string literal not displayed */
Variables ¶
var InstillAcceptFormatsMeta = jsonschema.MustCompileString("instillAcceptFormats.json", `{
"properties" : {
"instillAcceptFormats": {
"type": "array",
"items": {
"type": "string"
}
}
}
}`)
var InstillFormatMeta = jsonschema.MustCompileString("instillFormat.json", `{
"properties" : {
"instillFormat": {
"type": "string"
}
}
}`)
Functions ¶
func CompileInstillFormat ¶
func ConvertFromStructpb ¶
ConvertFromStructpb converts from structpb.Struct to a struct
func ConvertToStructpb ¶
ConvertToStructpb converts from a struct to structpb.Struct
func FormatErrors ¶
func RenderJSON ¶
func TaskIDToTitle ¶
TaskIDToTitle builds a Task title from its ID. This is used when the `title` key in the task definition isn't present.
func TrimBase64Mime ¶
Types ¶
type BaseConnector ¶
type BaseConnector struct { Logger *zap.Logger UsageHandler UsageHandler // contains filtered or unexported fields }
Connector is the base struct for all connectors
func (*BaseConnector) GetConnectorDefinition ¶
func (c *BaseConnector) GetConnectorDefinition(sysVars map[string]any, component *pipelinePB.ConnectorComponent) (*pipelinePB.ConnectorDefinition, error)
func (*BaseConnector) GetID ¶
func (c *BaseConnector) GetID() string
func (*BaseConnector) GetLogger ¶
func (c *BaseConnector) GetLogger() *zap.Logger
func (*BaseConnector) GetTaskInputSchemas ¶
func (c *BaseConnector) GetTaskInputSchemas() map[string]string
func (*BaseConnector) GetTaskOutputSchemas ¶
func (c *BaseConnector) GetTaskOutputSchemas() map[string]string
func (*BaseConnector) GetUID ¶
func (c *BaseConnector) GetUID() uuid.UUID
func (*BaseConnector) GetUsageHandler ¶
func (c *BaseConnector) GetUsageHandler() UsageHandler
func (*BaseConnector) IsCredentialField ¶
func (c *BaseConnector) IsCredentialField(target string) bool
IsCredentialField checks if the target field is credential field
func (*BaseConnector) ListCredentialField ¶
func (c *BaseConnector) ListCredentialField() ([]string, error)
ListCredentialField lists the credential fields by definition id
func (*BaseConnector) LoadConnectorDefinition ¶
func (c *BaseConnector) LoadConnectorDefinition(definitionJSONBytes []byte, tasksJSONBytes []byte, additionalJSONBytes map[string][]byte) error
LoadConnectorDefinition loads the connector definitions from json files
type BaseConnectorExecution ¶
type BaseConnectorExecution struct { Connector IConnector SystemVariables map[string]any Connection *structpb.Struct Task string }
func (*BaseConnectorExecution) GetConnection ¶
func (e *BaseConnectorExecution) GetConnection() *structpb.Struct
func (*BaseConnectorExecution) GetConnector ¶
func (e *BaseConnectorExecution) GetConnector() IConnector
func (*BaseConnectorExecution) GetLogger ¶
func (e *BaseConnectorExecution) GetLogger() *zap.Logger
func (*BaseConnectorExecution) GetSystemVariables ¶
func (e *BaseConnectorExecution) GetSystemVariables() map[string]any
func (*BaseConnectorExecution) GetTask ¶
func (e *BaseConnectorExecution) GetTask() string
func (*BaseConnectorExecution) GetTaskInputSchema ¶
func (e *BaseConnectorExecution) GetTaskInputSchema() string
func (*BaseConnectorExecution) GetTaskOutputSchema ¶
func (e *BaseConnectorExecution) GetTaskOutputSchema() string
func (*BaseConnectorExecution) GetUsageHandler ¶
func (e *BaseConnectorExecution) GetUsageHandler() UsageHandler
type BaseOperator ¶
type BaseOperator struct { Logger *zap.Logger UsageHandler UsageHandler // contains filtered or unexported fields }
func (*BaseOperator) GetID ¶
func (o *BaseOperator) GetID() string
func (*BaseOperator) GetLogger ¶
func (o *BaseOperator) GetLogger() *zap.Logger
func (*BaseOperator) GetOperatorDefinition ¶
func (o *BaseOperator) GetOperatorDefinition(sysVars map[string]any, component *pipelinePB.OperatorComponent) (*pipelinePB.OperatorDefinition, error)
func (*BaseOperator) GetTaskInputSchemas ¶
func (o *BaseOperator) GetTaskInputSchemas() map[string]string
func (*BaseOperator) GetTaskOutputSchemas ¶
func (o *BaseOperator) GetTaskOutputSchemas() map[string]string
func (*BaseOperator) GetUID ¶
func (o *BaseOperator) GetUID() uuid.UUID
func (*BaseOperator) GetUsageHandler ¶
func (o *BaseOperator) GetUsageHandler() UsageHandler
func (*BaseOperator) LoadOperatorDefinition ¶
func (o *BaseOperator) LoadOperatorDefinition(definitionJSONBytes []byte, tasksJSONBytes []byte, additionalJSONBytes map[string][]byte) error
LoadOperatorDefinition loads the operator definitions from json files
type BaseOperatorExecution ¶
func (*BaseOperatorExecution) GetLogger ¶
func (e *BaseOperatorExecution) GetLogger() *zap.Logger
func (*BaseOperatorExecution) GetOperator ¶
func (e *BaseOperatorExecution) GetOperator() IOperator
func (*BaseOperatorExecution) GetSystemVariables ¶
func (e *BaseOperatorExecution) GetSystemVariables() map[string]any
func (*BaseOperatorExecution) GetTask ¶
func (e *BaseOperatorExecution) GetTask() string
func (*BaseOperatorExecution) GetTaskInputSchema ¶
func (e *BaseOperatorExecution) GetTaskInputSchema() string
func (*BaseOperatorExecution) GetTaskOutputSchema ¶
func (e *BaseOperatorExecution) GetTaskOutputSchema() string
func (*BaseOperatorExecution) GetUsageHandler ¶
func (e *BaseOperatorExecution) GetUsageHandler() UsageHandler
type ExecutionWrapper ¶
type ExecutionWrapper struct {
Execution IExecution
}
type IComponent ¶
type IComponent interface { GetID() string GetUID() uuid.UUID GetLogger() *zap.Logger GetUsageHandler() UsageHandler GetTaskInputSchemas() map[string]string GetTaskOutputSchemas() map[string]string }
IComponent is the interface that wraps the basic component methods. All component need to implement this interface.
type IConnector ¶
type IConnector interface { IComponent LoadConnectorDefinition(definitionJSON []byte, tasksJSON []byte, additionalJSONBytes map[string][]byte) error // Note: Some content in the definition JSON schema needs to be generated by sysVars or component setting. GetConnectorDefinition(sysVars map[string]any, component *pipelinePB.ConnectorComponent) (*pipelinePB.ConnectorDefinition, error) CreateExecution(sysVars map[string]any, connection *structpb.Struct, task string) (*ExecutionWrapper, error) Test(sysVars map[string]any, connection *structpb.Struct) error IsCredentialField(target string) bool }
IConnector is the interface that all connectors need to implement
type IConnectorExecution ¶
type IConnectorExecution interface { IExecution GetConnector() IConnector GetConnection() *structpb.Struct }
type IExecution ¶
type IOperator ¶
type IOperator interface { IComponent LoadOperatorDefinition(definitionJSON []byte, tasksJSON []byte, additionalJSONBytes map[string][]byte) error // Note: Some content in the definition JSON schema needs to be generated by sysVars or component setting. GetOperatorDefinition(sysVars map[string]any, component *pipelinePB.OperatorComponent) (*pipelinePB.OperatorDefinition, error) CreateExecution(sysVars map[string]any, task string) (*ExecutionWrapper, error) }
type IOperatorExecution ¶
type IOperatorExecution interface { IExecution GetOperator() IOperator }
type InstillAcceptFormatsCompiler ¶
type InstillAcceptFormatsCompiler struct{}
func (InstillAcceptFormatsCompiler) Compile ¶
func (InstillAcceptFormatsCompiler) Compile(ctx jsonschema.CompilerContext, m map[string]interface{}) (jsonschema.ExtSchema, error)
type InstillAcceptFormatsSchema ¶
type InstillAcceptFormatsSchema []string
func (InstillAcceptFormatsSchema) Validate ¶
func (s InstillAcceptFormatsSchema) Validate(ctx jsonschema.ValidationContext, v interface{}) error
type InstillFormatCompiler ¶
type InstillFormatCompiler struct{}
func (InstillFormatCompiler) Compile ¶
func (InstillFormatCompiler) Compile(ctx jsonschema.CompilerContext, m map[string]interface{}) (jsonschema.ExtSchema, error)
type InstillFormatSchema ¶
type InstillFormatSchema string
func (InstillFormatSchema) Validate ¶
func (s InstillFormatSchema) Validate(ctx jsonschema.ValidationContext, v interface{}) error
type UsageHandler ¶
TODO: add parameters for usage check and collection