Documentation
¶
Index ¶
- func FromConfig(data Configuration, v any) error
- type AttachmentRequest
- type AttachmentResponse
- type AvailableExtensions
- type ChainloopMetadata
- type Configuration
- type Core
- type Credentials
- type ExecuteAttestation
- type ExecuteInput
- type ExecuteMaterial
- type ExecutionRequest
- type FanOut
- type FanOutExtension
- type FanOutFactory
- type FanOutIntegration
- type InputMaterial
- type InputSchema
- type Inputs
- type IntegrationInfo
- type NewOpt
- type NewParams
- type RegistrationRequest
- type RegistrationResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromConfig ¶
func FromConfig(data Configuration, v any) error
Types ¶
type AttachmentRequest ¶
type AttachmentRequest struct { Payload Configuration RegistrationInfo *RegistrationResponse }
type AttachmentResponse ¶
type AttachmentResponse struct { // JSON serializable configuration to be persisted Configuration }
type ChainloopMetadata ¶
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 }
Implemented by the core struct
type Credentials ¶
type Credentials struct {
URL, Username, Password string
}
type ExecuteAttestation ¶
type ExecuteInput ¶
type ExecuteInput struct { Attestation *ExecuteAttestation Material *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 FanOutExtension }
Interface required to be implemented by any integration
type FanOutExtension ¶
type FanOutExtension 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 FanOutIntegration ¶
FanOutIntegration represents an extension point for integrations to be able to fanOut subscribed inputs
func (*FanOutIntegration) Describe ¶
func (i *FanOutIntegration) Describe() *IntegrationInfo
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 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 Inputs ¶
type Inputs struct { DSSEnvelope bool Materials []*InputMaterial }
An integration can be subscribed to an envelope and/or a list of materials To subscribe to any material type it will use schemaapi.CraftingSchema_Material_MATERIAL_TYPE_UNSPECIFIED
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 SubscribedInputs *Inputs // Schemas in JSON schema format RegistrationJSONSchema, AttachmentJSONSchema []byte }
type NewOpt ¶
type NewOpt func(*FanOutIntegration)
func WithEnvelope ¶
func WithEnvelope() NewOpt
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 }