Documentation ¶
Index ¶
- func ConvertToEntitledType(inter *interpreter.Interpreter, staticType interpreter.StaticType) (interpreter.StaticType, error)
- func ConvertValueToEntitlements(inter *interpreter.Interpreter, v interpreter.Value) (interpreter.Value, error)
- type EntitlementsMigration
- func (mig EntitlementsMigration) CanSkip(valueType interpreter.StaticType) bool
- func (EntitlementsMigration) Domains() map[string]struct{}
- func (mig EntitlementsMigration) Migrate(_ interpreter.StorageKey, _ interpreter.StorageMapKey, value interpreter.Value, ...) (interpreter.Value, error)
- func (EntitlementsMigration) Name() string
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) Migrate ¶
func (mig EntitlementsMigration) Migrate( _ interpreter.StorageKey, _ interpreter.StorageMapKey, value interpreter.Value, _ *interpreter.Interpreter, ) ( interpreter.Value, error, )
func (EntitlementsMigration) Name ¶
func (EntitlementsMigration) Name() string
Click to show internal directories.
Click to hide internal directories.