Documentation ¶
Index ¶
- func EncodeHeaders(w io.Writer, headers Headers) error
- type BoolValue
- type BytesValue
- type ChecksumError
- type Decoder
- type DecoderOptions
- type Encoder
- type EncoderOptions
- type Header
- type Headers
- type Int16Value
- type Int32Value
- type Int64Value
- type Int8Value
- type LengthError
- type Message
- type StringValue
- type TimestampValue
- type UUIDValue
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoolValue ¶
type BoolValue bool
An BoolValue provides eventstream encoding, and representation of a Go bool value.
type BytesValue ¶
type BytesValue []byte
An BytesValue provides eventstream encoding, and representation of a Go byte slice.
func (BytesValue) String ¶
func (v BytesValue) String() string
type ChecksumError ¶
type ChecksumError struct{}
ChecksumError provides the error for message checksum invalidation errors.
func (ChecksumError) Error ¶
func (e ChecksumError) Error() string
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder provides decoding of an Event Stream messages.
func NewDecoder ¶
func NewDecoder(optFns ...func(*DecoderOptions)) *Decoder
NewDecoder initializes and returns a Decoder for decoding event stream messages from the reader provided.
func (*Decoder) Decode ¶
Decode attempts to decode a single message from the event stream reader. Will return the event stream message, or error if decodeMessage fails to read the message from the stream.
payloadBuf is a byte slice that will be used in the returned Message.Payload. Callers must ensure that the Message.Payload from a previous decode has been consumed before passing in the same underlying payloadBuf byte slice.
type DecoderOptions ¶
DecoderOptions is the Decoder configuration options.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder provides EventStream message encoding.
func NewEncoder ¶
func NewEncoder(optFns ...func(*EncoderOptions)) *Encoder
NewEncoder initializes and returns an Encoder to encode Event Stream messages.
type EncoderOptions ¶
EncoderOptions is the configuration options for Encoder.
type Header ¶
Header is a single EventStream Key Value header pair.
type Headers ¶
type Headers []Header
Headers are a collection of EventStream header values.
func (*Headers) Del ¶
Del deletes the value in the Headers if it exists.
func (Headers) Get ¶
Get returns the Value associated with the header. Nil is returned if the value does not exist.
type Int16Value ¶
type Int16Value int16
An Int16Value provides eventstream encoding, and representation of a Go int16 value.
func (Int16Value) String ¶
func (v Int16Value) String() string
type Int32Value ¶
type Int32Value int32
An Int32Value provides eventstream encoding, and representation of a Go int32 value.
func (Int32Value) String ¶
func (v Int32Value) String() string
type Int64Value ¶
type Int64Value int64
An Int64Value provides eventstream encoding, and representation of a Go int64 value.
func (Int64Value) String ¶
func (v Int64Value) String() string
type Int8Value ¶
type Int8Value int8
An Int8Value provides eventstream encoding, and representation of a Go int8 value.
type LengthError ¶
LengthError provides the error for items being larger than a maximum length.
func (LengthError) Error ¶
func (e LengthError) Error() string
type Message ¶
A Message provides the eventstream message representation.
type StringValue ¶
type StringValue string
An StringValue provides eventstream encoding, and representation of a Go string.
func (StringValue) String ¶
func (v StringValue) String() string
type TimestampValue ¶
An TimestampValue provides eventstream encoding, and representation of a Go timestamp.
func (TimestampValue) Get ¶
func (v TimestampValue) Get() interface{}
Get returns the underlying value.
func (TimestampValue) MarshalJSON ¶
func (v TimestampValue) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface
func (TimestampValue) String ¶
func (v TimestampValue) String() string