Documentation ¶
Index ¶
- Constants
- func ValidPrimitiveType(t string) bool
- type FunctionSchema
- type Info
- type InterfaceSchema
- type Schema
- func (s *Schema) Clone() (*Schema, error)
- func (s *Schema) CloneWithDisabledAccessorsValidatorsAndModifiers() (*Schema, error)
- func (s *Schema) Decode(data []byte) error
- func (s *Schema) Encode() ([]byte, error)
- func (s *Schema) HasCaseModifier() bool
- func (s *Schema) HasLengthValidator() bool
- func (s *Schema) HasLimitValidator() bool
- func (s *Schema) HasRegexValidator() bool
- func (s *Schema) Hash() ([]byte, error)
Constants ¶
View Source
const MasterTestingSchema = `` /* 663-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func ValidPrimitiveType ¶
Types ¶
type FunctionSchema ¶
type FunctionSchema struct { Name string `hcl:"name,label"` Description string `hcl:"description,optional"` Params string `hcl:"params,optional"` Return string `hcl:"return,optional"` }
func (*FunctionSchema) Normalize ¶
func (s *FunctionSchema) Normalize()
func (*FunctionSchema) Validate ¶
func (s *FunctionSchema) Validate(knownFunctions map[string]struct{}) error
type InterfaceSchema ¶
type InterfaceSchema struct { Name string `hcl:"name,label"` Description string `hcl:"description,optional"` Functions []*FunctionSchema `hcl:"function,block"` }
func (*InterfaceSchema) Normalize ¶
func (s *InterfaceSchema) Normalize()
type Schema ¶
type Schema struct { Version string `hcl:"version,attr"` Interfaces []*InterfaceSchema `hcl:"interface,block"` Functions []*FunctionSchema `hcl:"function,block"` Enums []*signature.EnumSchema `hcl:"enum,block"` Models []*signature.ModelSchema `hcl:"model,block"` // contains filtered or unexported fields }
Schema is the top-level structure of a Scale Extension schema
func ReadSchema ¶
ReadSchema reads a Scale Extension schema from a file at the given path
func (*Schema) CloneWithDisabledAccessorsValidatorsAndModifiers ¶
CloneWithDisabledAccessorsValidatorsAndModifiers returns a clone of the schema with all accessors, validators, and modifiers disabled
func (*Schema) Decode ¶
Decode decodes the given byte slice into the Schema
Note: This function modifies the Schema in-place and validates/normalizes it as well.
func (*Schema) HasCaseModifier ¶
func (*Schema) HasLengthValidator ¶
func (*Schema) HasLimitValidator ¶
func (*Schema) HasRegexValidator ¶
Click to show internal directories.
Click to hide internal directories.