service

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIPAddresses added in v1.0.8

func GetIPAddresses() []string

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
	Admin      bool
}

type ServiceInfo added in v1.0.8

type ServiceInfo struct {
	Name          string
	IPAddresses   []string
	Subscriptions []string
	NumWorkers    int64
	MaxJobs       int64
}

Jump to

Keyboard shortcuts

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