Documentation ¶
Index ¶
- type IPuppetAbstract
- type MsgAdapter
- type Option
- type OptionFn
- type Puppet
- func (p *Puppet) ContactPayload(contactID string) (*schemas.ContactPayload, error)
- func (p *Puppet) ContactSearch(query interface{}, searchIDList []string) ([]string, error)
- func (p *Puppet) ContactValidate(contactID string) bool
- func (p *Puppet) DirtyPayload(payloadType schemas.PayloadType, id string) error
- func (p *Puppet) FriendshipPayload(friendshipID string) (*schemas.FriendshipPayload, error)
- func (p *Puppet) FriendshipSearch(query *schemas.FriendshipSearchCondition) (string, error)
- func (p *Puppet) MessageForward(conversationID string, messageID string) (string, error)
- func (p *Puppet) MessageList() (ks []string)
- func (p *Puppet) MessageMiniProgram(messageID string) (*schemas.MiniProgramPayload, error)
- func (p *Puppet) MessagePayload(messageID string) (*schemas.MessagePayload, error)
- func (p *Puppet) MessageSearch(query *schemas.MessageQueryFilter) ([]string, error)
- func (p *Puppet) OnDirty(payloadType schemas.PayloadType, id string) error
- func (p *Puppet) RoomInvitationPayload(roomInvitationID string) (*schemas.RoomInvitationPayload, error)
- func (p *Puppet) RoomMemberPayload(roomID, memberID string) (*schemas.RoomMemberPayload, error)
- func (p *Puppet) RoomMemberSearch(roomID string, query interface{}) ([]string, error)
- func (p *Puppet) RoomPayload(roomID string) (payload *schemas.RoomPayload, err error)
- func (p *Puppet) RoomSearch(query *schemas.RoomQueryFilter) ([]string, error)
- func (p *Puppet) RoomValidate(roomID string) bool
- func (p *Puppet) SelfID() string
- func (p *Puppet) SetFriendshipPayload(friendshipID string, newPayload *schemas.FriendshipPayload)
- func (p *Puppet) SetID(id string)
- func (p *Puppet) SetPuppetImplementation(i IPuppetAbstract)
- func (p *Puppet) SetRoomInvitationPayload(payload *schemas.RoomInvitationPayload)
- type RawMsgAdapter
- type RecalledMsgAdapter
- type UnknownMsgAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPuppetAbstract ¶
type IPuppetAbstract interface { MessageSearch(query *schemas.MessageQueryFilter) ([]string, error) MessagePayload(messageID string) (payload *schemas.MessagePayload, err error) FriendshipPayload(friendshipID string) (*schemas.FriendshipPayload, error) SetFriendshipPayload(friendshipID string, newPayload *schemas.FriendshipPayload) RoomPayload(roomID string) (payload *schemas.RoomPayload, err error) ContactPayload(contactID string) (*schemas.ContactPayload, error) ContactSearch(query interface{}, searchIDList []string) ([]string, error) FriendshipSearch(query *schemas.FriendshipSearchCondition) (string, error) SelfID() string events.EventEmitter ContactValidate(contactID string) bool RoomValidate(roomID string) bool RoomMemberSearch(roomID string, query interface{}) ([]string, error) RoomMemberPayload(roomID, memberID string) (*schemas.RoomMemberPayload, error) MessageForward(conversationID string, messageID string) (string, error) RoomSearch(query *schemas.RoomQueryFilter) ([]string, error) RoomInvitationPayload(roomInvitationID string) (*schemas.RoomInvitationPayload, error) SetRoomInvitationPayload(payload *schemas.RoomInvitationPayload) DirtyPayload(payloadType schemas.PayloadType, id string) error MessageMiniProgram(messageID string) (*schemas.MiniProgramPayload, error) // contains filtered or unexported methods }
IPuppetAbstract puppet abstract class interface
type MsgAdapter ¶
type MsgAdapter interface {
Handle(payload *schemas.MessagePayload)
}
MsgAdapter 消息适配器
func NewMsgAdapter ¶
func NewMsgAdapter(msgType schemas.MessageType) MsgAdapter
NewMsgAdapter 各种 puppet 返回的消息有出入,这里做统一
type Option ¶
type Option struct { Endpoint string Timeout time.Duration Token string GrpcReconnectInterval time.Duration }
Option puppet option
type Puppet ¶
type Puppet struct { Option // puppet implementation puppet_service or puppet_mock events.EventEmitter // contains filtered or unexported fields }
Puppet puppet abstract struct
func (*Puppet) ContactPayload ¶
func (p *Puppet) ContactPayload(contactID string) (*schemas.ContactPayload, error)
ContactPayload ...
func (*Puppet) ContactSearch ¶
ContactSearch query params is string or *schemas.ContactQueryFilter
func (*Puppet) ContactValidate ¶
ContactValidate ...
func (*Puppet) DirtyPayload ¶
func (p *Puppet) DirtyPayload(payloadType schemas.PayloadType, id string) error
DirtyPayload base clean cache
func (*Puppet) FriendshipPayload ¶
func (p *Puppet) FriendshipPayload(friendshipID string) (*schemas.FriendshipPayload, error)
FriendshipPayload ...
func (*Puppet) FriendshipSearch ¶
func (p *Puppet) FriendshipSearch(query *schemas.FriendshipSearchCondition) (string, error)
FriendshipSearch ...
func (*Puppet) MessageForward ¶
MessageForward ...
func (*Puppet) MessageMiniProgram ¶
func (p *Puppet) MessageMiniProgram(messageID string) (*schemas.MiniProgramPayload, error)
MessageMiniProgram ...
func (*Puppet) MessagePayload ¶
func (p *Puppet) MessagePayload(messageID string) (*schemas.MessagePayload, error)
MessagePayload message payload todo:: no finish
func (*Puppet) MessageSearch ¶
func (p *Puppet) MessageSearch(query *schemas.MessageQueryFilter) ([]string, error)
MessageSearch search message
func (*Puppet) OnDirty ¶
func (p *Puppet) OnDirty(payloadType schemas.PayloadType, id string) error
OnDirty clean cache
func (*Puppet) RoomInvitationPayload ¶
func (p *Puppet) RoomInvitationPayload(roomInvitationID string) (*schemas.RoomInvitationPayload, error)
RoomInvitationPayload ...
func (*Puppet) RoomMemberPayload ¶
func (p *Puppet) RoomMemberPayload(roomID, memberID string) (*schemas.RoomMemberPayload, error)
RoomMemberPayload ...
func (*Puppet) RoomMemberSearch ¶
RoomMemberSearch ...
func (*Puppet) RoomPayload ¶
func (p *Puppet) RoomPayload(roomID string) (payload *schemas.RoomPayload, err error)
RoomPayload ...
func (*Puppet) RoomSearch ¶
func (p *Puppet) RoomSearch(query *schemas.RoomQueryFilter) ([]string, error)
RoomSearch ...
func (*Puppet) SetFriendshipPayload ¶
func (p *Puppet) SetFriendshipPayload(friendshipID string, newPayload *schemas.FriendshipPayload)
SetFriendshipPayload ...
func (*Puppet) SetPuppetImplementation ¶
func (p *Puppet) SetPuppetImplementation(i IPuppetAbstract)
SetPuppetImplementation set puppet implementation
func (*Puppet) SetRoomInvitationPayload ¶
func (p *Puppet) SetRoomInvitationPayload(payload *schemas.RoomInvitationPayload)
SetRoomInvitationPayload ...
type RecalledMsgAdapter ¶
type RecalledMsgAdapter struct{}
RecalledMsgAdapter 撤回类型的消息适配器
func (RecalledMsgAdapter) Handle ¶
func (r RecalledMsgAdapter) Handle(payload *schemas.MessagePayload)
Handle padlocal 返回的是 xml,需要解析出 msgId
type UnknownMsgAdapter ¶
type UnknownMsgAdapter struct{}
UnknownMsgAdapter Unknown 类型的消息适配器
func (UnknownMsgAdapter) Handle ¶
func (u UnknownMsgAdapter) Handle(payload *schemas.MessagePayload)
Handle 对 Unknown 类型的消息做适配