subpub_redis

package
v0.0.0-...-46e5a36 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodecJson = iota
	CodecProto3
	CodecString
)

Variables

View Source
var File_message_proto protoreflect.FileDescriptor

Functions

func ErrPublish

func ErrPublish(err error) error

Types

type IEncoder

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

type IPubSub

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

func NewPubSub

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

type PubMessage

type PubMessage struct {
	Sender string `protobuf:"bytes,1,opt,name=Sender,proto3" json:"Sender,omitempty"`
	Pid    int64  `protobuf:"varint,2,opt,name=Pid,proto3" json:"Pid,omitempty"`
	Data   []byte `protobuf:"bytes,3,opt,name=Data,proto3" json:"Data,omitempty"`
	// contains filtered or unexported fields
}

func (*PubMessage) Descriptor deprecated

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

Deprecated: Use PubMessage.ProtoReflect.Descriptor instead.

func (*PubMessage) GetData

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

func (*PubMessage) GetPid

func (x *PubMessage) GetPid() int64

func (*PubMessage) GetSender

func (x *PubMessage) GetSender() string

func (*PubMessage) ProtoMessage

func (*PubMessage) ProtoMessage()

func (*PubMessage) ProtoReflect

func (x *PubMessage) ProtoReflect() protoreflect.Message

func (*PubMessage) Reset

func (x *PubMessage) Reset()

func (*PubMessage) String

func (x *PubMessage) String() string

type PubSub

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

func (*PubSub) Publish

func (ps *PubSub) Publish(pid int64, 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