dqlite

package
v0.0.0-...-3b51f2e Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AcceptChan = make(chan net.Conn)

Functions

func CreateSharedDatabase

func CreateSharedDatabase(serverAddr *[]string) *shared.Client

func DialFunction

func DialFunction(_ context.Context, address string) (net.Conn, error)

DialFunction ctx used to control first connect timeout, just ignore

Types

type ClientRpcConn

type ClientRpcConn struct {
	*RpcConn
}

func NewClientRpcConn

func NewClientRpcConn(stream grpc.ClientStream, src, dst string) *ClientRpcConn

func (*ClientRpcConn) Close

func (c *ClientRpcConn) Close() error

type RPCConnAddr

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

func NewRPCConnAddr

func NewRPCConnAddr(name string) RPCConnAddr

func (RPCConnAddr) Network

func (R RPCConnAddr) Network() string

func (RPCConnAddr) String

func (R RPCConnAddr) String() string

type RpcConn

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

func NewRPCConn

func NewRPCConn(localAddr, remoteAddr RPCConnAddr, stream Stream) *RpcConn

func (*RpcConn) Context

func (r *RpcConn) Context() context.Context

func (*RpcConn) LocalAddr

func (r *RpcConn) LocalAddr() net.Addr

func (*RpcConn) Read

func (r *RpcConn) Read(p []byte) (n int, err error)

func (*RpcConn) RemoteAddr

func (r *RpcConn) RemoteAddr() net.Addr

func (*RpcConn) SetDeadline

func (r *RpcConn) SetDeadline(t time.Time) error

func (*RpcConn) SetReadDeadline

func (r *RpcConn) SetReadDeadline(t time.Time) error

func (*RpcConn) SetWriteDeadline

func (r *RpcConn) SetWriteDeadline(t time.Time) error

func (*RpcConn) Write

func (r *RpcConn) Write(b []byte) (n int, err error)

type ServerRpcConn

type ServerRpcConn struct {
	*RpcConn
}

func NewServerRpcConn

func NewServerRpcConn(stream grpc.ServerStream, src, dst string) *ServerRpcConn

func (*ServerRpcConn) Close

func (s *ServerRpcConn) Close() error

Close is a no-op. You can't close a gRPC stream on the server side.

type Stream

type Stream interface {
	Context() context.Context
	SendMsg(m any) error
	RecvMsg(m any) error
}

Stream grpc deprecate it, just use as a placeholder

Jump to

Keyboard shortcuts

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