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