gservice

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 8 Imported by: 0

README

gservice

rpc service manager

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConn         = fmt.Errorf("conn fail")
	ErrErrNoHandler = fmt.Errorf("manager didn't handle Errs()")
)

Functions

This section is empty.

Types

type Conn

type Conn struct {
	io.Closer
	// contains filtered or unexported fields
}

type ConnFactory

type ConnFactory func(host string) (io.Closer, error)

ConnFactory is a function to create new connections.

func GRpcFactory

func GRpcFactory() ConnFactory

type ConnTestFunc

type ConnTestFunc func(closer io.Closer) error

判断连接是否可用

func GRpcConnTest

func GRpcConnTest() ConnTestFunc

type Consumer

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

func (*Consumer) GetConn

func (c *Consumer) GetConn() (conn io.Closer, err error)

func (*Consumer) Open

func (c *Consumer) Open() (err error)

type Manager

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

func NewManager

func NewManager(options *Options) (m *Manager, err error)

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) NewConsumer

func (m *Manager) NewConsumer(serviceName string) (c *Consumer)

type Options

type Options struct {
	ConsulConfig *api.Config
	ConsulClient *api.Client
}

func NewOptions

func NewOptions() *Options

type RpcType

type RpcType string
const (
	RpcTypeGRPC RpcType = "grpc"
)

Jump to

Keyboard shortcuts

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