flarego

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

flarego

The Go version implementation of flare flare-cpp protocol, including client side and server side.

Note that this is not an official implementation, and only implements the protocol part. Load balancing, service discovery and other functions are not included. It may be supported in the future

Status

Beta version, the api may be break.

Usage

see examples

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrProtocolNotFound = errors.New("protocol not found")
)

Functions

func RegisterProtocol

func RegisterProtocol(name string, p Protocol)

RegisterProtocol registers a protocol.

Types

type CallOption

type CallOption interface{}

CallOption configures how we call the server.

type CallOptions

type CallOptions struct {
}

CallOptions is the options for calling.

type ClientConn

type ClientConn interface {
	// Invoke performs a unary RPC and returns after the response is received
	// into reply.
	Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...CallOption) error
}

func Dial

func Dial(protocol, target string, options ...DialOption) (ClientConn, error)

Dial creates a client connection to the given target according to the protocol.

type DialOption

type DialOption interface{}

DialOption configures how we set up the connection.

type DialOptions

type DialOptions struct {
}

DialOptions is the options for dialing.

type Protocol

type Protocol interface {
	Dial(target string, options ...DialOption) (ClientConn, error)
	NewServer(options ...ServerOption) Server
}

Protocol defines how to make rpc call and serve rpc call.

type Server

type Server interface {
	RegisterService(sd *ServiceDesc, ss interface{})
	Serve(l net.Listener) error
}

Server is the interface that must be implemented by a protocol server.

func NewServer

func NewServer(protocol string, options ...ServerOption) Server

NewServer creates a new server according to the protocol.

type ServerOption

type ServerOption interface{}

ServerOption configures how we set up the server.

type ServerOptions

type ServerOptions struct {
}

ServerOptions is the options for new server.

type ServiceDesc

type ServiceDesc = grpc.ServiceDesc

Directories

Path Synopsis
examples
protocol

Jump to

Keyboard shortcuts

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