Documentation ¶
Index ¶
- Variables
- func ContainsUnknownField(value Value) bool
- func HandleRightsByName(rightsName string) (fidlgen.HandleRights, bool)
- func HandleSubtypeByName(s string) (fidlgen.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 ¶
This section is empty.
Variables ¶
var AllErrorCodes = map[ErrorCode]struct{}{ CountExceedsLimit: {}, EnvelopeBytesExceedMessageLength: {}, EnvelopeHandlesExceedMessageLength: {}, ExceededMaxOutOfLineDepth: {}, IncorrectHandleType: {}, InvalidBoolean: {}, InvalidEmptyStruct: {}, InvalidInlineBitInEnvelope: {}, InvalidNumBytesInEnvelope: {}, InvalidNumHandlesInEnvelope: {}, InvalidPaddingByte: {}, InvalidPresenceIndicator: {}, MissingRequiredHandleRights: {}, NonEmptyStringWithNullBody: {}, NonEmptyVectorWithNullBody: {}, NonNullableTypeWithNullValue: {}, NonResourceUnknownHandles: {}, StrictBitsUnknownBit: {}, StrictEnumUnknownValue: {}, StrictUnionUnknownField: {}, StringNotUtf8: {}, StringTooLong: {}, TooFewBytes: {}, TooFewBytesInPrimaryObject: {}, TooFewHandles: {}, TooManyBytesInMessage: {}, TooManyHandlesInMessage: {}, UnexpectedOrdinal: {}, UnionFieldNotSet: {}, }
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) (fidlgen.HandleRights, bool)
func HandleSubtypeByName ¶
func HandleSubtypeByName(s string) (fidlgen.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 Record 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 Record Encodings []Encoding HandleDefs []HandleDef BindingsAllowlist *LanguageList BindingsDenylist *LanguageList }
type EncodeFailure ¶
type EncodeFailure struct { Name string Value Record HandleDefs []HandleDef Err ErrorCode BindingsAllowlist *LanguageList BindingsDenylist *LanguageList }
type EncodeSuccess ¶
type EncodeSuccess struct { Name string Value Record 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 ErrorCode ¶
type ErrorCode string
const ( CountExceedsLimit ErrorCode = "COUNT_EXCEEDS_LIMIT" EnvelopeBytesExceedMessageLength ErrorCode = "ENVELOPE_BYTES_EXCEED_MESSAGE_LENGTH" EnvelopeHandlesExceedMessageLength ErrorCode = "ENVELOPE_HANDLES_EXCEED_MESSAGE_LENGTH" ExceededMaxOutOfLineDepth ErrorCode = "EXCEEDED_MAX_OUT_OF_LINE_DEPTH" IncorrectHandleType ErrorCode = "INCORRECT_HANDLE_TYPE" InvalidBoolean ErrorCode = "INVALID_BOOLEAN" InvalidEmptyStruct ErrorCode = "INVALID_EMPTY_STRUCT" InvalidInlineBitInEnvelope ErrorCode = "INVALID_INLINE_BIT_IN_ENVELOPE" InvalidNumBytesInEnvelope ErrorCode = "INVALID_NUM_BYTES_IN_ENVELOPE" InvalidNumHandlesInEnvelope ErrorCode = "INVALID_NUM_HANDLES_IN_ENVELOPE" InvalidPaddingByte ErrorCode = "INVALID_PADDING_BYTE" InvalidPresenceIndicator ErrorCode = "INVALID_PRESENCE_INDICATOR" MissingRequiredHandleRights ErrorCode = "MISSING_REQUIRED_HANDLE_RIGHTS" NonEmptyStringWithNullBody ErrorCode = "NON_EMPTY_STRING_WITH_NULL_BODY" NonEmptyVectorWithNullBody ErrorCode = "NON_EMPTY_VECTOR_WITH_NULL_BODY" NonNullableTypeWithNullValue ErrorCode = "NON_NULLABLE_TYPE_WITH_NULL_VALUE" NonResourceUnknownHandles ErrorCode = "NON_RESOURCE_UNKNOWN_HANDLES" StrictBitsUnknownBit ErrorCode = "STRICT_BITS_UNKNOWN_BIT" StrictEnumUnknownValue ErrorCode = "STRICT_ENUM_UNKNOWN_VALUE" StrictUnionUnknownField ErrorCode = "STRICT_UNION_UNKNOWN_FIELD" StringNotUtf8 ErrorCode = "STRING_NOT_UTF8" StringTooLong ErrorCode = "STRING_TOO_LONG" TooFewBytes ErrorCode = "TOO_FEW_BYTES" TooFewBytesInPrimaryObject ErrorCode = "TOO_FEW_BYTES_IN_PRIMARY_OBJECT" TooFewHandles ErrorCode = "TOO_FEW_HANDLES" TooManyBytesInMessage ErrorCode = "TOO_MANY_BYTES_IN_MESSAGE" TooManyHandlesInMessage ErrorCode = "TOO_MANY_HANDLES_IN_MESSAGE" UnexpectedOrdinal ErrorCode = "UNEXPECTED_ORDINAL" UnionFieldNotSet ErrorCode = "UNION_FIELD_NOT_SET" )
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 fidlgen.HandleSubtype Rights fidlgen.HandleRights }
type HandleDisposition ¶
type HandleDisposition struct { Handle Handle Type fidlgen.ObjectType Rights fidlgen.HandleRights }
type HandleDispositionEncoding ¶
type HandleDispositionEncoding struct { WireFormat WireFormat Bytes []byte HandleDispositions []HandleDisposition }
type HandleWithRights ¶
type HandleWithRights struct { Handle Handle Type fidlgen.ObjectType Rights fidlgen.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 one field set, or no fields set to indicate the // union is default initialized (not all backends support this). 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` or `HandleWithRights` for handles - `Record` for structs, tables, and unions - `[]Value` 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" V2WireFormat WireFormat = "v2" )
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