entitlements

package
v1.0.0-preview.16 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToEntitledType

func ConvertToEntitledType(
	inter *interpreter.Interpreter,
	staticType interpreter.StaticType,
) (
	interpreter.StaticType,
	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 ConvertValueToEntitlements

func ConvertValueToEntitlements(
	inter *interpreter.Interpreter,
	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.

Types

type EntitlementsMigration

type EntitlementsMigration struct {
	Interpreter *interpreter.Interpreter
}

func NewEntitlementsMigration

func NewEntitlementsMigration(inter *interpreter.Interpreter) EntitlementsMigration

func (EntitlementsMigration) CanSkip

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

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