Documentation ¶
Index ¶
- type Decoder
- type Encoder
- type Message
- func (r *Message) Accept() (secoapcore.MediaType, error)
- func (r *Message) AddETag(value []byte) error
- func (r *Message) AddOptionBytes(opt secoapcore.OptionID, value []byte)
- func (r *Message) AddOptionUint32(opt secoapcore.OptionID, value uint32)
- func (r *Message) AddOptstring(opt secoapcore.OptionID, value string)
- func (r *Message) AddQuery(query string)
- func (r *Message) Analyse() string
- func (r *Message) Body() io.ReadSeeker
- func (r *Message) BodySize() (int64, error)
- func (r *Message) Clone(msg *Message) error
- func (r *Message) Code() secoapcore.Code
- func (r *Message) ContentFormat() (secoapcore.MediaType, error)
- func (r *Message) Context() context.Context
- func (r *Message) ETag() ([]byte, error)
- func (r *Message) ETags(b [][]byte) (int, error)
- func (r *Message) EncoderID() int32
- func (r *Message) EncoderType() int32
- func (r *Message) GetOptionAllBytes(id secoapcore.OptionID, b [][]byte) (int, error)
- func (r *Message) GetOptionBytes(id secoapcore.OptionID) ([]byte, error)
- func (r *Message) GetOptionUint32(id secoapcore.OptionID) (uint32, error)
- func (r *Message) HasOption(id secoapcore.OptionID) bool
- func (r *Message) Hijack()
- func (r *Message) IsHijacked() bool
- func (r *Message) IsModified() bool
- func (r *Message) IsSeparateMessage() bool
- func (r *Message) MarshalWithEncoder(encoder Encoder) ([]byte, error)
- func (r *Message) MessageID() int32
- func (r *Message) MustSetPath(p string)
- func (r *Message) Observe() (uint32, error)
- func (r *Message) Opts() secoapcore.Options
- func (r *Message) Path() (string, error)
- func (r *Message) Queries() ([]string, error)
- func (r *Message) ReadBody() ([]byte, error)
- func (r *Message) Remove(opt secoapcore.OptionID)
- func (r *Message) Reset()
- func (r *Message) ResetOptsTo(in secoapcore.Options)
- func (r *Message) Sequence() uint64
- func (r *Message) SetAccept(contentFormat secoapcore.MediaType)
- func (r *Message) SetBody(s io.ReadSeeker)
- func (r *Message) SetCode(code secoapcore.Code)
- func (r *Message) SetContentFormat(contentFormat secoapcore.MediaType)
- func (r *Message) SetContext(ctx context.Context)
- func (r *Message) SetETag(value []byte) error
- func (r *Message) SetEncoderID(eid int32)
- func (r *Message) SetEncoderType(etp int32)
- func (r *Message) SetMessage(message secoapcore.Message)
- func (r *Message) SetMessageID(mid int32)
- func (r *Message) SetModified(b bool)
- func (r *Message) SetObserve(observe uint32)
- func (r *Message) SetOptionBytes(opt secoapcore.OptionID, value []byte)
- func (r *Message) SetOptionUint32(opt secoapcore.OptionID, value uint32)
- func (r *Message) SetOptstring(opt secoapcore.OptionID, value string)
- func (r *Message) SetPath(p string) error
- func (r *Message) SetSequence(seq uint64)
- func (r *Message) SetToken(token secoapcore.Token)
- func (r *Message) SetType(typ secoapcore.Type)
- func (r *Message) SetVersion(ver secoapcore.Ver)
- func (r *Message) SetupDelete(path string, token secoapcore.Token, opts ...secoapcore.Option) error
- func (r *Message) SetupGet(path string, token secoapcore.Token, opts ...secoapcore.Option) error
- func (r *Message) SetupPost(path string, token secoapcore.Token, contentFormat secoapcore.MediaType, ...) error
- func (r *Message) SetupPut(path string, token secoapcore.Token, contentFormat secoapcore.MediaType, ...) error
- func (r *Message) String() string
- func (r *Message) ToSecoapCoreMessage() (secoapcore.Message, error)
- func (r *Message) Token() secoapcore.Token
- func (r *Message) Type() secoapcore.Type
- func (r *Message) UnmarshalWithDecoder(decoder Decoder, data []byte) (int, error)
- func (r *Message) UpsertEncoderID(eid int32)
- func (r *Message) UpsertEncoderType(etp int32)
- func (r *Message) UpsertMessageID(mid int32)
- func (r *Message) UpsertType(typ secoapcore.Type)
- func (r *Message) UpsertVersion(ver secoapcore.Ver)
- func (r *Message) Version() secoapcore.Ver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder interface { Size(m secoapcore.Message) (int, error) Encode(m secoapcore.Message, buf []byte) (int, error) }
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
func (*Message) Accept ¶
func (r *Message) Accept() (secoapcore.MediaType, error)
Accept get's accept option.
func (*Message) AddETag ¶
AddETag appends value to existing ETags.
Option definition: - format: opaque, length: 1-8, repeatable
func (*Message) AddOptionBytes ¶
func (r *Message) AddOptionBytes(opt secoapcore.OptionID, value []byte)
func (*Message) AddOptionUint32 ¶
func (r *Message) AddOptionUint32(opt secoapcore.OptionID, value uint32)
func (*Message) AddOptstring ¶
func (r *Message) AddOptstring(opt secoapcore.OptionID, value string)
func (*Message) Body ¶
func (r *Message) Body() io.ReadSeeker
func (*Message) Code ¶
func (r *Message) Code() secoapcore.Code
func (*Message) ContentFormat ¶
func (r *Message) ContentFormat() (secoapcore.MediaType, error)
func (*Message) ETags ¶
ETags returns all ETag values
Writes ETag values to output array, returns number of written values or error.
func (*Message) EncoderType ¶ added in v1.0.5
func (*Message) GetOptionAllBytes ¶
GetOptionAllBytes gets array of bytes of all opts with given ID.
func (*Message) GetOptionBytes ¶
func (r *Message) GetOptionBytes(id secoapcore.OptionID) ([]byte, error)
GetOptionBytes gets bytes of the first option with given ID.
func (*Message) GetOptionUint32 ¶
func (r *Message) GetOptionUint32(id secoapcore.OptionID) (uint32, error)
func (*Message) IsHijacked ¶
func (*Message) IsModified ¶
func (*Message) IsSeparateMessage ¶
func (*Message) MarshalWithEncoder ¶
func (*Message) MustSetPath ¶
MustSetPath calls SetPath and panics if it returns an error.
func (*Message) Opts ¶
func (r *Message) Opts() secoapcore.Options
func (*Message) Remove ¶
func (r *Message) Remove(opt secoapcore.OptionID)
func (*Message) ResetOptsTo ¶
func (r *Message) ResetOptsTo(in secoapcore.Options)
func (*Message) SetAccept ¶
func (r *Message) SetAccept(contentFormat secoapcore.MediaType)
SetAccept set's accept option.
func (*Message) SetBody ¶
func (r *Message) SetBody(s io.ReadSeeker)
func (*Message) SetCode ¶
func (r *Message) SetCode(code secoapcore.Code)
func (*Message) SetContentFormat ¶
func (r *Message) SetContentFormat(contentFormat secoapcore.MediaType)
func (*Message) SetContext ¶
func (*Message) SetETag ¶
SetETag inserts/replaces ETag option(s).
After a successful call only a single ETag value will remain.
func (*Message) SetEncoderID ¶ added in v1.0.5
func (*Message) SetEncoderType ¶ added in v1.0.5
func (*Message) SetMessage ¶
func (r *Message) SetMessage(message secoapcore.Message)
func (*Message) SetMessageID ¶
SetMessageID only 0 to 2^16-1 are valid.
func (*Message) SetModified ¶
func (*Message) SetObserve ¶
func (*Message) SetOptionBytes ¶
func (r *Message) SetOptionBytes(opt secoapcore.OptionID, value []byte)
func (*Message) SetOptionUint32 ¶
func (r *Message) SetOptionUint32(opt secoapcore.OptionID, value uint32)
func (*Message) SetOptstring ¶
func (r *Message) SetOptstring(opt secoapcore.OptionID, value string)
func (*Message) SetPath ¶
SetPath stores the given path within URI-Path opts.
The value is stored by the algorithm described in RFC7252 and using the internal buffer. If the path is too long, but valid (URI-Path segments must have maximal length of 255) the internal buffer is expanded. If the path is too long, but not valid then the function returns ErrInvalidValueLength error.
func (*Message) SetSequence ¶
func (*Message) SetToken ¶
func (r *Message) SetToken(token secoapcore.Token)
func (*Message) SetType ¶
func (r *Message) SetType(typ secoapcore.Type)
func (*Message) SetVersion ¶ added in v1.0.5
func (r *Message) SetVersion(ver secoapcore.Ver)
SetVersion only 0 to 2^2-1 are valid.
func (*Message) SetupDelete ¶
func (r *Message) SetupDelete(path string, token secoapcore.Token, opts ...secoapcore.Option) error
func (*Message) SetupGet ¶
func (r *Message) SetupGet(path string, token secoapcore.Token, opts ...secoapcore.Option) error
func (*Message) SetupPost ¶
func (r *Message) SetupPost(path string, token secoapcore.Token, contentFormat secoapcore.MediaType, payload io.ReadSeeker, opts ...secoapcore.Option) error
func (*Message) SetupPut ¶
func (r *Message) SetupPut(path string, token secoapcore.Token, contentFormat secoapcore.MediaType, payload io.ReadSeeker, opts ...secoapcore.Option) error
func (*Message) ToSecoapCoreMessage ¶ added in v1.0.8
func (r *Message) ToSecoapCoreMessage() (secoapcore.Message, error)
func (*Message) Token ¶
func (r *Message) Token() secoapcore.Token
func (*Message) Type ¶
func (r *Message) Type() secoapcore.Type
func (*Message) UnmarshalWithDecoder ¶
func (*Message) UpsertEncoderID ¶ added in v1.0.5
func (*Message) UpsertEncoderType ¶ added in v1.0.5
func (*Message) UpsertMessageID ¶
UpsertMessageID set value only when origin value is invalid. Only 0 to 2^16-1 values are valid.
func (*Message) UpsertType ¶
func (r *Message) UpsertType(typ secoapcore.Type)
UpsertType set value only when origin value is invalid. Only 0 to 2^8-1 values are valid.
func (*Message) UpsertVersion ¶ added in v1.0.5
func (r *Message) UpsertVersion(ver secoapcore.Ver)
func (*Message) Version ¶ added in v1.0.5
func (r *Message) Version() secoapcore.Ver