Documentation
¶
Index ¶
- Variables
- func BoolProvider(thread *starlark.Thread, builtin *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func FloatProvider(thread *starlark.Thread, builtin *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func IntProvider(thread *starlark.Thread, builtin *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func ListProvider(thread *starlark.Thread, builtin *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func LoadProvider(thread *starlark.Thread, module string) (starlark.StringDict, error)
- func ObjectProvider(thread *starlark.Thread, builtin *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func SchemaProvider(thread *starlark.Thread, builtin *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func StringProvider(thread *starlark.Thread, builtin *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- type BoolDescriptor
- func (descriptor BoolDescriptor) Default() starlark.Value
- func (descriptor BoolDescriptor) Evaluate(thread *starlark.Thread, value starlark.Value) (starlark.Value, error)
- func (descriptor BoolDescriptor) Freeze()
- func (descriptor BoolDescriptor) Hash() (uint32, error)
- func (descriptor BoolDescriptor) IsRequired() starlark.Bool
- func (descriptor BoolDescriptor) SKU() string
- func (descriptor BoolDescriptor) String() string
- func (descriptor BoolDescriptor) Truth() starlark.Bool
- func (descriptor BoolDescriptor) Type() string
- type Descriptor
- type FloatDescriptor
- func (descriptor FloatDescriptor) Default() starlark.Value
- func (descriptor FloatDescriptor) Evaluate(thread *starlark.Thread, value starlark.Value) (starlark.Value, error)
- func (descriptor FloatDescriptor) Freeze()
- func (descriptor FloatDescriptor) Hash() (uint32, error)
- func (descriptor FloatDescriptor) IsRequired() starlark.Bool
- func (descriptor FloatDescriptor) SKU() string
- func (descriptor FloatDescriptor) String() string
- func (descriptor FloatDescriptor) Truth() starlark.Bool
- func (descriptor FloatDescriptor) Type() string
- type IntDescriptor
- func (descriptor IntDescriptor) Default() starlark.Value
- func (descriptor IntDescriptor) Evaluate(thread *starlark.Thread, value starlark.Value) (starlark.Value, error)
- func (descriptor IntDescriptor) Freeze()
- func (descriptor IntDescriptor) Hash() (uint32, error)
- func (descriptor IntDescriptor) IsRequired() starlark.Bool
- func (descriptor IntDescriptor) SKU() string
- func (descriptor IntDescriptor) String() string
- func (descriptor IntDescriptor) Truth() starlark.Bool
- func (descriptor IntDescriptor) Type() string
- type ListDescriptor
- func (descriptor ListDescriptor) Default() starlark.Value
- func (descriptor ListDescriptor) Evaluate(thread *starlark.Thread, value starlark.Value) (starlark.Value, error)
- func (descriptor ListDescriptor) Freeze()
- func (descriptor ListDescriptor) Hash() (uint32, error)
- func (descriptor ListDescriptor) IsRequired() starlark.Bool
- func (descriptor ListDescriptor) SKU() string
- func (descriptor ListDescriptor) String() string
- func (descriptor ListDescriptor) Truth() starlark.Bool
- func (descriptor ListDescriptor) Type() string
- type ObjectDescriptor
- func (descriptor ObjectDescriptor) Default() starlark.Value
- func (descriptor ObjectDescriptor) Evaluate(thread *starlark.Thread, value starlark.Value) (starlark.Value, error)
- func (descriptor ObjectDescriptor) Freeze()
- func (descriptor ObjectDescriptor) Hash() (uint32, error)
- func (descriptor ObjectDescriptor) IsRequired() starlark.Bool
- func (descriptor ObjectDescriptor) SKU() string
- func (descriptor ObjectDescriptor) String() string
- func (descriptor ObjectDescriptor) Truth() starlark.Bool
- func (descriptor ObjectDescriptor) Type() string
- type SchemaContextItem
- type SchemaContextManager
- func (manager SchemaContextManager) EqualDescriptor(left SchemaDescriptor, right SchemaDescriptor) bool
- func (manager SchemaContextManager) GetDescriptor(descriptorSKU string) (Descriptor, bool)
- func (manager SchemaContextManager) GetSchemaName(descriptor Descriptor) (string, bool)
- func (manager SchemaContextManager) QueueSeenDescriptor(descriptor SchemaDescriptor)
- func (manager SchemaContextManager) UpdateRecognizedSchema(schemaBuilder *starlark.Builtin, schemaName string, ...)
- type SchemaDescriptor
- func (descriptor SchemaDescriptor) Default() starlark.Value
- func (descriptor SchemaDescriptor) Evaluate(thread *starlark.Thread, value starlark.Value) (starlark.Value, error)
- func (descriptor SchemaDescriptor) Freeze()
- func (descriptor SchemaDescriptor) Hash() (uint32, error)
- func (descriptor SchemaDescriptor) IsRequired() starlark.Bool
- func (descriptor SchemaDescriptor) SKU() string
- func (descriptor SchemaDescriptor) String() string
- func (descriptor SchemaDescriptor) Truth() starlark.Bool
- func (descriptor SchemaDescriptor) Type() string
- type SchemaResult
- func (result SchemaResult) Evaluate(thread *starlark.Thread, args starlark.Tuple, kwargs []starlark.Tuple) error
- func (result SchemaResult) Freeze()
- func (result SchemaResult) Hash() (uint32, error)
- func (result SchemaResult) String() string
- func (result SchemaResult) Truth() starlark.Bool
- func (result SchemaResult) Type() string
- type StringDescriptor
- func (descriptor StringDescriptor) Default() starlark.Value
- func (descriptor StringDescriptor) Evaluate(thread *starlark.Thread, value starlark.Value) (starlark.Value, error)
- func (descriptor StringDescriptor) Freeze()
- func (descriptor StringDescriptor) Hash() (uint32, error)
- func (descriptor StringDescriptor) IsRequired() starlark.Bool
- func (descriptor StringDescriptor) SKU() string
- func (descriptor StringDescriptor) String() string
- func (descriptor StringDescriptor) Truth() starlark.Bool
- func (descriptor StringDescriptor) Type() string
Constants ¶
This section is empty.
Variables ¶
View Source
var Predeclared = starlark.StringDict{ "Bool": starlark.NewBuiltin("Bool", BoolProvider), "Int": starlark.NewBuiltin("Int", IntProvider), "Float": starlark.NewBuiltin("Float", FloatProvider), "String": starlark.NewBuiltin("String", StringProvider), "Object": starlark.NewBuiltin("Object", ObjectProvider), "List": starlark.NewBuiltin("List", ListProvider), "Schema": starlark.NewBuiltin("Schema", SchemaProvider), }
View Source
var SchemaContextManagerThreadKey string = "starfig-schema-context-manager"
Functions ¶
func BoolProvider ¶
func FloatProvider ¶
func IntProvider ¶
func ListProvider ¶
func LoadProvider ¶
func ObjectProvider ¶
func SchemaProvider ¶
Types ¶
type BoolDescriptor ¶
type BoolDescriptor struct {
UUID uuid.UUID
DefaultValue starlark.Bool
Required starlark.Bool
Validations []starlark.Callable
}
func (BoolDescriptor) Default ¶
func (descriptor BoolDescriptor) Default() starlark.Value
func (BoolDescriptor) Freeze ¶
func (descriptor BoolDescriptor) Freeze()
func (BoolDescriptor) Hash ¶
func (descriptor BoolDescriptor) Hash() (uint32, error)
func (BoolDescriptor) IsRequired ¶
func (descriptor BoolDescriptor) IsRequired() starlark.Bool
func (BoolDescriptor) SKU ¶
func (descriptor BoolDescriptor) SKU() string
func (BoolDescriptor) String ¶
func (descriptor BoolDescriptor) String() string
func (BoolDescriptor) Truth ¶
func (descriptor BoolDescriptor) Truth() starlark.Bool
func (BoolDescriptor) Type ¶
func (descriptor BoolDescriptor) Type() string
type Descriptor ¶
type FloatDescriptor ¶
type FloatDescriptor struct {
UUID uuid.UUID
DefaultValue starlark.Float
Required starlark.Bool
Validations []starlark.Callable
}
func (FloatDescriptor) Default ¶
func (descriptor FloatDescriptor) Default() starlark.Value
func (FloatDescriptor) Freeze ¶
func (descriptor FloatDescriptor) Freeze()
func (FloatDescriptor) Hash ¶
func (descriptor FloatDescriptor) Hash() (uint32, error)
func (FloatDescriptor) IsRequired ¶
func (descriptor FloatDescriptor) IsRequired() starlark.Bool
func (FloatDescriptor) SKU ¶
func (descriptor FloatDescriptor) SKU() string
func (FloatDescriptor) String ¶
func (descriptor FloatDescriptor) String() string
func (FloatDescriptor) Truth ¶
func (descriptor FloatDescriptor) Truth() starlark.Bool
func (FloatDescriptor) Type ¶
func (descriptor FloatDescriptor) Type() string
type IntDescriptor ¶
type IntDescriptor struct {
UUID uuid.UUID
DefaultValue starlark.Int
Required starlark.Bool
Validations []starlark.Callable
}
func (IntDescriptor) Default ¶
func (descriptor IntDescriptor) Default() starlark.Value
func (IntDescriptor) Freeze ¶
func (descriptor IntDescriptor) Freeze()
func (IntDescriptor) Hash ¶
func (descriptor IntDescriptor) Hash() (uint32, error)
func (IntDescriptor) IsRequired ¶
func (descriptor IntDescriptor) IsRequired() starlark.Bool
func (IntDescriptor) SKU ¶
func (descriptor IntDescriptor) SKU() string
func (IntDescriptor) String ¶
func (descriptor IntDescriptor) String() string
func (IntDescriptor) Truth ¶
func (descriptor IntDescriptor) Truth() starlark.Bool
func (IntDescriptor) Type ¶
func (descriptor IntDescriptor) Type() string
type ListDescriptor ¶
type ListDescriptor struct {
UUID uuid.UUID
WrappedDescriptor Descriptor
Validations []starlark.Callable
}
func (ListDescriptor) Default ¶
func (descriptor ListDescriptor) Default() starlark.Value
func (ListDescriptor) Freeze ¶
func (descriptor ListDescriptor) Freeze()
func (ListDescriptor) Hash ¶
func (descriptor ListDescriptor) Hash() (uint32, error)
func (ListDescriptor) IsRequired ¶
func (descriptor ListDescriptor) IsRequired() starlark.Bool
func (ListDescriptor) SKU ¶
func (descriptor ListDescriptor) SKU() string
func (ListDescriptor) String ¶
func (descriptor ListDescriptor) String() string
func (ListDescriptor) Truth ¶
func (descriptor ListDescriptor) Truth() starlark.Bool
func (ListDescriptor) Type ¶
func (descriptor ListDescriptor) Type() string
type ObjectDescriptor ¶
type ObjectDescriptor struct {
UUID uuid.UUID
WrappedDescriptor Descriptor
Required starlark.Bool
Validations []starlark.Callable
}
func (ObjectDescriptor) Default ¶
func (descriptor ObjectDescriptor) Default() starlark.Value
func (ObjectDescriptor) Freeze ¶
func (descriptor ObjectDescriptor) Freeze()
func (ObjectDescriptor) Hash ¶
func (descriptor ObjectDescriptor) Hash() (uint32, error)
func (ObjectDescriptor) IsRequired ¶
func (descriptor ObjectDescriptor) IsRequired() starlark.Bool
func (ObjectDescriptor) SKU ¶
func (descriptor ObjectDescriptor) SKU() string
func (ObjectDescriptor) String ¶
func (descriptor ObjectDescriptor) String() string
func (ObjectDescriptor) Truth ¶
func (descriptor ObjectDescriptor) Truth() starlark.Bool
func (ObjectDescriptor) Type ¶
func (descriptor ObjectDescriptor) Type() string
type SchemaContextItem ¶
type SchemaContextItem struct {
SchemaName string
SchemaDescriptor SchemaDescriptor
FileTarget target.FileTarget
}
type SchemaContextManager ¶
type SchemaContextManager struct {
// contains filtered or unexported fields
}
func NewSchemaContextManager ¶
func NewSchemaContextManager() SchemaContextManager
func (SchemaContextManager) EqualDescriptor ¶
func (manager SchemaContextManager) EqualDescriptor( left SchemaDescriptor, right SchemaDescriptor) bool
Starlark loads modules multiple times, this causes our schema builder to run multiple times. Which causes the schema to be defined multiple times. However, the schema builder doesn't have context of what file it's in — so we determine if schemas are the same if they are from the same file and have the same name.
func (SchemaContextManager) GetDescriptor ¶
func (manager SchemaContextManager) GetDescriptor(descriptorSKU string) (Descriptor, bool)
func (SchemaContextManager) GetSchemaName ¶
func (manager SchemaContextManager) GetSchemaName(descriptor Descriptor) (string, bool)
func (SchemaContextManager) QueueSeenDescriptor ¶
func (manager SchemaContextManager) QueueSeenDescriptor(descriptor SchemaDescriptor)
func (SchemaContextManager) UpdateRecognizedSchema ¶
func (manager SchemaContextManager) UpdateRecognizedSchema( schemaBuilder *starlark.Builtin, schemaName string, fileTarget target.FileTarget)
type SchemaDescriptor ¶
type SchemaDescriptor struct {
UUID uuid.UUID
Fields *starlark.Dict
Validations []starlark.Callable
}
func (SchemaDescriptor) Default ¶
func (descriptor SchemaDescriptor) Default() starlark.Value
func (SchemaDescriptor) Freeze ¶
func (descriptor SchemaDescriptor) Freeze()
func (SchemaDescriptor) Hash ¶
func (descriptor SchemaDescriptor) Hash() (uint32, error)
func (SchemaDescriptor) IsRequired ¶
func (descriptor SchemaDescriptor) IsRequired() starlark.Bool
func (SchemaDescriptor) SKU ¶
func (descriptor SchemaDescriptor) SKU() string
func (SchemaDescriptor) String ¶
func (descriptor SchemaDescriptor) String() string
func (SchemaDescriptor) Truth ¶
func (descriptor SchemaDescriptor) Truth() starlark.Bool
func (SchemaDescriptor) Type ¶
func (descriptor SchemaDescriptor) Type() string
type SchemaResult ¶
type SchemaResult struct {
UUID uuid.UUID
SchemaDescriptor SchemaDescriptor
Evaluated *starlark.Dict
}
func (SchemaResult) Freeze ¶
func (result SchemaResult) Freeze()
func (SchemaResult) Hash ¶
func (result SchemaResult) Hash() (uint32, error)
func (SchemaResult) String ¶
func (result SchemaResult) String() string
func (SchemaResult) Truth ¶
func (result SchemaResult) Truth() starlark.Bool
func (SchemaResult) Type ¶
func (result SchemaResult) Type() string
type StringDescriptor ¶
type StringDescriptor struct {
UUID uuid.UUID
DefaultValue starlark.String
Required starlark.Bool
Validations []starlark.Callable
}
func (StringDescriptor) Default ¶
func (descriptor StringDescriptor) Default() starlark.Value
func (StringDescriptor) Freeze ¶
func (descriptor StringDescriptor) Freeze()
func (StringDescriptor) Hash ¶
func (descriptor StringDescriptor) Hash() (uint32, error)
func (StringDescriptor) IsRequired ¶
func (descriptor StringDescriptor) IsRequired() starlark.Bool
func (StringDescriptor) SKU ¶
func (descriptor StringDescriptor) SKU() string
func (StringDescriptor) String ¶
func (descriptor StringDescriptor) String() string
func (StringDescriptor) Truth ¶
func (descriptor StringDescriptor) Truth() starlark.Bool
func (StringDescriptor) Type ¶
func (descriptor StringDescriptor) Type() string
Click to show internal directories.
Click to hide internal directories.