model

package
v0.32.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AnyResourceType is used to designate a resource handler that can handle any type that belongs to a provider. AnyResourceType
	// should only be used to register handlers, and not as part of an output resource.
	AnyResourceType = "*"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationModel

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

ApplicationModel defines the set of supported resource types and related features.

func NewApplicationModel

func NewApplicationModel(arm *armauth.ArmConfig, k8sClient client.Client, k8sClientSet kubernetes.Interface, discoveryClient discovery.ServerResourcesInterface, k8sDynamicClientSet dynamic.Interface) (ApplicationModel, error)

NewApplicationModel configures RBAC support on connections based on connection kind, configures the providers supported by the appmodel, registers the renderers and handlers for various resources, and checks for duplicate registrations.

func NewModel

func NewModel(radiusResources []RadiusResourceModel, outputResources []OutputResourceModel, supportedProviders map[string]bool) ApplicationModel

NewModel creates a new ApplicationModel instance by mapping the RadiusResourceModel and OutputResourceModel slices to lookup maps and setting the supportedProviders map.

func (ApplicationModel) GetOutputResources

func (m ApplicationModel) GetOutputResources() []OutputResourceModel

GetOutputResources returns the OutputResourceModels from the ApplicationModel instance.

func (ApplicationModel) GetRadiusResources

func (m ApplicationModel) GetRadiusResources() []RadiusResourceModel

GetRadiusResources returns the RadiusResourceModels from the ApplicationModel instance.

func (ApplicationModel) IsProviderSupported

func (m ApplicationModel) IsProviderSupported(provider string) bool

IsProviderSupported checks if the given provider is supported by the application model.

func (ApplicationModel) LookupOutputResourceModel

func (m ApplicationModel) LookupOutputResourceModel(resourceType resourcemodel.ResourceType) (*OutputResourceModel, error)

LookupOutputResourceModel looks up an OutputResourceModel from the outputResourceLookup map and returns it, or an error if the resourceType is unsupported.

func (ApplicationModel) LookupRadiusResourceModel

func (m ApplicationModel) LookupRadiusResourceModel(resourceType string) (*RadiusResourceModel, error)

LookupRadiusResourceModel does a case-insensitive-lookup for resourceType and returns it, or an error if the resource type is unsupported.

type OutputResourceModel

type OutputResourceModel struct {
	ResourceType    resourcemodel.ResourceType
	ResourceHandler handlers.ResourceHandler

	// ResourceTransformer transforms output resource before deploying resource.
	ResourceTransformer func(context.Context, *handlers.PutOptions) error
}

type RadiusResourceModel

type RadiusResourceModel struct {
	ResourceType string
	Renderer     renderers.Renderer
}

Jump to

Keyboard shortcuts

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