reversegrpc

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

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

Go to latest
Published: Nov 29, 2022 License: MIT Imports: 6 Imported by: 0

README

Revering the flow of grpc

DO NOT USE IN PROD, YOU HAVE BEEN WARNED

why?

No good reason at all: because you can!

how

Implicit interfaces and some dialer magic

tell me more!

blog post coming soonTM

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWorkerDisconnected = errors.New("worker disconnected")

Functions

This section is empty.

Types

type Controller

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

func (*Controller) Accept

func (c *Controller) Accept(options ...grpc.DialOption) (*grpc.ClientConn, error)

func (*Controller) Listen

func (c *Controller) Listen(address string) error

type DialListener

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

who needs to listen anyways. just dial :svekw:

func NewDialListener

func NewDialListener(addr string) *DialListener

func (*DialListener) Accept

func (d *DialListener) Accept() (net.Conn, error)

Accepts dials out the controller and returns the tcp connection that has been set up. A semaphore is used to ensure there is a most one live connection

func (DialListener) Addr

func (d DialListener) Addr() net.Addr

func (*DialListener) Close

func (d *DialListener) Close() error

nothing to close when you aren't listening

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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