pm

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartHTTPServer

func StartHTTPServer(base string, port, m3port int)

func StartServer

func StartServer(base, host string, port int)

StartServer runs pm server

Types

type Client

type Client struct {
	Host string
	Port int
	// contains filtered or unexported fields
}

Client contains the configuration options for a RPC client.

func NewClient

func NewClient(host string, port int) (*Client, error)

NewClient creates rpc cleint

func (*Client) Close

func (r *Client) Close() error

Close gracefully terminates the underlying client.

func (*Client) Connect

func (r *Client) Connect() error

Connect initializes the underlying RPC client.

func (*Client) Start

func (r *Client) Start() (*Response, error)

Start requests service start.

func (*Client) Status

func (r *Client) Status() (*Response, error)

Status gets service status.

func (*Client) Stop

func (r *Client) Stop() (*Response, error)

Stop requests service stop.

type HTTPServer

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

func NewHTTPServer

func NewHTTPServer(base, ep string) *HTTPServer

func (*HTTPServer) Start

func (r *HTTPServer) Start() func(http.ResponseWriter, *http.Request)

func (*HTTPServer) Status

func (r *HTTPServer) Status() func(http.ResponseWriter, *http.Request)

func (*HTTPServer) Stop

func (r *HTTPServer) Stop() func(http.ResponseWriter, *http.Request)

type Handler

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

Handler holds the methods to be exposed by the RPC server as well as properties

func (*Handler) Start

func (r *Handler) Start(req Request, res *Response) error

Start starts service

func (*Handler) Status

func (r *Handler) Status(req Request, res *Response) error

Status returns service status

func (*Handler) Stop

func (r *Handler) Stop(req Request, res *Response) error

Stop stops service

type Request

type Request struct {
}

type Response

type Response struct {
	Message string
	Status  bool
}

type Server

type Server struct {
	Host string
	Port int
	// contains filtered or unexported fields
}

Server holds the configuration used to initiate an RPC server.

func NewServer

func NewServer(base string, host string, port int) *Server

NewServer creates rpc server

func (*Server) Addr

func (r *Server) Addr() string

Addr returns host:port

func (*Server) Run

func (r *Server) Run() (err error)

Run initializes the RPC server.

func (*Server) Start

func (r *Server) Start() (err error)

Start Runs the RPC server.

func (*Server) Stop

func (r *Server) Stop() (err error)

Stop gracefully terminates the server listener.

Jump to

Keyboard shortcuts

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