service

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 12 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 ClientConfig added in v0.0.4

type ClientConfig struct {
	Name string
	Host string
	User string
	Pass string
}

type ClientRPC

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

func NewRpcClient

func NewRpcClient(cfg *ClientConfig) *ClientRPC

func (*ClientRPC) Listen

func (crpc *ClientRPC) Listen()

type NatsConfig added in v0.0.4

type NatsConfig struct {
	Host string
	User string
	Pass string
}

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(cfg *ServerConfig) *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 {
	Name       string
	Command    string
	NumWorkers int64
	MaxJobs    int64
	Subscribe  string
	Host       string
	User       string
	Pass       string
}

Jump to

Keyboard shortcuts

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