Documentation ¶
Index ¶
- type ASTValue
- type AnyField
- type AnyValue
- type ArrayField
- type ArrayOfContainerField
- type ArrayOfEnumField
- type ArrayOfObjectField
- type ArrayOfOneofField
- type ArrayOfScalarField
- type ContainerField
- type EnumField
- type EnumOption
- type Field
- type FieldContext
- type LeafMapField
- type MapField
- type MapOfContainerField
- type MapOfEnumField
- type MapOfObjectField
- type MapOfOneofField
- type MapOfScalarField
- type MutableArrayField
- type MutableMapField
- type Object
- type ObjectField
- type Oneof
- type OneofField
- type Property
- type PropertySet
- type RangeArrayCallback
- type RangeMapCallback
- type RangePropertiesCallback
- type RangePropertySchemasCallback
- type RangeValuesCallback
- type Reflector
- type Root
- type ScalarField
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayField ¶
type ArrayField interface { Field ItemSchema() j5schema.FieldSchema RangeValues(RangeArrayCallback) error Length() int Truncate(int) }
type ArrayOfContainerField ¶
type ArrayOfContainerField interface { MutableArrayField NewContainerElement() (ContainerField, int) RangeContainers(func(int, ContainerField) error) error }
type ArrayOfEnumField ¶
type ArrayOfEnumField interface { ArrayOfScalarField AppendEnumFromString(string) (int, error) }
type ArrayOfObjectField ¶
type ArrayOfObjectField interface { ArrayOfContainerField NewObjectElement() (ObjectField, int) }
type ArrayOfOneofField ¶
type ArrayOfOneofField interface { ArrayOfContainerField NewOneofElement() (Oneof, int, error) }
type ArrayOfScalarField ¶
type ContainerField ¶
type ContainerField interface { PropertySet Field }
type EnumField ¶
type EnumField interface { Field GetValue() (EnumOption, error) SetFromString(string) error }
type EnumOption ¶
type Field ¶
type Field interface { IsSet() bool FieldContext AsScalar() (ScalarField, bool) AsEnum() (EnumField, bool) AsContainer() (ContainerField, bool) AsObject() (ObjectField, bool) AsOneof() (OneofField, bool) AsArray() (ArrayField, bool) AsArrayOfScalar() (ArrayOfScalarField, bool) AsArrayOfContainer() (ArrayOfContainerField, bool) AsArrayOfOneof() (ArrayOfOneofField, bool) AsArrayOfObject() (ArrayOfObjectField, bool) AsMap() (MapField, bool) AsMapOfScalar() (MapOfScalarField, bool) AsMapOfContainer() (MapOfContainerField, bool) AsMapOfObject() (MapOfObjectField, bool) AsMapOfOneof() (MapOfOneofField, bool) }
type FieldContext ¶
type FieldContext interface { // NameInParent is the name this field in the parent // Object and Oneof: The property name // Map<string>x, the key // Arrays, the index as a string NameInParent() string // IndexInParent returns -1 for non array fields IndexInParent() int PropertySchema() *schema_j5pb.ObjectProperty FieldSchema() schema_j5pb.IsField_Type TypeName() string FullTypeName() string ProtoPath() []string }
type LeafMapField ¶
type LeafMapField interface { MapField }
type MapOfContainerField ¶
type MapOfContainerField interface { MutableMapField NewContainerElement(key string) (ContainerField, error) }
type MapOfEnumField ¶
type MapOfObjectField ¶
type MapOfObjectField interface {
NewObjectElement(key string) (ObjectField, error)
}
type MapOfOneofField ¶
type MapOfOneofField interface {
NewOneofElement(key string) (OneofField, error)
}
type MapOfScalarField ¶
type MutableArrayField ¶
type MutableArrayField interface { ArrayField NewElement() Field }
type MutableMapField ¶
type MutableMapField interface { MapField }
type Object ¶
type Object interface { PropertySet // HasAnyValue returns true if any of the properties have a valid value HasAnyValue() bool }
type ObjectField ¶
type Oneof ¶
type Oneof interface { PropertySet // GetOne returns the value existing in the oneof, or false if nothing is set. GetOne() (Field, bool, error) }
type OneofField ¶
type PropertySet ¶
type PropertySet interface { SchemaName() string // Returns the full name of the entity wrapping the properties. ContainerSchema() j5schema.Container RangeProperties(RangePropertiesCallback) error RangePropertySchemas(RangePropertySchemasCallback) error RangeValues(RangeValuesCallback) error // HasProperty returns true if there is a property with the given name in // the *schema* for the property set. HasProperty(name string) bool // GetProperty returns the property with the given name in the schema for // the property set. The property may not be set to a value. GetProperty(name string) (Property, error) GetValue(name string) (Field, bool, error) NewValue(name string) (Field, error) GetOrCreateValue(name string) (Field, error) ListPropertyNames() []string // contains filtered or unexported methods }
PropertySet is implemented by Oneofs, Objects and Maps with String keys.
type RangeArrayCallback ¶
type RangeMapCallback ¶
type RangePropertiesCallback ¶
type RangePropertySchemasCallback ¶
type RangePropertySchemasCallback func(name string, required bool, schema *schema_j5pb.Field) error
type RangeValuesCallback ¶
type Reflector ¶
type Reflector struct {
// contains filtered or unexported fields
}
func NewWithCache ¶
func NewWithCache(cache *j5schema.SchemaCache) *Reflector
type Root ¶
type Root interface { PropertySet }
Click to show internal directories.
Click to hide internal directories.