Documentation ¶
Index ¶
- Constants
- Variables
- func ContainsUnknownField(value Value) bool
- func HandleRightsByName(rightsName string) (fidl.HandleRights, bool)
- func HandleSubtypeByName(s string) (fidl.HandleSubtype, bool)
- func TypeFromValue(value Value) string
- func ValidateAllType(input All, generatorType string)
- type All
- type Benchmark
- type DecodeFailure
- type DecodeSuccess
- type EncodeFailure
- type EncodeSuccess
- type Encoding
- type ErrorCode
- type Field
- type FieldKey
- type Handle
- type HandleDef
- type HandleDisposition
- type HandleDispositionEncoding
- type HandleWithRights
- type LanguageList
- type RawFloat
- type Record
- type UnknownData
- type Value
- type WireFormat
- type WireFormatList
Constants ¶
const ( StringTooLong = "STRING_TOO_LONG" StringNotUtf8 = "STRING_NOT_UTF8" NonEmptyStringWithNullBody = "NON_EMPTY_STRING_WITH_NULL_BODY" StrictUnionFieldNotSet = "STRICT_UNION_FIELD_NOT_SET" StrictUnionUnknownField = "STRICT_UNION_UNKNOWN_FIELD" StrictBitsUnknownBit = "STRICT_BITS_UNKNOWN_BIT" StrictEnumUnknownValue = "STRICT_ENUM_UNKNOWN_VALUE" ExceededMaxOutOfLineDepth = "EXCEEDED_MAX_OUT_OF_LINE_DEPTH" InvalidNumBytesInEnvelope = "INVALID_NUM_BYTES_IN_ENVELOPE" InvalidNumHandlesInEnvelope = "INVALID_NUM_HANDLES_IN_ENVELOPE" InvalidPaddingByte = "INVALID_PADDING_BYTE" ExtraHandles = "EXTRA_HANDLES" TooFewHandles = "TOO_FEW_HANDLES" NonResourceUnknownHandles = "NON_RESOURCE_UNKNOWN_HANDLES" MissingRequiredHandleRights = "MISSING_REQUIRED_HANDLE_RIGHTS" IncorrectHandleType = "INCORRECT_HANDLE_TYPE" )
TODO(fxbug.dev/34770) Organize error codes by encoding / decoding. Potentially do a check in the parser that the code is the right type.
Variables ¶
var AllErrorCodes = map[ErrorCode]struct{}{ StringTooLong: {}, StringNotUtf8: {}, NonEmptyStringWithNullBody: {}, StrictUnionFieldNotSet: {}, StrictUnionUnknownField: {}, StrictBitsUnknownBit: {}, StrictEnumUnknownValue: {}, ExceededMaxOutOfLineDepth: {}, InvalidNumBytesInEnvelope: {}, InvalidNumHandlesInEnvelope: {}, InvalidPaddingByte: {}, ExtraHandles: {}, TooFewHandles: {}, NonResourceUnknownHandles: {}, MissingRequiredHandleRights: {}, IncorrectHandleType: {}, }
Functions ¶
func ContainsUnknownField ¶
ContainsUnknownField returns if the value or any subvalue contains an unknown field. Intended to allow bindings that don't support unknown fields to skip test cases that contain them.
func HandleRightsByName ¶
func HandleRightsByName(rightsName string) (fidl.HandleRights, bool)
func HandleSubtypeByName ¶
func HandleSubtypeByName(s string) (fidl.HandleSubtype, bool)
func TypeFromValue ¶
func ValidateAllType ¶
Types ¶
type All ¶
type All struct { EncodeSuccess []EncodeSuccess DecodeSuccess []DecodeSuccess EncodeFailure []EncodeFailure DecodeFailure []DecodeFailure Benchmark []Benchmark }
func FilterByBinding ¶
type Benchmark ¶
type Benchmark struct { Name string Value interface{} HandleDefs []HandleDef BindingsAllowlist *LanguageList BindingsDenylist *LanguageList EnableSendEventBenchmark bool EnableEchoCallBenchmark bool }
type DecodeFailure ¶
type DecodeFailure struct { Name string Type string Encodings []Encoding HandleDefs []HandleDef Err ErrorCode BindingsAllowlist *LanguageList BindingsDenylist *LanguageList }
type DecodeSuccess ¶
type DecodeSuccess struct { Name string Value interface{} Encodings []Encoding HandleDefs []HandleDef BindingsAllowlist *LanguageList BindingsDenylist *LanguageList }
type EncodeFailure ¶
type EncodeFailure struct { Name string Value interface{} HandleDefs []HandleDef WireFormats []WireFormat Err ErrorCode BindingsAllowlist *LanguageList BindingsDenylist *LanguageList }
type EncodeSuccess ¶
type EncodeSuccess struct { Name string Value interface{} Encodings []HandleDispositionEncoding HandleDefs []HandleDef BindingsAllowlist *LanguageList BindingsDenylist *LanguageList // CheckHandleRights is true for standalone "encode_success" tests providing // "handle_dispositions", but false for bidirectional "success" tests // because they provide only "handles" with no rights information. CheckHandleRights bool }
type Encoding ¶
type Encoding struct { WireFormat WireFormat Bytes []byte Handles []Handle }
type FieldKey ¶
FieldKey designates a field in a struct, table, or union type. The key is either known (represented by name) or unknown (represented by ordinal).
Only flexible tables and flexible unions can have unknown keys. Although known table/union fields (strict or flexible) have both a name and ordinal, FieldKey only stores the name.
type Handle ¶
type Handle int
A Handle is an index into the test's []HandleDef.
func GetHandlesFromHandleDispositions ¶
func GetHandlesFromHandleDispositions(handleDispositions []HandleDisposition) []Handle
func GetUnusedHandles ¶
GetUnusedHandles returns the list of handles from the input slice that do not appear in the provided Value
type HandleDef ¶
type HandleDef struct { Subtype fidl.HandleSubtype Rights fidl.HandleRights }
type HandleDisposition ¶
type HandleDisposition struct { Handle Handle Type fidl.ObjectType Rights fidl.HandleRights }
type HandleDispositionEncoding ¶
type HandleDispositionEncoding struct { WireFormat WireFormat Bytes []byte HandleDispositions []HandleDisposition }
type HandleWithRights ¶
type HandleWithRights struct { Handle Handle Type fidl.ObjectType Rights fidl.HandleRights }
A HandleWithRights is a Handle with rights information.
type LanguageList ¶
type LanguageList []string
func (LanguageList) Includes ¶
func (list LanguageList) Includes(targetLanguage string) bool
type RawFloat ¶
type RawFloat uint64
A RawFloat is an integer whose bytes specify an IEEE 754 single or double precision floating point number (sign bit = most significant bit). In the single-precision case, the value should be within uint32 range.
type Record ¶
type Record struct { // Unqualified type name. Name string // List of fields. Struct and table records can have any number of fields. // Union records should have exactly one field. Fields []Field }
Record represents a value for a struct, table, or union type.
type UnknownData ¶
UnknownData represents the raw payload of an envelope, e.g. the data corresponding to an unknown variant of a union
type Value ¶
type Value interface{}
Value represents any acceptable value used to represent a FIDL value. This type may wrap one of: - `string` for strings - `int64` for negative integers (of any size), bits, and enums - `uint64` for nonnegative integers (of any size), bits, and enums - `float64` or `RawFloat` for floating point numbers (of any size) - `bool` for booleans - `Handle` for handles - `Record` for structs, tables, and unions - `[]interface{}` for slices of values - `nil` for null values (only allowed for nullable types) - `UnknownData` for unknown variants of unions
type WireFormat ¶
type WireFormat string
const (
V1WireFormat WireFormat = "v1"
)
func (WireFormat) String ¶
func (wf WireFormat) String() string
type WireFormatList ¶
type WireFormatList []WireFormat
func (WireFormatList) Includes ¶
func (list WireFormatList) Includes(wireFormat WireFormat) bool
func (WireFormatList) Join ¶
func (list WireFormatList) Join(sep string) string