chat

package
v0.0.1-fix Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrivateFrameType imparse.FrameType = "private"
	GroupFrameType   imparse.FrameType = "group"
	SignalFrameType  imparse.FrameType = "signal"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupFrame

type GroupFrame struct {
	*StandardFrame
	// contains filtered or unexported fields
}

private

func NewGroupFrame

func NewGroupFrame(standardFrame *StandardFrame, bizPro *biz.Common) *GroupFrame

func (*GroupFrame) Ack

func (p *GroupFrame) Ack(ctx context.Context, exec imparse.Exec) (int64, error)

func (*GroupFrame) AckBody

func (p *GroupFrame) AckBody() ([]byte, error)

func (*GroupFrame) Filter

func (p *GroupFrame) Filter(ctx context.Context, db imparse.Cache, filters ...imparse.Filter) (uint64, error)

func (*GroupFrame) GetBase

func (p *GroupFrame) GetBase() *biz.Common

func (*GroupFrame) GetChannelType

func (p *GroupFrame) GetChannelType() biz.Channel

func (*GroupFrame) GetMsgType

func (p *GroupFrame) GetMsgType() biz.MsgType

func (*GroupFrame) PushBody

func (p *GroupFrame) PushBody() ([]byte, error)

func (*GroupFrame) Transport

func (p *GroupFrame) Transport(ctx context.Context, exec imparse.Exec) error

func (*GroupFrame) Type

func (p *GroupFrame) Type() imparse.FrameType

type Option

type Option func(*Options)

func WithCreateTime

func WithCreateTime(t uint64) Option

func WithMid

func WithMid(t int64) Option

func WithTarget

func WithTarget(t string) Option

func WithTransmissionMethod

func WithTransmissionMethod(t imparse.Channel) Option

type Options

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

type PrivateFrame

type PrivateFrame struct {
	*StandardFrame
	// contains filtered or unexported fields
}

private

func NewPrivateFrame

func NewPrivateFrame(standardFrame *StandardFrame, bizPro *biz.Common) *PrivateFrame

func (*PrivateFrame) Ack

func (p *PrivateFrame) Ack(ctx context.Context, exec imparse.Exec) (int64, error)

func (*PrivateFrame) AckBody

func (p *PrivateFrame) AckBody() ([]byte, error)

func (*PrivateFrame) Filter

func (p *PrivateFrame) Filter(ctx context.Context, db imparse.Cache, filters ...imparse.Filter) (uint64, error)

func (*PrivateFrame) GetBase

func (p *PrivateFrame) GetBase() *biz.Common

func (*PrivateFrame) GetChannelType

func (p *PrivateFrame) GetChannelType() biz.Channel

func (*PrivateFrame) GetMsgType

func (p *PrivateFrame) GetMsgType() biz.MsgType

func (*PrivateFrame) PushBody

func (p *PrivateFrame) PushBody() ([]byte, error)

func (*PrivateFrame) Transport

func (p *PrivateFrame) Transport(ctx context.Context, exec imparse.Exec) error

func (*PrivateFrame) Type

func (p *PrivateFrame) Type() imparse.FrameType

type SignalFrame

type SignalFrame struct {
	*StandardFrame
	// contains filtered or unexported fields
}

private

func NewNoticeFrame

func NewNoticeFrame(standardFrame *StandardFrame, bizPro *biz.Signal) *SignalFrame

func (*SignalFrame) Ack

func (p *SignalFrame) Ack(ctx context.Context, exec imparse.Exec) (int64, error)

func (*SignalFrame) AckBody

func (p *SignalFrame) AckBody() ([]byte, error)

func (*SignalFrame) Filter

func (p *SignalFrame) Filter(ctx context.Context, db imparse.Cache, filters ...imparse.Filter) (uint64, error)

func (*SignalFrame) GetBase

func (p *SignalFrame) GetBase() *biz.Signal

func (*SignalFrame) PushBody

func (p *SignalFrame) PushBody() ([]byte, error)

func (*SignalFrame) Transport

func (p *SignalFrame) Transport(ctx context.Context, exec imparse.Exec) error

func (*SignalFrame) Type

func (p *SignalFrame) Type() imparse.FrameType

type StandardFrame

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

标准帧 定义了标准协议的Ack数据和Push数据格式

func NewStandardFrame

func NewStandardFrame(base *comet.Proto, key, from string, opts ...Option) *StandardFrame

func (*StandardFrame) AckData

func (f *StandardFrame) AckData() ([]byte, error)

func (*StandardFrame) Data

func (f *StandardFrame) Data() ([]byte, error)

func (*StandardFrame) GetBody

func (f *StandardFrame) GetBody() imparse.BizProto

func (*StandardFrame) GetCreateTime

func (f *StandardFrame) GetCreateTime() uint64

func (*StandardFrame) GetFrom

func (f *StandardFrame) GetFrom() string

func (*StandardFrame) GetKey

func (f *StandardFrame) GetKey() string

func (*StandardFrame) GetMid

func (f *StandardFrame) GetMid() int64

func (*StandardFrame) GetTarget

func (f *StandardFrame) GetTarget() string

func (*StandardFrame) GetTransmissionMethod

func (f *StandardFrame) GetTransmissionMethod() imparse.Channel

func (*StandardFrame) PushData

func (f *StandardFrame) PushData() ([]byte, error)

func (*StandardFrame) SetBody

func (f *StandardFrame) SetBody(body imparse.BizProto)

func (*StandardFrame) SetCreateTime

func (f *StandardFrame) SetCreateTime(createTime uint64)

func (*StandardFrame) SetFrom

func (f *StandardFrame) SetFrom(from string)

func (*StandardFrame) SetKey

func (f *StandardFrame) SetKey(key string)

func (*StandardFrame) SetMid

func (f *StandardFrame) SetMid(mid int64)

func (*StandardFrame) SetTarget

func (f *StandardFrame) SetTarget(target string)

func (*StandardFrame) SetTransmissionMethod

func (f *StandardFrame) SetTransmissionMethod(transmissionMethod imparse.Channel)

type StandardParse

type StandardParse struct {
}

标准解析器 定义了解析标准协议的方法

func (*StandardParse) NewFrame

func (s *StandardParse) NewFrame(key, from string, in io.Reader, opts ...Option) (imparse.Frame, error)

Jump to

Keyboard shortcuts

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