entitlements

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntitlementsMigration

type EntitlementsMigration struct {
	Interpreter *interpreter.Interpreter
	// contains filtered or unexported fields
}

func NewEntitlementsMigration

func NewEntitlementsMigration(inter *interpreter.Interpreter) EntitlementsMigration

func NewEntitlementsMigrationWithCache

func NewEntitlementsMigrationWithCache(
	inter *interpreter.Interpreter,
	migratedTypeCache migrations.StaticTypeCache,
) EntitlementsMigration

func (EntitlementsMigration) CanSkip

func (m EntitlementsMigration) CanSkip(valueType interpreter.StaticType) bool

func (EntitlementsMigration) ConvertToEntitledType

func (m EntitlementsMigration) ConvertToEntitledType(
	staticType interpreter.StaticType,
) (
	resultType interpreter.StaticType,
	err error,
)

ConvertToEntitledType converts the given type to an entitled type according to the following rules:

  • ConvertToEntitledType(&T) --> auth(Entitlements(T)) &T
  • ConvertToEntitledType(Capability<T>) --> Capability<ConvertToEntitledType(T)>
  • ConvertToEntitledType(T?) --> ConvertToEntitledType(T)?
  • ConvertToEntitledType([T]) --> [ConvertToEntitledType(T)]
  • ConvertToEntitledType([T; N]) --> [ConvertToEntitledType(T); N]
  • ConvertToEntitledType({K: V}) --> {ConvertToEntitledType(K): ConvertToEntitledType(V)}
  • ConvertToEntitledType(T) --> T

where `Entitlements(I)` is defined as the result of `T.SupportedEntitlements()`

TODO: functions?

func (EntitlementsMigration) ConvertValueToEntitlements

func (m EntitlementsMigration) ConvertValueToEntitlements(v interpreter.Value) (interpreter.Value, error)

ConvertValueToEntitlements converts the input value into a version compatible with the new entitlements feature, with the same members/operations accessible on any references as would have been accessible in the past.

func (EntitlementsMigration) Domains

func (EntitlementsMigration) Domains() map[string]struct{}

func (EntitlementsMigration) Name

Jump to

Keyboard shortcuts

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