message

package
v0.0.0-...-9fc37f3 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Caller

type Caller interface {
	CallComponent(Message) (interface{}, error)
}

Caller for calling component or server

type Message

type Message interface {
	Service() *service.Service
	Codec() codec.Codec
	Topic() string
	SetTopic(string)
	SetBody(v interface{}) error
	GetPayload() *Payload
	ToObject(v interface{}) error
	ToRemoteMessage() *RemoteMessage
}

Message is the interface for publishing asynchronously

func NewMessage

func NewMessage(opts ...Option) Message

type Option

type Option func(*Options)

Option used by NewMessage

func MessagePayload

func MessagePayload(payload *Payload) Option

func Service

func Service(s *service.Service) Option

type Options

type Options struct {
	Service *service.Service

	Payload *Payload
}

Options parameters

type Payload

type Payload struct {
	Header               map[string]string `` /* 153-byte string literal not displayed */
	Body                 []byte            `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*Payload) Descriptor

func (*Payload) Descriptor() ([]byte, []int)

func (*Payload) Get

func (m *Payload) Get(key string) string

func (*Payload) GetBody

func (m *Payload) GetBody() []byte

func (*Payload) GetHeader

func (m *Payload) GetHeader() map[string]string

func (*Payload) ProtoMessage

func (*Payload) ProtoMessage()

func (*Payload) Reset

func (m *Payload) Reset()

func (*Payload) Set

func (m *Payload) Set(key, value string)

func (*Payload) String

func (m *Payload) String() string

func (*Payload) XXX_DiscardUnknown

func (m *Payload) XXX_DiscardUnknown()

func (*Payload) XXX_Marshal

func (m *Payload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Payload) XXX_Merge

func (m *Payload) XXX_Merge(src proto.Message)

func (*Payload) XXX_Size

func (m *Payload) XXX_Size() int

func (*Payload) XXX_Unmarshal

func (m *Payload) XXX_Unmarshal(b []byte) error

type RemoteMessage

type RemoteMessage struct {
	*service.Service `yaml:"service" json:"service"`
	*Payload         `yaml:"payload" json:"payload"`
}

RemoteMessage remote message from two inner servers

func (*RemoteMessage) ToMessage

func (p *RemoteMessage) ToMessage() Message

type Request

type Request struct {
	Id                   string           `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Service              *service.Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
	Endpoint             string           `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	Payload              *Payload         `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*Request) Descriptor

func (*Request) Descriptor() ([]byte, []int)

func (*Request) GetEndpoint

func (m *Request) GetEndpoint() string

func (*Request) GetId

func (m *Request) GetId() string

func (*Request) GetPayload

func (m *Request) GetPayload() *Payload

func (*Request) GetService

func (m *Request) GetService() *service.Service

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) String

func (m *Request) String() string

func (*Request) XXX_DiscardUnknown

func (m *Request) XXX_DiscardUnknown()

func (*Request) XXX_Marshal

func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Request) XXX_Merge

func (m *Request) XXX_Merge(src proto.Message)

func (*Request) XXX_Size

func (m *Request) XXX_Size() int

func (*Request) XXX_Unmarshal

func (m *Request) XXX_Unmarshal(b []byte) error

type Response

type Response struct {
	Body                 []byte            `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
	Header               map[string]string `` /* 153-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

func (*Response) Descriptor

func (*Response) Descriptor() ([]byte, []int)

func (*Response) GetBody

func (m *Response) GetBody() []byte

func (*Response) GetHeader

func (m *Response) GetHeader() map[string]string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) String

func (m *Response) String() string

func (*Response) XXX_DiscardUnknown

func (m *Response) XXX_DiscardUnknown()

func (*Response) XXX_Marshal

func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Response) XXX_Merge

func (m *Response) XXX_Merge(src proto.Message)

func (*Response) XXX_Size

func (m *Response) XXX_Size() int

func (*Response) XXX_Unmarshal

func (m *Response) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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