conn

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConnectionWithAddress

func NewConnectionWithAddress(peerAddress string, tslEnabled bool, creds credentials.TransportCredentials) (*grpc.ClientConn, error)

get time from config timeOut := viper.GetInt("grpc.timeout")

Types

type Connection

type Connection interface {
	Send(envelope *message.Envelope, successCallBack func(interface{}), errCallBack func(error))
	Close()
}

func NewConnection

func NewConnection(clientStream pb.StreamService_StreamClient, serverStream pb.StreamService_StreamServer, conn *grpc.ClientConn,
	client pb.StreamServiceClient, handle ReceiveMessageHandle, connectionID string, cf context.CancelFunc) (Connection, error)

todo channel의 buffer size를 config에서 읽기

type ConnectionImpl

type ConnectionImpl struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

직접적으로 grpc를 보내고 받는 역활 수행

func (*ConnectionImpl) Close

func (conn *ConnectionImpl) Close()

func (*ConnectionImpl) ReadStream

func (conn *ConnectionImpl) ReadStream(errChan chan error)

func (*ConnectionImpl) Send

func (conn *ConnectionImpl) Send(envelope *message.Envelope, successCallBack func(interface{}), errCallBack func(error))

func (*ConnectionImpl) WriteStream

func (conn *ConnectionImpl) WriteStream()

type ReceiveMessageHandle

type ReceiveMessageHandle func(message msg.OutterMessage)

Jump to

Keyboard shortcuts

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