marshal

package
v0.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package marshal documents marshaling interfaces.

User defined marshaler/unmarshalers can be defined for any scalar EdgeDB type except arrays. They must implement the interface for their type. For example a custom int64 unmarshaler should implement Int64Unmarshaler.

Optional Fields

When shape fields in a query result are optional (not required) the client requires the out value's optional fields to implement OptionalUnmarshaler. For scalar types, this means that the field value will need to implement a custom marshaler interface i.e. Int64Unmarshaler AND OptionalUnmarshaler. For shapes, only OptionalUnmarshaler needs to be implemented.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigIntMarshaler added in v0.8.0

type BigIntMarshaler interface {
	MarshalEdgeDBBigInt() ([]byte, error)
}

BigIntMarshaler is the interface implemented by an object that can marshal itself into the bigint wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-bigint

MarshalEdgeDBBigInt encodes the receiver into a binary form and returns the result.

type BigIntUnmarshaler added in v0.8.0

type BigIntUnmarshaler interface {
	UnmarshalEdgeDBBigInt(data []byte) error
}

BigIntUnmarshaler is the interface implemented by an object that can unmarshal the bigint wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-bigint

UnmarshalEdgeDBBigInt must be able to decode the bigint wire format. UnmarshalEdgeDBBigInt must copy the data if it wishes to retain the data after returning.

type BoolMarshaler added in v0.8.0

type BoolMarshaler interface {
	MarshalEdgeDBBool() ([]byte, error)
}

BoolMarshaler is the interface implemented by an object that can marshal itself into the bool wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-bool

MarshalEdgeDBBool encodes the receiver into a binary form and returns the result.

type BoolUnmarshaler added in v0.8.0

type BoolUnmarshaler interface {
	UnmarshalEdgeDBBool(data []byte) error
}

BoolUnmarshaler is the interface implemented by an object that can unmarshal the bool wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-bool

UnmarshalEdgeDBBool must be able to decode the bool wire format. UnmarshalEdgeDBBool must copy the data if it wishes to retain the data after returning.

type BytesMarshaler added in v0.8.0

type BytesMarshaler interface {
	MarshalEdgeDBBytes() ([]byte, error)
}

BytesMarshaler is the interface implemented by an object that can marshal itself into the bytes wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-bytes

MarshalEdgeDBBytes encodes the receiver into a binary form and returns the result.

type BytesUnmarshaler added in v0.8.0

type BytesUnmarshaler interface {
	UnmarshalEdgeDBBytes(data []byte) error
}

BytesUnmarshaler is the interface implemented by an object that can unmarshal the bytes wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-bytes

UnmarshalEdgeDBBytes must be able to decode the bytes wire format. UnmarshalEdgeDBBytes must copy the data if it wishes to retain the data after returning.

type DateDurationMarshaler added in v0.12.0

type DateDurationMarshaler interface {
	MarshalEdgeDBDateDuration() ([]byte, error)
}

DateDurationMarshaler is the interface implemented by an object that can marshal itself into the cal::relative_duration wire format. https://www.edgedb.com/docs/internals/protocol/dataformats

MarshalEdgeDBDateDuration encodes the receiver into a binary form and returns the result.

type DateDurationUnmarshaler added in v0.12.0

type DateDurationUnmarshaler interface {
	UnmarshalEdgeDBDateDuration(data []byte) error
}

DateDurationUnmarshaler is the interface implemented by an object that can unmarshal the cal::relative_duration wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-duration

UnmarshalEdgeDBDateDuration must be able to decode the cal::relative_duration wire format. UnmarshalEdgeDBDateDuration must copy the data if it wishes to retain the data after returning.

type DateTimeMarshaler added in v0.8.0

type DateTimeMarshaler interface {
	MarshalEdgeDBDateTime() ([]byte, error)
}

DateTimeMarshaler is the interface implemented by an object that can marshal itself into the datetime wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-datetime

MarshalEdgeDBDateTime encodes the receiver into a binary form and returns the result.

type DateTimeUnmarshaler added in v0.8.0

type DateTimeUnmarshaler interface {
	UnmarshalEdgeDBDateTime(data []byte) error
}

DateTimeUnmarshaler is the interface implemented by an object that can unmarshal the datetime wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-datetime

UnmarshalEdgeDBDateTime must be able to decode the datetime wire format. UnmarshalEdgeDBDateTime must copy the data if it wishes to retain the data after returning.

type DecimalMarshaler added in v0.8.0

type DecimalMarshaler interface {
	MarshalEdgeDBDecimal() ([]byte, error)
}

DecimalMarshaler is the interface implemented by an object that can marshal itself into the decimal wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-decimal

MarshalEdgeDBDecimal encodes the receiver into a binary form and returns the result.

type DecimalUnmarshaler added in v0.8.0

type DecimalUnmarshaler interface {
	UnmarshalEdgeDBDecimal(data []byte) error
}

DecimalUnmarshaler is the interface implemented by an object that can unmarshal the decimal wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-decimal

UnmarshalEdgeDBDecimal must be able to decode the decimal wire format. UnmarshalEdgeDBDecimal must copy the data if it wishes to retain the data after returning.

type DurationMarshaler added in v0.8.0

type DurationMarshaler interface {
	MarshalEdgeDBDuration() ([]byte, error)
}

DurationMarshaler is the interface implemented by an object that can marshal itself into the duration wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-duration

MarshalEdgeDBDuration encodes the receiver into a binary form and returns the result.

type DurationUnmarshaler added in v0.8.0

type DurationUnmarshaler interface {
	UnmarshalEdgeDBDuration(data []byte) error
}

DurationUnmarshaler is the interface implemented by an object that can unmarshal the duration wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-duration

UnmarshalEdgeDBDuration must be able to decode the duration wire format. UnmarshalEdgeDBDuration must copy the data if it wishes to retain the data after returning.

type Float32Marshaler added in v0.8.0

type Float32Marshaler interface {
	MarshalEdgeDBFloat32() ([]byte, error)
}

Float32Marshaler is the interface implemented by an object that can marshal itself into the float32 wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-float32

MarshalEdgeDBFloat32 encodes the receiver into a binary form and returns the result.

type Float32Unmarshaler added in v0.8.0

type Float32Unmarshaler interface {
	UnmarshalEdgeDBFloat32(data []byte) error
}

Float32Unmarshaler is the interface implemented by an object that can unmarshal the float32 wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-float32

UnmarshalEdgeDBFloat32 must be able to decode the float32 wire format. UnmarshalEdgeDBFloat32 must copy the data if it wishes to retain the data after returning.

type Float64Marshaler added in v0.8.0

type Float64Marshaler interface {
	MarshalEdgeDBFloat64() ([]byte, error)
}

Float64Marshaler is the interface implemented by an object that can marshal itself into the float64 wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-float64

MarshalEdgeDBFloat64 encodes the receiver into a binary form and returns the result.

type Float64Unmarshaler added in v0.8.0

type Float64Unmarshaler interface {
	UnmarshalEdgeDBFloat64(data []byte) error
}

Float64Unmarshaler is the interface implemented by an object that can unmarshal the float64 wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-float64

UnmarshalEdgeDBFloat64 must be able to decode the float64 wire format. UnmarshalEdgeDBFloat64 must copy the data if it wishes to retain the data after returning.

type Int16Marshaler added in v0.8.0

type Int16Marshaler interface {
	MarshalEdgeDBInt16() ([]byte, error)
}

Int16Marshaler is the interface implemented by an object that can marshal itself into the int16 wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-int16

MarshalEdgeDBInt16 encodes the receiver into a binary form and returns the result.

type Int16Unmarshaler added in v0.8.0

type Int16Unmarshaler interface {
	UnmarshalEdgeDBInt16(data []byte) error
}

Int16Unmarshaler is the interface implemented by an object that can unmarshal the int16 wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-int16

UnmarshalEdgeDBInt16 must be able to decode the int16 wire format. UnmarshalEdgeDBInt16 must copy the data if it wishes to retain the data after returning.

type Int32Marshaler added in v0.8.0

type Int32Marshaler interface {
	MarshalEdgeDBInt32() ([]byte, error)
}

Int32Marshaler is the interface implemented by an object that can marshal itself into the int32 wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-int32

MarshalEdgeDBInt32 encodes the receiver into a binary form and returns the result.

type Int32Unmarshaler added in v0.8.0

type Int32Unmarshaler interface {
	UnmarshalEdgeDBInt32(data []byte) error
}

Int32Unmarshaler is the interface implemented by an object that can unmarshal the int32 wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-int32

UnmarshalEdgeDBInt32 must be able to decode the int32 wire format. UnmarshalEdgeDBInt32 must copy the data if it wishes to retain the data after returning.

type Int64Marshaler added in v0.8.0

type Int64Marshaler interface {
	MarshalEdgeDBInt64() ([]byte, error)
}

Int64Marshaler is the interface implemented by an object that can marshal itself into the int64 wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-int64

MarshalEdgeDBInt64 encodes the receiver into a binary form and returns the result.

type Int64Unmarshaler added in v0.8.0

type Int64Unmarshaler interface {
	UnmarshalEdgeDBInt64(data []byte) error
}

Int64Unmarshaler is the interface implemented by an object that can unmarshal the int64 wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-int64

UnmarshalEdgeDBInt64 must be able to decode the int64 wire format. UnmarshalEdgeDBInt64 must copy the data if it wishes to retain the data after returning.

type JSONMarshaler added in v0.8.0

type JSONMarshaler interface {
	MarshalEdgeDBJSON() ([]byte, error)
}

JSONMarshaler is the interface implemented by an object that can marshal itself into the json wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-json

MarshalEdgeDBJSON encodes the receiver into a binary form and returns the result.

type JSONUnmarshaler added in v0.8.0

type JSONUnmarshaler interface {
	UnmarshalEdgeDBJSON(data []byte) error
}

JSONUnmarshaler is the interface implemented by an object that can unmarshal the json wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-json

UnmarshalEdgeDBJSON must be able to decode the json wire format. UnmarshalEdgeDBJSON must copy the data if it wishes to retain the data after returning.

type LocalDateMarshaler added in v0.8.0

type LocalDateMarshaler interface {
	MarshalEdgeDBLocalDate() ([]byte, error)
}

LocalDateMarshaler is the interface implemented by an object that can marshal itself into the local_date wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-local-date

MarshalEdgeDBLocalDate encodes the receiver into a binary form and returns the result.

type LocalDateTimeMarshaler added in v0.8.0

type LocalDateTimeMarshaler interface {
	MarshalEdgeDBLocalDateTime() ([]byte, error)
}

LocalDateTimeMarshaler is the interface implemented by an object that can marshal itself into the local_datetime wire format. https://www.edgedb.com/docs/internals/protocol/dataformats

MarshalEdgeDBLocalDateTime encodes the receiver into a binary form and returns the result.

type LocalDateTimeUnmarshaler added in v0.8.0

type LocalDateTimeUnmarshaler interface {
	UnmarshalEdgeDBLocalDateTime(data []byte) error
}

LocalDateTimeUnmarshaler is the interface implemented by an object that can unmarshal the local_datetime wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats

UnmarshalEdgeDBLocalDateTime must be able to decode the local_datetime wire format. UnmarshalEdgeDBLocalDateTime must copy the data if it wishes to retain the data after returning.

type LocalDateUnmarshaler added in v0.8.0

type LocalDateUnmarshaler interface {
	UnmarshalEdgeDBLocalDate(data []byte) error
}

LocalDateUnmarshaler is the interface implemented by an object that can unmarshal the local_date wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-local-date

UnmarshalEdgeDBLocalDate must be able to decode the local_date wire format. UnmarshalEdgeDBLocalDate must copy the data if it wishes to retain the data after returning.

type LocalTimeMarshaler added in v0.8.0

type LocalTimeMarshaler interface {
	MarshalEdgeDBLocalTime() ([]byte, error)
}

LocalTimeMarshaler is the interface implemented by an object that can marshal itself into the local_time wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-local-time

MarshalEdgeDBLocalTime encodes the receiver into a binary form and returns the result.

type LocalTimeUnmarshaler added in v0.8.0

type LocalTimeUnmarshaler interface {
	UnmarshalEdgeDBLocalTime(data []byte) error
}

LocalTimeUnmarshaler is the interface implemented by an object that can unmarshal the local_time wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-local-time

UnmarshalEdgeDBLocalTime must be able to decode the local_time wire format. UnmarshalEdgeDBLocalTime must copy the data if it wishes to retain the data after returning.

type MemoryMarshaler added in v0.9.0

type MemoryMarshaler interface {
	MarshalEdgeDBMemory() ([]byte, error)
}

MemoryMarshaler is the interface implemented by an object that can marshal itself into the memory wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-memory

MarshalEdgeDBMemory encodes the receiver into a binary form and returns the result.

type MemoryUnmarshaler added in v0.9.0

type MemoryUnmarshaler interface {
	UnmarshalEdgeDBMemory(data []byte) error
}

MemoryUnmarshaler is the interface implemented by an object that can unmarshal the memory wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-memory

UnmarshalEdgeDBMemory must be able to decode the memory wire format. UnmarshalEdgeDBMemory must copy the data if it wishes to retain the data after returning.

type OptionalMarshaler added in v0.8.2

type OptionalMarshaler interface {
	// Missing returns true when the value is missing.
	Missing() bool
}

OptionalMarshaler is used for optional (not required) shape field values.

type OptionalScalarUnmarshaler added in v0.11.0

type OptionalScalarUnmarshaler interface {
	Unset()
}

OptionalScalarUnmarshaler is implemented by optional scalar types.

type OptionalUnmarshaler added in v0.8.0

type OptionalUnmarshaler interface {
	// SetMissing is call with true when the value is missing and false when
	// the value is present.
	SetMissing(bool)
}

OptionalUnmarshaler is used for optional (not required) shape field values.

type RelativeDurationMarshaler added in v0.8.0

type RelativeDurationMarshaler interface {
	MarshalEdgeDBRelativeDuration() ([]byte, error)
}

RelativeDurationMarshaler is the interface implemented by an object that can marshal itself into the cal::relative_duration wire format. https://www.edgedb.com/docs/internals/protocol/dataformats

MarshalEdgeDBRelativeDuration encodes the receiver into a binary form and returns the result.

type RelativeDurationUnmarshaler added in v0.8.0

type RelativeDurationUnmarshaler interface {
	UnmarshalEdgeDBRelativeDuration(data []byte) error
}

RelativeDurationUnmarshaler is the interface implemented by an object that can unmarshal the cal::relative_duration wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-duration

UnmarshalEdgeDBRelativeDuration must be able to decode the cal::relative_duration wire format. UnmarshalEdgeDBRelativeDuration must copy the data if it wishes to retain the data after returning.

type StrMarshaler added in v0.8.0

type StrMarshaler interface {
	MarshalEdgeDBStr() ([]byte, error)
}

StrMarshaler is the interface implemented by an object that can marshal itself into the str wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-str

MarshalEdgeDBStr encodes the receiver into a binary form and returns the result.

type StrUnmarshaler added in v0.8.0

type StrUnmarshaler interface {
	UnmarshalEdgeDBStr(data []byte) error
}

StrUnmarshaler is the interface implemented by an object that can unmarshal the str wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-str

UnmarshalEdgeDBStr must be able to decode the str wire format. UnmarshalEdgeDBStr must copy the data if it wishes to retain the data after returning.

type UUIDMarshaler added in v0.8.0

type UUIDMarshaler interface {
	MarshalEdgeDBUUID() ([]byte, error)
}

UUIDMarshaler is the interface implemented by an object that can marshal itself into the uuid wire format. https://www.edgedb.com/docs/internals/protocol/dataformats#std-uuid

MarshalEdgeDBUUID encodes the receiver into a binary form and returns the result.

type UUIDUnmarshaler added in v0.8.0

type UUIDUnmarshaler interface {
	UnmarshalEdgeDBUUID(data []byte) error
}

UUIDUnmarshaler is the interface implemented by an object that can unmarshal the uuid wire format representation of itself. https://www.edgedb.com/docs/internals/protocol/dataformats#std-uuid

UnmarshalEdgeDBUUID must be able to decode the uuid wire format. UnmarshalEdgeDBUUID must copy the data if it wishes to retain the data after returning.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL