runtime

package
v0.0.0-...-e0ce882 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2019 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterRuntimeServer

func RegisterRuntimeServer(s *grpc.Server, srv RuntimeServer)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client client of function server

func NewClient

func NewClient(cc config.RuntimeClient) (*Client, error)

NewClient creates a new client

func (*Client) Close

func (c *Client) Close() error

Close closes the client

func (*Client) Handle

func (c *Client) Handle(in *Message) (*Message, error)

Handle sends request to function server

type Handle

type Handle func(context.Context, *Message) (*Message, error)

Handle function handle

type Message

type Message struct {
	QOS                  uint32   `protobuf:"varint,1,opt,name=QOS,proto3" json:"QOS,omitempty"`
	Topic                string   `protobuf:"bytes,2,opt,name=Topic,proto3" json:"Topic,omitempty"`
	Payload              []byte   `protobuf:"bytes,3,opt,name=Payload,proto3" json:"Payload,omitempty"`
	FunctionName         string   `protobuf:"bytes,11,opt,name=FunctionName,proto3" json:"FunctionName,omitempty"`
	FunctionInvokeID     string   `protobuf:"bytes,12,opt,name=FunctionInvokeID,proto3" json:"FunctionInvokeID,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

The request message.

func (*Message) Descriptor

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

func (*Message) GetFunctionInvokeID

func (m *Message) GetFunctionInvokeID() string

func (*Message) GetFunctionName

func (m *Message) GetFunctionName() string

func (*Message) GetPayload

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

func (*Message) GetQOS

func (m *Message) GetQOS() uint32

func (*Message) GetTopic

func (m *Message) GetTopic() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

func (*Message) XXX_DiscardUnknown

func (m *Message) XXX_DiscardUnknown()

func (*Message) XXX_Marshal

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

func (*Message) XXX_Merge

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

func (*Message) XXX_Size

func (m *Message) XXX_Size() int

func (*Message) XXX_Unmarshal

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

type RuntimeClient

type RuntimeClient interface {
	// Handle handles request
	Handle(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
}

RuntimeClient is the client API for Runtime service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRuntimeClient

func NewRuntimeClient(cc *grpc.ClientConn) RuntimeClient

type RuntimeServer

type RuntimeServer interface {
	// Handle handles request
	Handle(context.Context, *Message) (*Message, error)
}

RuntimeServer is the server API for Runtime service.

type Server

type Server struct {
	Address string
	// contains filtered or unexported fields
}

Server runtime server to handle message

func NewServer

func NewServer(c config.RuntimeServer, handle Handle) (*Server, error)

NewServer creates a new server

func (*Server) Close

func (s *Server) Close()

Close closes server

func (*Server) Handle

func (s *Server) Handle(c context.Context, m *Message) (*Message, error)

Handle handles messages

Jump to

Keyboard shortcuts

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