renderers

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package renderers is a generated GoMock package.

Index

Constants

View Source
const (
	// DefaultPort represents the default port of HTTP endpoint.
	DefaultPort int32 = 80

	// DefaultSecurePort represents the default port of HTTPS endpoint.
	DefaultSecurePort int32 = 443
)

Variables

This section is empty.

Functions

func GetAnnotations

func GetAnnotations(options RenderOptions) map[string]string

GetAnnotations returns the merged annotations from Environment and Application KubernetesMetadata.

func GetLabels

func GetLabels(options RenderOptions, applicationName string, resourceName string, resourceTypeName string) map[string]string

GetLabels merges cumulative label values from Environment, Application, Container and InputExt kubernetes metadata and returns a map of labels.

Types

type ApplicationOptions

type ApplicationOptions struct {
	// KubernetesMetadata represents the Application KubernetesMetadata extension.
	KubernetesMetadata *datamodel.KubeMetadataExtension
}

ApplicationOptions represents the options for the linked application resource.

type EnvironmentOptions

type EnvironmentOptions struct {
	// Namespace represents the Kubernetes namespace.
	Namespace string
	// Providers represents the cloud provider's configurations.
	CloudProviders *datamodel.Providers
	// Gateway represents the gateway options.
	Gateway GatewayOptions
	// Identity represents identity of the environment.
	Identity *rpv1.IdentitySettings
	// KubernetesMetadata represents the Environment KubernetesMetadata extension.
	KubernetesMetadata *datamodel.KubeMetadataExtension
	// Simulated represents whether the environment is a simulated environment.
	Simulated bool
}

EnvironmentOptions represents the options for the linked environment resource.

type GatewayOptions

type GatewayOptions struct {
	PublicEndpointOverride bool
	Hostname               string
	Port                   string
	ExternalIP             string
}

type MockRenderer

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

MockRenderer is a mock of Renderer interface.

func NewMockRenderer

func NewMockRenderer(ctrl *gomock.Controller) *MockRenderer

NewMockRenderer creates a new mock instance.

func (*MockRenderer) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRenderer) GetDependencyIDs

func (m *MockRenderer) GetDependencyIDs(arg0 context.Context, arg1 v1.DataModelInterface) ([]resources.ID, []resources.ID, error)

GetDependencyIDs mocks base method.

func (*MockRenderer) Render

Render mocks base method.

type MockRendererMockRecorder

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

MockRendererMockRecorder is the mock recorder for MockRenderer.

func (*MockRendererMockRecorder) GetDependencyIDs

func (mr *MockRendererMockRecorder) GetDependencyIDs(arg0, arg1 interface{}) *gomock.Call

GetDependencyIDs indicates an expected call of GetDependencyIDs.

func (*MockRendererMockRecorder) Render

func (mr *MockRendererMockRecorder) Render(arg0, arg1, arg2 interface{}) *gomock.Call

Render indicates an expected call of Render.

type RenderOptions

type RenderOptions struct {
	Dependencies map[string]RendererDependency
	Environment  EnvironmentOptions
	Application  ApplicationOptions
}

type Renderer

type Renderer interface {
	GetDependencyIDs(ctx context.Context, resource v1.DataModelInterface) (radiusResourceIDs []resources.ID, azureResourceIDs []resources.ID, err error)
	Render(ctx context.Context, resource v1.DataModelInterface, options RenderOptions) (RendererOutput, error)
}

type RendererDependency

type RendererDependency struct {
	// ResourceID is the resource ID of the Radius resource that is the dependency.
	ResourceID resources.ID

	// Resource is the datamodel of dependency resource.
	Resource v1.DataModelInterface

	// ComputedValues is a map of the computed values and secrets of the dependency.
	ComputedValues map[string]any

	// OutputResources is a map of the output resource IDs of the dependency. The map is keyed on the LocalID of the output resource.
	OutputResources map[string]resources.ID
}

Represents a dependency of the resource currently being rendered. Currently dependencies are always Radius resources.

type RendererOutput

type RendererOutput struct {
	Resources      []rpv1.OutputResource
	ComputedValues map[string]rpv1.ComputedValueReference
	SecretValues   map[string]rpv1.SecretValueReference

	// RadiusResource is the original Radius resource model.
	RadiusResource v1.DataModelInterface
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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