transport

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Empty

type Empty = pb.Empty

Empty

type Event

type Event = pb.Event

Event

type EventReceive

type EventReceive = pb.EventReceive

EventReceive

type Message

type Message struct {
	Id                  string   `json:"id,omitempty"`
	SendTime            int64    `json:"send_time,omitempty"`
	ReceiveTime         int64    `json:"receive_time,omitempty"`
	SendResponseTime    int64    `json:"send_response_time,omitempty"`
	ReceiveResponseTime int64    `json:"receive_response_time,omitempty"`
	Payload             []byte   `json:"payload,omitempty"`
	CRC                 [32]byte `json:"crc,omitempty"`
}

Message - base message

func NewMessage

func NewMessage(n int) *Message

NewMessage - create new message

func Unmarshal

func Unmarshal(data []byte) (*Message, error)

Unmarshal

func (*Message) Latency

func (m *Message) Latency() time.Duration

Latency

func (*Message) Marshal

func (m *Message) Marshal() []byte

Marshal

func (*Message) ResponseLatency

func (m *Message) ResponseLatency() time.Duration

ResponseLatency

func (*Message) SendLatency

func (m *Message) SendLatency() time.Duration

SendLatency

func (*Message) SetPayload

func (m *Message) SetPayload(n int)

SetPayload

func (*Message) SetReceiveResponseTime

func (m *Message) SetReceiveResponseTime()

SetReceiveResponseTime

func (*Message) SetReceiveTime

func (m *Message) SetReceiveTime()

SetReceiveTime

func (*Message) SetSendResponseTime

func (m *Message) SetSendResponseTime()

SetSendResponseTime

func (*Message) SetSendTime

func (m *Message) SetSendTime()

SetSendTime

func (*Message) Validate

func (m *Message) Validate() error

Validate

type Request

type Request = pb.Request

Request

type RequestTypeData

type RequestTypeData = pb.Request_RequestType

RequestTypeData

type Response

type Response = pb.Response

Response

type Transport

type Transport interface {
	SendEvent(ctx context.Context, channel string, m *Message) error
	SendEventStore(ctx context.Context, channel string, m *Message) error
	SendCommand(ctx context.Context, channel string, m *Message, timeout time.Duration) error
	SendQuery(ctx context.Context, channel string, m *Message, timeout time.Duration) (*Message, error)
	ReceiveEvent(ctx context.Context, channel string, group string, rxCh chan *Message, errCh chan error) error
	ReceiveEventStore(ctx context.Context, channel string, group string, rxCh chan *Message, errCh chan error) error
	ReceiveCommand(ctx context.Context, channel string, group string, rxCh chan *Message, errCh chan error) error
	ReceiveQuery(ctx context.Context, channel string, group string, rxCh chan *Message, errCh chan error) error
	Close() error
}

type TransportType

type TransportType int
const (
	TransportTypeGRPC TransportType = iota
	TransportTypeREST
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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