service

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func (*Client) Publish

func (c *Client) Publish(msg string, resp *string) error

func (*Client) Request

func (c *Client) Request(msg string, resp *string) error

type ClientRPC

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

func NewRpcClient

func NewRpcClient(nats *nats.Conn, name string) *ClientRPC

func (*ClientRPC) Listen

func (crpc *ClientRPC) Listen()

type Payload

type Payload struct {
	Service string                 `json:"service"`
	Data    map[string]interface{} `json:"data"`
	Timeout int                    `json:"timeout,omitempty"`
}

func (*Payload) TimeoutDuration

func (p *Payload) TimeoutDuration() time.Duration

type Server

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

func NewServer

func NewServer(nats *nats.Conn, name string) *Server

NewServer returns new natsrpc server

func (*Server) Start

func (s *Server) Start()

func (*Server) Stop

func (s *Server) Stop()

type ServerConfig

type ServerConfig struct {
	Command string
	Pool    *ServerPool
}

type ServerPool

type ServerPool struct {
	NumWorkers int64
	MaxJobs    int64
}

Jump to

Keyboard shortcuts

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