plugins

package
v0.0.0-...-aacb26d Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtlasSdkVersionPlugin

type AtlasSdkVersionPlugin struct{}

AtlasSdkVersionPlugin is a plugin that adds the Atlas SDK version information as an OpenAPI extension in the CRD. It requires the entry plugin to be run first.

func (*AtlasSdkVersionPlugin) Name

func (p *AtlasSdkVersionPlugin) Name() string

func (*AtlasSdkVersionPlugin) Process

type Base

type Base struct{}

Base is a plugin that add minimum required configuration to a CRD

func (*Base) Name

func (p *Base) Name() string

func (*Base) Process

func (p *Base) Process(req *CRDProcessorRequest) error

type CRDPlugin

type CRDPlugin = Plugin[*CRDProcessorRequest]

type CRDPluginMock

type CRDPluginMock struct {
	mock.Mock
}

CRDPluginMock is an autogenerated mock type for the CRDPlugin type

func NewCRDPluginMock

func NewCRDPluginMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *CRDPluginMock

NewCRDPluginMock creates a new instance of CRDPluginMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*CRDPluginMock) EXPECT

func (_m *CRDPluginMock) EXPECT() *CRDPluginMock_Expecter

func (*CRDPluginMock) Name

func (_mock *CRDPluginMock) Name() string

Name provides a mock function for the type CRDPluginMock

func (*CRDPluginMock) Process

func (_mock *CRDPluginMock) Process(request *CRDProcessorRequest) error

Process provides a mock function for the type CRDPluginMock

type CRDPluginMock_Expecter

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

func (*CRDPluginMock_Expecter) Name

Name is a helper method to define mock.On call

func (*CRDPluginMock_Expecter) Process

func (_e *CRDPluginMock_Expecter) Process(request interface{}) *CRDPluginMock_Process_Call

Process is a helper method to define mock.On call

  • request *CRDProcessorRequest

type CRDPluginMock_Name_Call

type CRDPluginMock_Name_Call struct {
	*mock.Call
}

CRDPluginMock_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'

func (*CRDPluginMock_Name_Call) Return

func (*CRDPluginMock_Name_Call) Run

func (_c *CRDPluginMock_Name_Call) Run(run func()) *CRDPluginMock_Name_Call

func (*CRDPluginMock_Name_Call) RunAndReturn

func (_c *CRDPluginMock_Name_Call) RunAndReturn(run func() string) *CRDPluginMock_Name_Call

type CRDPluginMock_Process_Call

type CRDPluginMock_Process_Call struct {
	*mock.Call
}

CRDPluginMock_Process_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Process'

func (*CRDPluginMock_Process_Call) Return

func (*CRDPluginMock_Process_Call) Run

func (*CRDPluginMock_Process_Call) RunAndReturn

type CRDProcessorRequest

type CRDProcessorRequest struct {
	CRD       *apiextensions.CustomResourceDefinition
	CRDConfig *configv1alpha1.CRDConfig
}

type Catalog

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

func NewCatalog

func NewCatalog() *Catalog

func (*Catalog) BuildSets

func (c *Catalog) BuildSets(setsDefinition []configv1alpha1.PluginSet) ([]Set, error)

func (*Catalog) IsCRD

func (c *Catalog) IsCRD(name string) bool

func (*Catalog) IsMapping

func (c *Catalog) IsMapping(name string) bool

func (*Catalog) IsMappingExtension

func (c *Catalog) IsMappingExtension(name string) bool

func (*Catalog) IsProperty

func (c *Catalog) IsProperty(name string) bool

type ConnectionSecret

type ConnectionSecret struct{}

ConnectionSecret is a plugin that adds the Atlas Credentials secret to . It requires the parameters and references plugins to be run first.

func (*ConnectionSecret) Name

func (p *ConnectionSecret) Name() string

func (*ConnectionSecret) Process

type Entry

type Entry struct{}

Entry is a plugin that processes the entry mapping configuration and adds the entry schema to the CRD's spec validation schema. It requires the base and major_version plugin to be run first.

func (*Entry) Name

func (p *Entry) Name() string

func (*Entry) Process

func (p *Entry) Process(req *MappingProcessorRequest) error

type ExtensionPlugin

type ExtensionPlugin = Plugin[*ExtensionProcessorRequest]

type ExtensionPluginMock

type ExtensionPluginMock struct {
	mock.Mock
}

ExtensionPluginMock is an autogenerated mock type for the ExtensionPlugin type

func NewExtensionPluginMock

func NewExtensionPluginMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *ExtensionPluginMock

NewExtensionPluginMock creates a new instance of ExtensionPluginMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*ExtensionPluginMock) EXPECT

func (*ExtensionPluginMock) Name

func (_mock *ExtensionPluginMock) Name() string

Name provides a mock function for the type ExtensionPluginMock

func (*ExtensionPluginMock) Process

func (_mock *ExtensionPluginMock) Process(request *ExtensionProcessorRequest) error

Process provides a mock function for the type ExtensionPluginMock

type ExtensionPluginMock_Expecter

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

func (*ExtensionPluginMock_Expecter) Name

Name is a helper method to define mock.On call

func (*ExtensionPluginMock_Expecter) Process

func (_e *ExtensionPluginMock_Expecter) Process(request interface{}) *ExtensionPluginMock_Process_Call

Process is a helper method to define mock.On call

  • request *ExtensionProcessorRequest

type ExtensionPluginMock_Name_Call

type ExtensionPluginMock_Name_Call struct {
	*mock.Call
}

ExtensionPluginMock_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'

func (*ExtensionPluginMock_Name_Call) Return

func (*ExtensionPluginMock_Name_Call) Run

func (*ExtensionPluginMock_Name_Call) RunAndReturn

type ExtensionPluginMock_Process_Call

type ExtensionPluginMock_Process_Call struct {
	*mock.Call
}

ExtensionPluginMock_Process_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Process'

func (*ExtensionPluginMock_Process_Call) Return

func (*ExtensionPluginMock_Process_Call) Run

func (*ExtensionPluginMock_Process_Call) RunAndReturn

type ExtensionProcessorRequest

type ExtensionProcessorRequest struct {
	ExtensionsSchema *openapi3.Schema
	ApiDefinitions   map[string]configv1alpha1.OpenAPIDefinition
	MappingConfig    *configv1alpha1.CRDMapping
}

type MajorVersion

type MajorVersion struct{}

MajorVersion is a plugin that adds the major version schema to the CRD. It requires the base plugin to be run first.

func (*MajorVersion) Name

func (s *MajorVersion) Name() string

func (*MajorVersion) Process

func (s *MajorVersion) Process(req *MappingProcessorRequest) error

type MappingPlugin

type MappingPlugin = Plugin[*MappingProcessorRequest]

type MappingPluginMock

type MappingPluginMock struct {
	mock.Mock
}

MappingPluginMock is an autogenerated mock type for the MappingPlugin type

func NewMappingPluginMock

func NewMappingPluginMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *MappingPluginMock

NewMappingPluginMock creates a new instance of MappingPluginMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MappingPluginMock) EXPECT

func (*MappingPluginMock) Name

func (_mock *MappingPluginMock) Name() string

Name provides a mock function for the type MappingPluginMock

func (*MappingPluginMock) Process

func (_mock *MappingPluginMock) Process(request *MappingProcessorRequest) error

Process provides a mock function for the type MappingPluginMock

type MappingPluginMock_Expecter

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

func (*MappingPluginMock_Expecter) Name

Name is a helper method to define mock.On call

func (*MappingPluginMock_Expecter) Process

func (_e *MappingPluginMock_Expecter) Process(request interface{}) *MappingPluginMock_Process_Call

Process is a helper method to define mock.On call

  • request *MappingProcessorRequest

type MappingPluginMock_Name_Call

type MappingPluginMock_Name_Call struct {
	*mock.Call
}

MappingPluginMock_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'

func (*MappingPluginMock_Name_Call) Return

func (*MappingPluginMock_Name_Call) Run

func (*MappingPluginMock_Name_Call) RunAndReturn

func (_c *MappingPluginMock_Name_Call) RunAndReturn(run func() string) *MappingPluginMock_Name_Call

type MappingPluginMock_Process_Call

type MappingPluginMock_Process_Call struct {
	*mock.Call
}

MappingPluginMock_Process_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Process'

func (*MappingPluginMock_Process_Call) Return

func (*MappingPluginMock_Process_Call) Run

func (*MappingPluginMock_Process_Call) RunAndReturn

type MappingProcessorRequest

type MappingProcessorRequest struct {
	CRD              *apiextensions.CustomResourceDefinition
	MappingConfig    *configv1alpha1.CRDMapping
	OpenAPISpec      *openapi3.T
	ExtensionsSchema *openapi3.Schema
	Converter        converter.Converter
}

type MutualExclusiveGroup

type MutualExclusiveGroup struct{}

func (*MutualExclusiveGroup) Name

func (p *MutualExclusiveGroup) Name() string

func (*MutualExclusiveGroup) Process

type MutualExclusiveMajorVersions

type MutualExclusiveMajorVersions struct{}

MutualExclusiveMajorVersions is a plugin that adds a CEL validation to the CRD to ensure that only one of the major versions is set in the spec. It requires base plugin to be run first.

func (*MutualExclusiveMajorVersions) Name

func (*MutualExclusiveMajorVersions) Process

type Parameters

type Parameters struct{}

Parameters adds parameters from the OpenAPI spec to the CRD schema. It requires base and major version plugins to be run before.

func (*Parameters) Name

func (p *Parameters) Name() string

func (*Parameters) Process

func (p *Parameters) Process(req *MappingProcessorRequest) error

type Plugin

type Plugin[R any] interface {
	Name() string
	Process(request R) error
}

type PluginMock

type PluginMock[R any] struct {
	mock.Mock
}

PluginMock is an autogenerated mock type for the Plugin type

func NewPluginMock

func NewPluginMock[R any](t interface {
	mock.TestingT
	Cleanup(func())
}) *PluginMock[R]

NewPluginMock creates a new instance of PluginMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*PluginMock[R]) EXPECT

func (_m *PluginMock[R]) EXPECT() *PluginMock_Expecter[R]

func (*PluginMock[R]) Name

func (_mock *PluginMock[R]) Name() string

Name provides a mock function for the type PluginMock

func (*PluginMock[R]) Process

func (_mock *PluginMock[R]) Process(request R) error

Process provides a mock function for the type PluginMock

type PluginMock_Expecter

type PluginMock_Expecter[R any] struct {
	// contains filtered or unexported fields
}

func (*PluginMock_Expecter[R]) Name

func (_e *PluginMock_Expecter[R]) Name() *PluginMock_Name_Call[R]

Name is a helper method to define mock.On call

func (*PluginMock_Expecter[R]) Process

func (_e *PluginMock_Expecter[R]) Process(request interface{}) *PluginMock_Process_Call[R]

Process is a helper method to define mock.On call

  • request R

type PluginMock_Name_Call

type PluginMock_Name_Call[R any] struct {
	*mock.Call
}

PluginMock_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'

func (*PluginMock_Name_Call[R]) Return

func (_c *PluginMock_Name_Call[R]) Return(s string) *PluginMock_Name_Call[R]

func (*PluginMock_Name_Call[R]) Run

func (_c *PluginMock_Name_Call[R]) Run(run func()) *PluginMock_Name_Call[R]

func (*PluginMock_Name_Call[R]) RunAndReturn

func (_c *PluginMock_Name_Call[R]) RunAndReturn(run func() string) *PluginMock_Name_Call[R]

type PluginMock_Process_Call

type PluginMock_Process_Call[R any] struct {
	*mock.Call
}

PluginMock_Process_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Process'

func (*PluginMock_Process_Call[R]) Return

func (_c *PluginMock_Process_Call[R]) Return(err error) *PluginMock_Process_Call[R]

func (*PluginMock_Process_Call[R]) Run

func (_c *PluginMock_Process_Call[R]) Run(run func(request R)) *PluginMock_Process_Call[R]

func (*PluginMock_Process_Call[R]) RunAndReturn

func (_c *PluginMock_Process_Call[R]) RunAndReturn(run func(request R) error) *PluginMock_Process_Call[R]

type PropertyPlugin

type PropertyPlugin = Plugin[*PropertyProcessorRequest]

type PropertyPluginMock

type PropertyPluginMock struct {
	mock.Mock
}

PropertyPluginMock is an autogenerated mock type for the PropertyPlugin type

func NewPropertyPluginMock

func NewPropertyPluginMock(t interface {
	mock.TestingT
	Cleanup(func())
}) *PropertyPluginMock

NewPropertyPluginMock creates a new instance of PropertyPluginMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*PropertyPluginMock) EXPECT

func (*PropertyPluginMock) Name

func (_mock *PropertyPluginMock) Name() string

Name provides a mock function for the type PropertyPluginMock

func (*PropertyPluginMock) Process

func (_mock *PropertyPluginMock) Process(request *PropertyProcessorRequest) error

Process provides a mock function for the type PropertyPluginMock

type PropertyPluginMock_Expecter

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

func (*PropertyPluginMock_Expecter) Name

Name is a helper method to define mock.On call

func (*PropertyPluginMock_Expecter) Process

func (_e *PropertyPluginMock_Expecter) Process(request interface{}) *PropertyPluginMock_Process_Call

Process is a helper method to define mock.On call

  • request *PropertyProcessorRequest

type PropertyPluginMock_Name_Call

type PropertyPluginMock_Name_Call struct {
	*mock.Call
}

PropertyPluginMock_Name_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Name'

func (*PropertyPluginMock_Name_Call) Return

func (*PropertyPluginMock_Name_Call) Run

func (*PropertyPluginMock_Name_Call) RunAndReturn

type PropertyPluginMock_Process_Call

type PropertyPluginMock_Process_Call struct {
	*mock.Call
}

PropertyPluginMock_Process_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Process'

func (*PropertyPluginMock_Process_Call) Return

func (*PropertyPluginMock_Process_Call) Run

func (*PropertyPluginMock_Process_Call) RunAndReturn

type PropertyProcessorRequest

type PropertyProcessorRequest struct {
	Property         *apiextensions.JSONSchemaProps
	PropertyConfig   *configv1alpha1.PropertyMapping
	OpenAPISchema    *openapi3.Schema
	ExtensionsSchema *openapi3.SchemaRef
	Path             []string
}

type ReadOnlyProperties

type ReadOnlyProperties struct{}

func (*ReadOnlyProperties) Name

func (p *ReadOnlyProperties) Name() string

func (*ReadOnlyProperties) Process

type ReadWriteProperties

type ReadWriteProperties struct{}

func (*ReadWriteProperties) Name

func (p *ReadWriteProperties) Name() string

func (*ReadWriteProperties) Process

type References

type References struct{}

References adds reference properties to the CRD OpenAPI schema based on the mapping configuration. It requires base and major version schemas to be already processed.

func (*References) Name

func (r *References) Name() string

func (*References) Process

func (r *References) Process(req *MappingProcessorRequest) error

type ReferencesMetadata

type ReferencesMetadata struct{}

func (*ReferencesMetadata) Name

func (r *ReferencesMetadata) Name() string

func (*ReferencesMetadata) Process

type SensitiveProperties

type SensitiveProperties struct{}

func (*SensitiveProperties) Name

func (p *SensitiveProperties) Name() string

func (*SensitiveProperties) Process

type Set

type Set struct {
	Name      string
	Default   bool
	CRD       []CRDPlugin
	Mapping   []MappingPlugin
	Property  []PropertyPlugin
	Extension []ExtensionPlugin
}

func GetPluginSet

func GetPluginSet(sets []Set, name string) (*Set, error)

type SkippedProperties

type SkippedProperties struct{}

func (*SkippedProperties) Name

func (p *SkippedProperties) Name() string

func (*SkippedProperties) Process

type Status

type Status struct{}

Status plugin adds the status schema to the CRD if specified in the mapping configuration. It requires the base plugin to be run first.

func (*Status) Name

func (p *Status) Name() string

func (*Status) Process

func (p *Status) Process(req *MappingProcessorRequest) error

Jump to

Keyboard shortcuts

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