types

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 7 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) GetValidMethodTypes

func (m Metadata) GetValidMethodTypes(methodsMap map[string]string) error

func (Metadata) MustNotParseString

func (m Metadata) MustNotParseString(key string, conflictValueName string) (string, error)

func (Metadata) MustParseAddress

func (m Metadata) MustParseAddress(key, defaultValue string) (string, int, error)

func (Metadata) MustParseBool

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

func (Metadata) MustParseEnv

func (m Metadata) MustParseEnv(key, envVar, defaultValue string) (string, 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) MustParseStringList

func (m Metadata) MustParseStringList(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 string `json:"metadata,omitempty"`
	Data     []byte `json:"data,omitempty"`
	Channel  string `json:"channel"`
}

func NewRequest

func NewRequest() *Request

func ParseRequest

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

func (*Request) MarshalBinary

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

func (*Request) SetChannel

func (r *Request) SetChannel(value string) *Request

func (*Request) SetData

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

func (*Request) SetMetadata

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

func (*Request) Size

func (r *Request) Size() float64

func (*Request) String

func (r *Request) String() string

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

func (*Request) ToQueueMessage

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

func (*Request) Unmarshal

func (r *Request) Unmarshal(data []byte) error

type Response

type Response struct {
	Metadata string `json:"metadata"`
	Data     []byte `json:"data"`
	IsError  bool   `json:"is_error"`
	Error    string `json:"error"`
}

func NewResponse

func NewResponse() *Response

func ParseResponse

func ParseResponse(body []byte) (*Response, error)

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 ParseResponseFromQueueMessage

func ParseResponseFromQueueMessage(resp *kubemq.QueueMessage) (*Response, error)

func (*Response) MarshalBinary

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

func (*Response) SetData

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

func (*Response) SetError

func (r *Response) SetError(err error) *Response

func (*Response) SetMetadata

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

func (*Response) Size

func (r *Response) Size() float64

func (*Response) String

func (r *Response) String() string

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