getty

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RpcRequestTimeout = 20 * time.Second
)
View Source
const (
	Seatav1HeaderLength = 16
)

Variables

View Source
var (
	ErrNotEnoughStream = errors.New("packet stream is not enough")
	ErrTooLargePackage = errors.New("package length is exceed the getty package's legal maximum length.")
	ErrInvalidPackage  = errors.New("invalid rpc package")
	ErrIllegalMagic    = errors.New("package magic is not right.")
)

Functions

func GetGettyClientHandlerInstance

func GetGettyClientHandlerInstance() *gettyClientHandler

func InitRpcClient

func InitRpcClient(gettyConfig *config.Config, seataConfig *config.SeataConfig)

Types

type GettyRemoting

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

func GetGettyRemotingInstance

func GetGettyRemotingInstance() *GettyRemoting

func (*GettyRemoting) GetMergedMessage

func (g *GettyRemoting) GetMergedMessage(msgID int32) *message.MergedWarpMessage

func (*GettyRemoting) GetMessageFuture

func (g *GettyRemoting) GetMessageFuture(msgID int32) *message.MessageFuture

func (*GettyRemoting) NotifyRpcMessageResponse

func (g *GettyRemoting) NotifyRpcMessageResponse(rpcMessage message.RpcMessage)

func (*GettyRemoting) RemoveMergedMessageFuture

func (g *GettyRemoting) RemoveMergedMessageFuture(msgID int32)

func (*GettyRemoting) RemoveMessageFuture

func (g *GettyRemoting) RemoveMessageFuture(msgID int32)

func (*GettyRemoting) SendASync

func (g *GettyRemoting) SendASync(msg message.RpcMessage, s getty.Session, callback callbackMethod) error

func (*GettyRemoting) SendSync

func (g *GettyRemoting) SendSync(msg message.RpcMessage, s getty.Session, callback callbackMethod) (interface{}, error)

type GettyRemotingClient

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

func GetGettyRemotingClient

func GetGettyRemotingClient() *GettyRemotingClient

func (*GettyRemotingClient) SendAsyncRequest

func (client *GettyRemotingClient) SendAsyncRequest(msg interface{}) error

func (*GettyRemotingClient) SendAsyncResponse

func (client *GettyRemotingClient) SendAsyncResponse(msgID int32, msg interface{}) error

func (*GettyRemotingClient) SendSyncRequest

func (client *GettyRemotingClient) SendSyncRequest(msg interface{}) (interface{}, error)

type RpcClient

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

type RpcPackageHandler

type RpcPackageHandler struct{}

func (*RpcPackageHandler) Read

func (p *RpcPackageHandler) Read(ss getty.Session, data []byte) (interface{}, int, error)

func (*RpcPackageHandler) Write

func (p *RpcPackageHandler) Write(ss getty.Session, pkg interface{}) ([]byte, error)

Write write rpc message to binary data

type SeataV1PackageHeader

type SeataV1PackageHeader struct {
	Magic0       byte
	Magic1       byte
	Version      byte
	TotalLength  uint32
	HeadLength   uint16
	MessageType  message.GettyRequestType
	CodecType    byte
	CompressType byte
	RequestID    uint32
	Meta         map[string]string
	BodyLength   uint32
	Body         interface{}
}

type SessionManager

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

Jump to

Keyboard shortcuts

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