types

package
v0.0.0-...-b6065f0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata map[string]string

func NewMetadata

func NewMetadata() Metadata

func UnmarshallMetadata

func UnmarshallMetadata(meta string) (Metadata, error)

func (Metadata) Get

func (m Metadata) Get(key string) string

func (Metadata) MustParseBool

func (m Metadata) MustParseBool(key string) (bool, error)

func (Metadata) MustParseInt

func (m Metadata) MustParseInt(key string) (int, error)

func (Metadata) MustParseIntWithRange

func (m Metadata) MustParseIntWithRange(key string, min, max int) (int, error)

func (Metadata) MustParseJsonMap

func (m Metadata) MustParseJsonMap(key string) (map[string]string, error)

func (Metadata) MustParseString

func (m Metadata) MustParseString(key string) (string, error)

func (Metadata) ParseBool

func (m Metadata) ParseBool(key string, defaultValue bool) bool

func (Metadata) ParseInt

func (m Metadata) ParseInt(key string, defaultValue int) int

func (Metadata) ParseIntWithRange

func (m Metadata) ParseIntWithRange(key string, defaultValue, min, max int) (int, error)

func (Metadata) ParseString

func (m Metadata) ParseString(key, defaultValue string) string

func (Metadata) ParseStringMap

func (m Metadata) ParseStringMap(key string, stringMap map[string]string) (string, error)

func (Metadata) Set

func (m Metadata) Set(key, value string) Metadata

func (Metadata) String

func (m Metadata) String() string

type Request

type Request struct {
	Metadata Metadata `json:"metadata"`
	Data     []byte   `json:"data"`
}

func NewRequest

func NewRequest() *Request

func ParseRequest

func ParseRequest(body []byte) (*Request, error)

func ParseRequestFromCommand

func ParseRequestFromCommand(cmd *kubemq.Command) (*Request, error)

func ParseRequestFromCommandReceive

func ParseRequestFromCommandReceive(cmd *kubemq.CommandReceive) (*Request, error)

func ParseRequestFromEvent

func ParseRequestFromEvent(event *kubemq.Event) (*Request, error)

func ParseRequestFromEventStore

func ParseRequestFromEventStore(event *kubemq.EventStore) (*Request, error)

func ParseRequestFromEventStoreReceive

func ParseRequestFromEventStoreReceive(event *kubemq.EventStoreReceive) (*Request, error)

func ParseRequestFromQuery

func ParseRequestFromQuery(query *kubemq.Query) (*Request, error)

func ParseRequestFromQueryReceive

func ParseRequestFromQueryReceive(query *kubemq.QueryReceive) (*Request, error)

func ParseRequestFromQueueMessage

func ParseRequestFromQueueMessage(msg *kubemq.QueueMessage) (*Request, error)

func (*Request) MarshalBinary

func (r *Request) MarshalBinary() []byte

func (*Request) SetData

func (r *Request) SetData(value []byte) *Request

func (*Request) SetMetadata

func (r *Request) SetMetadata(value Metadata) *Request

func (*Request) SetMetadataKeyValue

func (r *Request) SetMetadataKeyValue(key, value string) *Request

func (*Request) ToCommand

func (r *Request) ToCommand() *kubemq.Command

func (*Request) ToEvent

func (r *Request) ToEvent() *kubemq.Event

func (*Request) ToEventStore

func (r *Request) ToEventStore() *kubemq.EventStore

func (*Request) ToQuery

func (r *Request) ToQuery() *kubemq.Query

type Response

type Response struct {
	Metadata Metadata `json:"metadata"`
	Data     []byte   `json:"data"`
}

func NewResponse

func NewResponse() *Response

func ParseResponseFromCommandResponse

func ParseResponseFromCommandResponse(resp *kubemq.CommandResponse) (*Response, error)

func ParseResponseFromEvent

func ParseResponseFromEvent(event *kubemq.Event) (*Response, error)

func ParseResponseFromEventReceive

func ParseResponseFromEventReceive(event *kubemq.EventStoreReceive) (*Response, error)

func ParseResponseFromQueryResponse

func ParseResponseFromQueryResponse(resp *kubemq.QueryResponse) (*Response, error)

func (*Response) SetData

func (r *Response) SetData(value []byte) *Response

func (*Response) SetMetadata

func (r *Response) SetMetadata(value Metadata) *Response

func (*Response) SetMetadataKeyValue

func (r *Response) SetMetadataKeyValue(key, value string) *Response

func (*Response) ToCommand

func (r *Response) ToCommand() *kubemq.Command

func (*Response) ToEvent

func (r *Response) ToEvent() *kubemq.Event

func (*Response) ToEventStore

func (r *Response) ToEventStore() *kubemq.EventStore

func (*Response) ToQuery

func (r *Response) ToQuery() *kubemq.Query

func (*Response) ToQueueMessage

func (r *Response) ToQueueMessage() *kubemq.QueueMessage

func (*Response) ToResponse

func (r *Response) ToResponse() *kubemq.Response

Jump to

Keyboard shortcuts

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