Documentation
¶
Index ¶
- Variables
- func MonitorHandlerFunc(ctx context.Context, c echo.Context) error
- func NewEventsMonitor(ctx context.Context, dataChan chan *Transport, monitorRequest *MonitorRequest, ...)
- func NewQueueMessagesMonitor(ctx context.Context, dataChan chan *Transport, monitorRequest *MonitorRequest, ...)
- func NewReferenceCountedPool(factory func(referenceCounter ReferenceCounter) ReferenceCountable, ...) *referenceCountedPool
- func NewRequestResponseMonitor(ctx context.Context, dataChan chan *Transport, monitorRequest *MonitorRequest, ...)
- func ResetTransport(i interface{}) error
- func TransformToDtoString(tr *Transport) (string, error)
- type Middleware
- type MiddlewareMessage
- type MonitorRequest
- type ReferenceCountable
- type ReferenceCounter
- type ResponseError
- type Transport
- func NewTransport() *Transport
- func NewTransportFromMessage(v *pb.Event) *Transport
- func NewTransportFromMessageReceived(v *pb.EventReceive) *Transport
- func NewTransportFromQueueMessage(v *pb.QueueMessage) *Transport
- func NewTransportFromRequest(v *pb.Request) *Transport
- func NewTransportFromRequestAndResponse(v1 *pb.Request, v2 *pb.Response) *Transport
- func NewTransportFromResponse(v *pb.Response) *Transport
- func NewTransportFromResponseError(v *ResponseError) *Transport
- func (t *Transport) Finish()
- func (t *Transport) Reset()
- func (t *Transport) SetClient(clientID string) *Transport
- func (t *Transport) SetClient2(clientID string) *Transport
- func (t *Transport) SetError(err error) *Transport
- func (t *Transport) SetLatency(value float64) *Transport
- func (t *Transport) SetPayload(v interface{}) *Transport
- func (t *Transport) SetSubKind(v string) *Transport
- func (t *Transport) String() string
- func (t *Transport) Unmarshal(v interface{}) error
- type TransportBatch
- type TransportPubSubMessageDto
- type TransportQueueMessageDto
- type TransportRequestMessageDto
- type TransportResponseErrorMessageDto
- type TransportResponseMessageDto
Constants ¶
This section is empty.
Variables ¶
View Source
var TransportPool = NewReferenceCountedPool( func(counter ReferenceCounter) ReferenceCountable { br := new(Transport) br.ReferenceCounter = counter return br }, ResetTransport)
Functions ¶
func MonitorHandlerFunc ¶
func NewEventsMonitor ¶
func NewEventsMonitor(ctx context.Context, dataChan chan *Transport, monitorRequest *MonitorRequest, errChan chan error)
func NewQueueMessagesMonitor ¶
func NewQueueMessagesMonitor(ctx context.Context, dataChan chan *Transport, monitorRequest *MonitorRequest, errChan chan error)
func NewReferenceCountedPool ¶
func NewReferenceCountedPool(factory func(referenceCounter ReferenceCounter) ReferenceCountable, reset func(interface{}) error) *referenceCountedPool
Method to create a new pool
func NewRequestResponseMonitor ¶
func NewRequestResponseMonitor(ctx context.Context, dataChan chan *Transport, monitorRequest *MonitorRequest, errChan chan error)
func ResetTransport ¶
func ResetTransport(i interface{}) error
func TransformToDtoString ¶
Types ¶
type Middleware ¶
type Middleware struct { Stopped chan struct{} // contains filtered or unexported fields }
func NewMonitorMiddleware ¶
func (*Middleware) CheckAndSendCommand ¶
func (*Middleware) CheckAndSendQuery ¶
func (*Middleware) Shutdown ¶
func (md *Middleware) Shutdown()
type MiddlewareMessage ¶
type MiddlewareMessage struct { Kind string `json:"kind"` MonitoredChannel string `json:"monitored_channel"` PublishChannel string `json:"publish_channel"` }
func NewMiddlewareMessage ¶
func NewMiddlewareMessage(msg *pb.EventReceive) *MiddlewareMessage
type MonitorRequest ¶
type ReferenceCountable ¶
type ReferenceCountable interface { // Method to set the current instance SetInstance(i interface{}) // Method to increment the reference count IncrementReferenceCount() // Method to decrement reference count DecrementReferenceCount() }
type ReferenceCounter ¶
type ReferenceCounter struct { Instance interface{} // contains filtered or unexported fields }
func (ReferenceCounter) DecrementReferenceCount ¶
func (r ReferenceCounter) DecrementReferenceCount()
Method to decrement a reference If the reference count goes to zero, the object is put back inside the pool
func (ReferenceCounter) IncrementReferenceCount ¶
func (r ReferenceCounter) IncrementReferenceCount()
Method to increment a reference
func (*ReferenceCounter) SetInstance ¶
func (r *ReferenceCounter) SetInstance(i interface{})
Method to set the current instance
type ResponseError ¶
type ResponseError struct { Kind string `json:"kind"` RequestID string `json:"request_id"` Error string `json:"error"` }
func NewResponseErrorFromRequest ¶
func NewResponseErrorFromRequest(v *pb.Request, err error) *ResponseError
func (*ResponseError) JsonString ¶
func (re *ResponseError) JsonString() string
type Transport ¶
type Transport struct { ReferenceCounter `sql:"-"` ClientID string `json:"client_id"` Channel string `json:"channel"` Kind string `json:"kind"` SubKind string `json:"sub_kind"` Error error `json:"error"` Payload []byte `json:"payload"` BodySize float32 `json:"payload_size"` BodySize2 float32 `json:"body_size_2"` CacheKeyExist bool `json:"cache_key_exist"` CacheHit bool `json:"cache_hit"` ResponseEmpty bool `json:"response_empty"` ClientID2 string `json:"client_id_2"` Latency float64 `json:"latency"` }
func NewTransport ¶
func NewTransport() *Transport
func NewTransportFromMessage ¶
func NewTransportFromMessageReceived ¶
func NewTransportFromMessageReceived(v *pb.EventReceive) *Transport
func NewTransportFromQueueMessage ¶
func NewTransportFromQueueMessage(v *pb.QueueMessage) *Transport
func NewTransportFromRequest ¶
func NewTransportFromResponseError ¶
func NewTransportFromResponseError(v *ResponseError) *Transport
func (*Transport) SetClient2 ¶
func (*Transport) SetLatency ¶
func (*Transport) SetPayload ¶
func (*Transport) SetSubKind ¶
type TransportBatch ¶
type TransportPubSubMessageDto ¶
type TransportPubSubMessageDto struct { MessageId string `json:"messageId"` Metadata string `json:"metadata,omitempty"` Body any `json:"body,omitempty"` Timestamp string `json:"timestamp,omitempty"` Sequence int64 `json:"sequence,omitempty"` Tags string `json:"tags,omitempty"` }
func NewTransportPubSubMessageDto ¶
func NewTransportPubSubMessageDto(tr *Transport) *TransportPubSubMessageDto
type TransportQueueMessageDto ¶
type TransportQueueMessageDto struct { MessageId string `json:"messageId"` Metadata string `json:"metadata,omitempty"` Body any `json:"body,omitempty"` Timestamp string `json:"timestamp,omitempty"` Sequence int64 `json:"sequence,omitempty"` Tags string `json:"tags,omitempty"` ReceivedCount int32 `json:"receivedCount,omitempty"` ReRoutedFrom string `json:"reRoutedFrom,omitempty"` ExpirationAt string `json:"expirationAt,omitempty"` DelayedTo string `json:"delayedTo,omitempty"` }
func NewTransportQueueMessageDto ¶
func NewTransportQueueMessageDto(tr *Transport) *TransportQueueMessageDto
type TransportRequestMessageDto ¶
type TransportRequestMessageDto struct { RequestId string `json:"requestId"` Metadata string `json:"metadata,omitempty"` Body any `json:"body,omitempty"` Timeout int32 `json:"timeout,omitempty"` Tags string `json:"tags,omitempty"` }
func NewTransportRequestMessageDto ¶
func NewTransportRequestMessageDto(tr *Transport) *TransportRequestMessageDto
type TransportResponseErrorMessageDto ¶
type TransportResponseErrorMessageDto struct { RequestId string `json:"requestId"` Error string `json:"error,omitempty"` Timestamp string `json:"timestamp,omitempty"` }
func NewTransportResponseErrorMessageDto ¶
func NewTransportResponseErrorMessageDto(tr *Transport) *TransportResponseErrorMessageDto
type TransportResponseMessageDto ¶
type TransportResponseMessageDto struct { RequestId string `json:"requestId"` Metadata string `json:"metadata,omitempty"` Body any `json:"body,omitempty"` Timestamp string `json:"timestamp,omitempty"` Tags string `json:"tags,omitempty"` Error string `json:"error,omitempty"` Executed bool `json:"executed,omitempty"` }
func NewTransportResponseMessageDto ¶
func NewTransportResponseMessageDto(tr *Transport) *TransportResponseMessageDto
Click to show internal directories.
Click to hide internal directories.