wave

package module
v0.0.0-...-eb422e1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2016 License: MIT Imports: 5 Imported by: 0

README

Package wave

Project status GoDoc License

Package wave is a thin helper layer on top of Go's net/rpc

Why?

The intention of this library is to provide a thin wrapper around the std net/rpc package allowing the user to add functionality via hooks instead of creating a whole new framework.

NOTES: currently there are no hooks, first one will be hooking into the Register and RegisterName functions to allow any service discovery to be handled. This project is very much in it's early stages any contributions are welcome.

Package Versioning

I'm jumping on the vendoring bandwagon, you should vendor this package as I will not be creating different version with gopkg.in like allot of my other libraries.

Why? because my time is spread pretty thin maintaining all of the libraries I have + LIFE, it is so freeing not to worry about it and will help me keep pouring out bigger and better things for you the community.

License

Distributed under MIT License, please see license file in code for more details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*rpc.Client
	// contains filtered or unexported fields
}

Client encapsulates the standard rpc.Client allowing for adding of aditional functions or hooking into existing rpc client functions.

func NewClient

func NewClient(serviceName, network, address string, timeout time.Duration, config *tls.Config) (*Client, error)

NewClient creates and returns a new instance of 'Client' config is optional, if 'nil' it is ignored

func (*Client) ServiceName

func (c *Client) ServiceName() string

ServiceName returns the Client's service name this allow for that to be hidden away during implementation if desired.

type ClientPool

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

ClientPool allows for easy pooling of 'Client' connections

func NewClientPooled

func NewClientPooled(serviceName, network, address string, timeout time.Duration, config *tls.Config) *ClientPool

NewClientPooled returns a new 'Client' instance backed by a pool of connections

func (*ClientPool) Get

func (p *ClientPool) Get() (*Client, error)

Get Retrieves and existing connection or creates a new one if none exist

func (*ClientPool) Put

func (p *ClientPool) Put(v interface{})

Put puts v back into the pool

type Server

type Server struct {
	*rpc.Server
}

Server encapsulates the standard rpc.Server allowing for adding of aditional functions or hooking into existing rpc server functions.

func NewServer

func NewServer() *Server

NewServer creates and returns a new instance of 'Server'

Jump to

Keyboard shortcuts

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