subpub_redis

package
v0.0.0-...-d849962 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodecJson = iota
	CodecProto3
)

Variables

View Source
var (
	ErrInvalidLengthMessage        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMessage          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupMessage = fmt.Errorf("proto: unexpected end of group")
)

Functions

func ErrPublish

func ErrPublish(err error) error

Types

type IEncoder

type IEncoder interface {
	Marshal(v interface{}) ([]byte, error)
}

type IPubSub

type IPubSub interface {
	Publish(pid int32, v any) error
	Subscribe()
	Stop()
}

func NewPubSub

func NewPubSub(_cli redis.UniversalClient, ee int, topic string, _invoker func(pid int32, body []byte, err error)) IPubSub

type PubMessage

type PubMessage struct {
	Pid  int32  `protobuf:"varint,1,opt,name=Pid,proto3" json:"Pid,omitempty"`
	Data []byte `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"`
}

func (*PubMessage) Descriptor

func (*PubMessage) Descriptor() ([]byte, []int)

func (*PubMessage) GetData

func (m *PubMessage) GetData() []byte

func (*PubMessage) GetPid

func (m *PubMessage) GetPid() int32

func (*PubMessage) Marshal

func (m *PubMessage) Marshal() (dAtA []byte, err error)

func (*PubMessage) MarshalTo

func (m *PubMessage) MarshalTo(dAtA []byte) (int, error)

func (*PubMessage) MarshalToSizedBuffer

func (m *PubMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PubMessage) ProtoMessage

func (*PubMessage) ProtoMessage()

func (*PubMessage) Reset

func (m *PubMessage) Reset()

func (*PubMessage) Size

func (m *PubMessage) Size() (n int)

func (*PubMessage) String

func (m *PubMessage) String() string

func (*PubMessage) Unmarshal

func (m *PubMessage) Unmarshal(dAtA []byte) error

func (*PubMessage) XXX_DiscardUnknown

func (m *PubMessage) XXX_DiscardUnknown()

func (*PubMessage) XXX_Marshal

func (m *PubMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PubMessage) XXX_Merge

func (m *PubMessage) XXX_Merge(src proto.Message)

func (*PubMessage) XXX_Size

func (m *PubMessage) XXX_Size() int

func (*PubMessage) XXX_Unmarshal

func (m *PubMessage) XXX_Unmarshal(b []byte) error

type PubSub

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

func (*PubSub) Publish

func (ps *PubSub) Publish(pid int32, v any) error

func (*PubSub) Stop

func (ps *PubSub) Stop()

func (*PubSub) Subscribe

func (ps *PubSub) Subscribe()

Jump to

Keyboard shortcuts

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