Documentation
¶
Index ¶
- func CalculatePropertiesMap(s *schema_validator.Schema, m *SchemaPropertiesMap) error
- func CompileJSONSchema(in []byte) (*schema_validator.Schema, error)
- func FromConfig(data Configuration, v any) error
- func SummaryTable(req *ExecutionRequest, opts ...RenderOpt) (string, error)
- type AttachmentRequest
- type AttachmentResponse
- type AvailablePlugins
- type ChainloopMetadata
- type ChainloopMetadataWorkflow
- type ChainloopMetadataWorkflowRun
- type Configuration
- type Core
- type Credentials
- type ExecuteAttestation
- type ExecuteInput
- type ExecuteMaterial
- type ExecutionRequest
- type FanOut
- type FanOutFactory
- type FanOutIntegration
- func (i *FanOutIntegration) Describe() *IntegrationInfo
- func (i *FanOutIntegration) IsSubscribedTo(m string) bool
- func (i *FanOutIntegration) String() string
- func (i *FanOutIntegration) ValidateAttachmentRequest(jsonPayload []byte) error
- func (i *FanOutIntegration) ValidateRegistrationRequest(jsonPayload []byte) error
- type FanOutP
- type FanOutPlugin
- type InputMaterial
- type InputSchema
- type IntegrationInfo
- type NewOpt
- type NewParams
- type RegistrationRequest
- type RegistrationResponse
- type RenderOpt
- type SchemaPropertiesMap
- type SchemaProperty
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculatePropertiesMap ¶
func CalculatePropertiesMap(s *schema_validator.Schema, m *SchemaPropertiesMap) error
Denormalize the properties of a json schema
func CompileJSONSchema ¶
func CompileJSONSchema(in []byte) (*schema_validator.Schema, error)
func FromConfig ¶
func FromConfig(data Configuration, v any) error
func SummaryTable ¶ added in v0.14.0
func SummaryTable(req *ExecutionRequest, opts ...RenderOpt) (string, error)
Types ¶
type AttachmentRequest ¶
type AttachmentRequest struct {
Payload Configuration
RegistrationInfo *RegistrationResponse
}
type AttachmentResponse ¶
type AttachmentResponse struct {
// JSON serializable configuration to be persisted
Configuration
}
type AvailablePlugins ¶
type AvailablePlugins []*FanOutP
List of loaded integrations
func (AvailablePlugins) Cleanup ¶ added in v0.13.0
func (i AvailablePlugins) Cleanup()
type ChainloopMetadata ¶
type ChainloopMetadata struct {
Workflow *ChainloopMetadataWorkflow
WorkflowRun *ChainloopMetadataWorkflowRun
}
type ChainloopMetadataWorkflow ¶ added in v0.14.0
type ChainloopMetadataWorkflow struct {
ID, Name, Team, Project string
}
type ChainloopMetadataWorkflowRun ¶ added in v0.14.0
type Configuration ¶
type Configuration []byte
Configuration represents any raw configuration to be stored in the DB This wrapper is just a way to clearly indicate that the content needs to be JSON serializable
func ToConfig ¶
func ToConfig(m any) (Configuration, error)
type Core ¶
type Core interface {
fmt.Stringer
// Return information about the integration
Describe() *IntegrationInfo
ValidateRegistrationRequest(jsonPayload []byte) error
ValidateAttachmentRequest(jsonPayload []byte) error
// Return if the integration is subscribed to the material type
IsSubscribedTo(materialType string) bool
}
Implemented by the core struct
type Credentials ¶
type Credentials struct {
URL, Username, Password string
}
type ExecuteAttestation ¶
type ExecuteInput ¶
type ExecuteInput struct {
Attestation *ExecuteAttestation
Materials []*ExecuteMaterial
}
An execute method will receive either the envelope or a material as input The material will contain its content as well as the metadata
type ExecuteMaterial ¶
type ExecuteMaterial struct {
*chainloop.NormalizedMaterial
// Content of the material already downloaded
Content []byte
}
type ExecutionRequest ¶
type ExecutionRequest struct {
*ChainloopMetadata
Input *ExecuteInput
RegistrationInfo *RegistrationResponse
AttachmentInfo *AttachmentResponse
}
ExecutionRequest is the request to execute the integration
type FanOut ¶
type FanOut interface {
// Implemented by the fanout base
Core
// To be implemented per integration
FanOutPlugin
}
Interface required to be implemented by any integration
type FanOutIntegration ¶
FanOutIntegration represents an plugin point for integrations to be able to fanOut subscribed inputs
func (*FanOutIntegration) Describe ¶
func (i *FanOutIntegration) Describe() *IntegrationInfo
func (*FanOutIntegration) IsSubscribedTo ¶
func (i *FanOutIntegration) IsSubscribedTo(m string) bool
func (*FanOutIntegration) String ¶
func (i *FanOutIntegration) String() string
func (*FanOutIntegration) ValidateAttachmentRequest ¶
func (i *FanOutIntegration) ValidateAttachmentRequest(jsonPayload []byte) error
Validate the attachment payload against the attachment JSON schema
func (*FanOutIntegration) ValidateRegistrationRequest ¶
func (i *FanOutIntegration) ValidateRegistrationRequest(jsonPayload []byte) error
Validate the registration payload against the registration JSON schema
type FanOutPlugin ¶
type FanOutPlugin interface {
// Validate, marshall and return the configuration that needs to be persisted
Register(ctx context.Context, req *RegistrationRequest) (*RegistrationResponse, error)
// Validate that the attachment configuration is valid in the context of the provided registration
Attach(ctx context.Context, req *AttachmentRequest) (*AttachmentResponse, error)
// Execute the integration
Execute(ctx context.Context, req *ExecutionRequest) error
}
To be implemented per integration
type InputMaterial ¶
type InputMaterial struct {
// Name of the material kind that the integration expects
Type schemaapi.CraftingSchema_Material_MaterialType
}
type InputSchema ¶
type InputSchema struct {
// Structs defining the registration and attachment schemas
Registration, Attachment any
}
type IntegrationInfo ¶
type IntegrationInfo struct {
// Identifier of the integration
ID string
// Integration version
Version string
// Integration description
Description string
// Kind of inputs does the integration expect as part of the execution
SubscribedMaterials []*InputMaterial
// Schemas in JSON schema format
RegistrationJSONSchema, AttachmentJSONSchema []byte
}
type NewOpt ¶
type NewOpt func(*FanOutIntegration)
func WithInputMaterial ¶
func WithInputMaterial(materialType schemaapi.CraftingSchema_Material_MaterialType) NewOpt
type NewParams ¶
type NewParams struct {
ID, Version, Description string
Logger log.Logger
InputSchema *InputSchema
}
type RegistrationRequest ¶
type RegistrationRequest struct {
// Custom Payload to be used by the integration
Payload Configuration
}
type RegistrationResponse ¶
type RegistrationResponse struct {
// Credentials to be persisted in Credentials Manager
// JSON serializable
Credentials *Credentials
// Configuration to be persisted in DB
Configuration
}
type RenderOpt ¶ added in v0.14.0
type RenderOpt func(r *renderer) error
func WithFormat ¶ added in v0.14.0
func WithMaxSize ¶ added in v0.16.0
type SchemaPropertiesMap ¶
type SchemaPropertiesMap map[string]*SchemaProperty