renderers

package
v0.52.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: Apache-2.0 Imports: 11 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.

func IsURL added in v0.47.0

func IsURL(input string) bool

func ParseURL added in v0.47.0

func ParseURL(sourceURL string) (scheme, hostname, port string, err error)

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 {
	Resource resources.ID
	// Namespace represents the Kubernetes namespace.
	Namespace string

	Compute *rpv1.EnvironmentCompute

	// 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 MockRendererGetDependencyIDsCall added in v0.35.0

type MockRendererGetDependencyIDsCall struct {
	*gomock.Call
}

MockRendererGetDependencyIDsCall wrap *gomock.Call

func (*MockRendererGetDependencyIDsCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockRendererGetDependencyIDsCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockRendererGetDependencyIDsCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

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 any) *MockRendererGetDependencyIDsCall

GetDependencyIDs indicates an expected call of GetDependencyIDs.

func (*MockRendererMockRecorder) Render

func (mr *MockRendererMockRecorder) Render(arg0, arg1, arg2 any) *MockRendererRenderCall

Render indicates an expected call of Render.

type MockRendererRenderCall added in v0.35.0

type MockRendererRenderCall struct {
	*gomock.Call
}

MockRendererRenderCall wrap *gomock.Call

func (*MockRendererRenderCall) Do added in v0.35.0

Do rewrite *gomock.Call.Do

func (*MockRendererRenderCall) DoAndReturn added in v0.35.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockRendererRenderCall) Return added in v0.35.0

Return rewrite *gomock.Call.Return

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
}

Jump to

Keyboard shortcuts

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