types

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseResponseBody

func ParseResponseBody(body []byte) interface{}

Types

type Activity

type Activity struct {
	Id        int64  `storm:"id,increment"`
	Binding   string `storm:"index"`
	CreatedAt time.Time
	Request   *Request
	Response  *Response
	Error     error
}

func NewActivity

func NewActivity() *Activity

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) GetValidSupportedTypes

func (m Metadata) GetValidSupportedTypes(possibleValues map[string]string, typeName 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) MustParseInterfaceMap

func (m Metadata) MustParseInterfaceMap(key string) (map[string]interface{}, 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) ParseInt64 added in v1.8.1

func (m Metadata) ParseInt64(key string, defaultValue int64) int64

func (Metadata) ParseIntWithRange

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

func (Metadata) ParseOSFileMode

func (m Metadata) ParseOSFileMode(key string, defaultValue os.FileMode) os.FileMode

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) ParseTimeDuration

func (m Metadata) ParseTimeDuration(key string, defaultValue int) time.Duration

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,omitempty"`
	Data     []byte   `json:"data,omitempty"`
}

func NewRequest

func NewRequest() *Request

func ParseRequest

func ParseRequest(body []byte) (*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) 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

type Response

type Response struct {
	Metadata Metadata `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 Metadata) *Response

func (*Response) SetMetadataKeyValue

func (r *Response) SetMetadataKeyValue(key, 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) ToQueueStreamMessage

func (r *Response) ToQueueStreamMessage() *queues_stream.QueueMessage

func (*Response) ToResponse

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

type TransportRequest

type TransportRequest struct {
	Metadata Metadata    `json:"metadata,omitempty"`
	Data     interface{} `json:"data,omitempty"`
}

func NewTransportRequest

func NewTransportRequest() *TransportRequest

func (*TransportRequest) MarshalBinary

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

func (*TransportRequest) SetData

func (r *TransportRequest) SetData(value interface{}) *TransportRequest

func (*TransportRequest) SetMetadata

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

func (*TransportRequest) SetMetadataKeyValue

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

func (*TransportRequest) ToEvent

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

Jump to

Keyboard shortcuts

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