[chore] update latest deps, ensure readme up to date (#1873)

* [chore] update latest deps, ensure readme up to date

* remove double entry
This commit is contained in:
tobi 2023-06-05 10:15:05 +02:00 committed by GitHub
commit b401bd1ccb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
156 changed files with 11730 additions and 2842 deletions

View file

@ -77,7 +77,7 @@ const (
// WrapTException wraps an error into TException.
//
// If err is nil or already TException, it's returned as-is.
// Otherwise it will be wraped into TException with TExceptionType() returning
// Otherwise it will be wrapped into TException with TExceptionType() returning
// TExceptionTypeUnknown, and Unwrap() returning the original error.
func WrapTException(err error) TException {
if err == nil {

View file

@ -160,15 +160,13 @@ func (t *TMultiplexedProcessor) ProcessorMap() map[string]TProcessorFunction {
// the given ProcessorName or if all that is given is the FunctionName and there
// is no DefaultProcessor set.
func (t *TMultiplexedProcessor) AddToProcessorMap(name string, processorFunc TProcessorFunction) {
components := strings.SplitN(name, MULTIPLEXED_SEPARATOR, 2)
if len(components) != 2 {
if t.DefaultProcessor != nil && len(components) == 1 {
t.DefaultProcessor.AddToProcessorMap(components[0], processorFunc)
processorName, funcName, found := strings.Cut(name, MULTIPLEXED_SEPARATOR)
if !found {
if t.DefaultProcessor != nil {
t.DefaultProcessor.AddToProcessorMap(processorName, processorFunc)
}
return
}
processorName := components[0]
funcName := components[1]
if processor, ok := t.serviceProcessorMap[processorName]; ok {
processor.AddToProcessorMap(funcName, processorFunc)
}
@ -197,9 +195,9 @@ func (t *TMultiplexedProcessor) Process(ctx context.Context, in, out TProtocol)
if typeId != CALL && typeId != ONEWAY {
return false, NewTProtocolException(fmt.Errorf("Unexpected message type %v", typeId))
}
//extract the service name
v := strings.SplitN(name, MULTIPLEXED_SEPARATOR, 2)
if len(v) != 2 {
// extract the service name
processorName, funcName, found := strings.Cut(name, MULTIPLEXED_SEPARATOR)
if !found {
if t.DefaultProcessor != nil {
smb := NewStoredMessageProtocol(in, name, typeId, seqid)
return t.DefaultProcessor.Process(ctx, smb, out)
@ -209,18 +207,18 @@ func (t *TMultiplexedProcessor) Process(ctx context.Context, in, out TProtocol)
name,
))
}
actualProcessor, ok := t.serviceProcessorMap[v[0]]
actualProcessor, ok := t.serviceProcessorMap[processorName]
if !ok {
return false, NewTProtocolException(fmt.Errorf(
"Service name not found: %s. Did you forget to call registerProcessor()?",
v[0],
processorName,
))
}
smb := NewStoredMessageProtocol(in, v[1], typeId, seqid)
smb := NewStoredMessageProtocol(in, funcName, typeId, seqid)
return actualProcessor.Process(ctx, smb, out)
}
//Protocol that use stored message for ReadMessageBegin
// Protocol that use stored message for ReadMessageBegin
type storedMessageProtocol struct {
TProtocol
name string

View file

@ -56,7 +56,7 @@ type stringWriter interface {
WriteString(s string) (n int, err error)
}
// This is "enchanced" transport with extra capabilities. You need to use one of these
// This is "enhanced" transport with extra capabilities. You need to use one of these
// to construct protocol.
// Notably, TSocket does not implement this interface, and it is always a mistake to use
// TSocket directly in protocol.

View file

@ -40,7 +40,7 @@ const (
LIST = 15
UTF8 = 16
UTF16 = 17
//BINARY = 18 wrong and unusued
//BINARY = 18 wrong and unused
)
var typeNames = map[int]string{