Documentation
¶
Index ¶
- Constants
- Variables
- func LogDebug(args ...interface{})
- func LogDebugf(format string, args ...interface{})
- func LogError(args ...interface{})
- func LogErrorf(format string, args ...interface{})
- func LogFatal(args ...interface{})
- func LogFatalf(format string, args ...interface{})
- func LogInfo(args ...interface{})
- func LogInfof(format string, args ...interface{})
- func LogWarn(args ...interface{})
- func LogWarnf(format string, args ...interface{})
- func SetOperation(ctx context.Context, op string)
- type ClientOption
- type Connection
- type Server
- type ServerOption
- type Transport
- type Transporter
Constants ¶
View Source
const (
KindThrift = "thrift"
)
Variables ¶
View Source
var ( ErrInvalidProtocol = errors.New("invalid protocol") ErrInvalidTransport = errors.New("invalid transport") )
Functions ¶
func SetOperation ¶
SetOperation sets the transport operation.
Types ¶
type ClientOption ¶
type ClientOption func(o *clientOptions)
func WithClientProtocol ¶
func WithClientProtocol(protocol string) ClientOption
func WithClientTLSConfig ¶
func WithClientTLSConfig(c *tls.Config) ClientOption
WithClientTLSConfig with tls config.
func WithClientTransportConfig ¶
func WithClientTransportConfig(buffered, framed bool, bufferSize int) ClientOption
func WithDiscovery ¶
func WithDiscovery(d registry.Discovery) ClientOption
WithDiscovery with client discovery.
func WithEndpoint ¶
func WithEndpoint(endpoint string) ClientOption
WithEndpoint with client endpoint.
type Connection ¶
type Connection struct {
Client *thrift.TStandardClient
Transport thrift.TTransport
}
func Dial ¶
func Dial(opts ...ClientOption) (*Connection, error)
func (*Connection) Close ¶
func (c *Connection) Close()
type Server ¶
type Server struct {
Server *thrift.TSimpleServer
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
type ServerOption ¶
type ServerOption func(o *Server)
func WithAddress ¶
func WithAddress(addr string) ServerOption
func WithProcessor ¶
func WithProcessor(processor thrift.TProcessor) ServerOption
func WithProtocol ¶
func WithProtocol(protocol string) ServerOption
func WithTLSConfig ¶
func WithTLSConfig(c *tls.Config) ServerOption
func WithTransportConfig ¶
func WithTransportConfig(buffered, framed bool, bufferSize int) ServerOption
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is a Thrift transport.
func (*Transport) Kind ¶
func (tr *Transport) Kind() kratosTransport.Kind
Kind returns the transport kind.
func (*Transport) ReplyHeader ¶
func (tr *Transport) ReplyHeader() kratosTransport.Header
ReplyHeader returns the reply header.
func (*Transport) RequestHeader ¶
func (tr *Transport) RequestHeader() kratosTransport.Header
RequestHeader returns the request header.
type Transporter ¶
type Transporter interface {
kratosTransport.Transporter
}
Click to show internal directories.
Click to hide internal directories.