puppetservice

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// WechatyPuppetHostieToken ...
	// Deprecated: please use WechatyPuppetServiceToken TODO:will be deleted in the future
	WechatyPuppetHostieToken string

	// WechatyPuppetHostieEndpoint ...
	// Deprecated: please use WechatyPuppetHostieEndpoint TODO:will be deleted in the future
	WechatyPuppetHostieEndpoint string

	// WechatyPuppetServiceToken ...
	WechatyPuppetServiceToken string

	// WechatyPuppetServiceEndpoint ...
	WechatyPuppetServiceEndpoint string
)
View Source
var (
	// ErrNoEndpoint err no endpoint
	ErrNoEndpoint = errors.New("no endpoint")
	// ErrURLLinkPayloadNotFound ...
	ErrURLLinkPayloadNotFound = errors.New("UrlLinkPayloadNotFound")
)
View Source
var ErrNoName = errors.New("no name")

ErrNoName err no name

View Source
var (
	// ErrNotToken token not found error
	ErrNotToken = errors.New("wechaty-puppet-service: token not found. See: <https://github.com/wechaty/wechaty-puppet-service#1-wechaty_puppet_service_token>")
)

Functions

func NewFileBoxFromMessageFileStream

func NewFileBoxFromMessageFileStream(client pbwechaty.Puppet_MessageFileStreamClient) (*filebox.FileBox, error)

NewFileBoxFromMessageFileStream ...

func ToMessageSendFileWriter

func ToMessageSendFileWriter(client pbwechaty.Puppet_MessageSendFileStreamClient, conversationID string, fileBox *filebox.FileBox) (io.Writer, error)

ToMessageSendFileWriter 把 grpc 流包装到 io.Writer 接口

Types

type DownloadFile

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

DownloadFile 把 grpc download 流包装到 io.Reader 接口

func NewDownloadFile

func NewDownloadFile(client pbwechaty.Puppet_DownloadClient) *DownloadFile

NewDownloadFile 把 grpc download 流包装到 io.Reader 接口

func (*DownloadFile) Read

func (m *DownloadFile) Read(p []byte) (n int, err error)

Read 把 grpc download 流包装到 io.Reader 接口

type MessageFile

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

MessageFile 把 grpc 流包装到 io.Reader 接口

func NewMessageFile

NewMessageFile ...

func (*MessageFile) Read

func (m *MessageFile) Read(p []byte) (n int, err error)

Read 把 grpc 流包装到 io.Reader 接口

type MessageSendFile

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

MessageSendFile 把 grpc 流包装到 io.Writer 接口

func (*MessageSendFile) Write

func (m *MessageSendFile) Write(p []byte) (n int, err error)

Write 把 grpc 流包装到 io.Writer 接口

type PuppetService

type PuppetService struct {
	*wechatyPuppet.Puppet
	// contains filtered or unexported fields
}

PuppetService struct

func NewPuppetService

func NewPuppetService(o wechatyPuppet.Option) (*PuppetService, error)

NewPuppetService new PuppetService struct

func (*PuppetService) ContactAlias

func (p *PuppetService) ContactAlias(contactID string) (string, error)

ContactAlias ...

func (*PuppetService) ContactAvatar

func (p *PuppetService) ContactAvatar(contactID string) (*filebox.FileBox, error)

ContactAvatar ...

func (*PuppetService) ContactList

func (p *PuppetService) ContactList() ([]string, error)

ContactList ...

func (*PuppetService) ContactQRCode

func (p *PuppetService) ContactQRCode(contactID string) (string, error)

ContactQRCode ...

func (*PuppetService) ContactRawPayload

func (p *PuppetService) ContactRawPayload(contactID string) (*schemas.ContactPayload, error)

ContactRawPayload ...

func (*PuppetService) ContactSelfQRCode

func (p *PuppetService) ContactSelfQRCode() (string, error)

ContactSelfQRCode ...

func (*PuppetService) Ding

func (p *PuppetService) Ding(data string)

Ding ...

func (*PuppetService) DirtyPayload

func (p *PuppetService) DirtyPayload(payloadType schemas.PayloadType, id string) error

DirtyPayload ...

func (*PuppetService) FriendshipAccept

func (p *PuppetService) FriendshipAccept(friendshipID string) (err error)

FriendshipAccept ...

func (*PuppetService) FriendshipAdd

func (p *PuppetService) FriendshipAdd(contactID, hello string) (err error)

FriendshipAdd ...

func (*PuppetService) FriendshipRawPayload

func (p *PuppetService) FriendshipRawPayload(id string) (*schemas.FriendshipPayload, error)

FriendshipRawPayload ...

func (*PuppetService) FriendshipSearchPhone

func (p *PuppetService) FriendshipSearchPhone(phone string) (string, error)

FriendshipSearchPhone ...

func (*PuppetService) FriendshipSearchWeixin

func (p *PuppetService) FriendshipSearchWeixin(weixin string) (string, error)

FriendshipSearchWeixin ...

func (*PuppetService) Logout

func (p *PuppetService) Logout() error

Logout ...

func (*PuppetService) MessageContact

func (p *PuppetService) MessageContact(messageID string) (string, error)

MessageContact ...

func (*PuppetService) MessageFile

func (p *PuppetService) MessageFile(id string) (*filebox.FileBox, error)

MessageFile ...

func (*PuppetService) MessageForward

func (p *PuppetService) MessageForward(conversationID string, messageID string) (string, error)

MessageForward message forward

func (*PuppetService) MessageImage

func (p *PuppetService) MessageImage(messageID string, imageType schemas.ImageType) (*filebox.FileBox, error)

MessageImage ...

func (*PuppetService) MessageRawMiniProgramPayload

func (p *PuppetService) MessageRawMiniProgramPayload(messageID string) (*schemas.MiniProgramPayload, error)

MessageRawMiniProgramPayload ...

func (*PuppetService) MessageRawPayload

func (p *PuppetService) MessageRawPayload(id string) (*schemas.MessagePayload, error)

MessageRawPayload ...

func (*PuppetService) MessageRecall

func (p *PuppetService) MessageRecall(messageID string) (bool, error)

MessageRecall ...

func (*PuppetService) MessageSendContact

func (p *PuppetService) MessageSendContact(conversationID string, contactID string) (string, error)

MessageSendContact ...

func (*PuppetService) MessageSendFile

func (p *PuppetService) MessageSendFile(conversationID string, fileBox *filebox.FileBox) (string, error)

MessageSendFile ...

func (*PuppetService) MessageSendMiniProgram

func (p *PuppetService) MessageSendMiniProgram(conversationID string, miniProgramPayload *schemas.MiniProgramPayload) (string, error)

MessageSendMiniProgram ...

func (*PuppetService) MessageSendText

func (p *PuppetService) MessageSendText(conversationID string, text string, mentionIDList ...string) (string, error)

MessageSendText ...

func (*PuppetService) MessageSendURL

func (p *PuppetService) MessageSendURL(conversationID string, urlLinkPayload *schemas.UrlLinkPayload) (string, error)

MessageSendURL ...

func (*PuppetService) MessageURL

func (p *PuppetService) MessageURL(messageID string) (*schemas.UrlLinkPayload, error)

MessageURL ...

func (*PuppetService) RoomAdd

func (p *PuppetService) RoomAdd(roomID, contactID string) error

RoomAdd ...

func (*PuppetService) RoomAnnounce

func (p *PuppetService) RoomAnnounce(roomID string) (string, error)

RoomAnnounce ...

func (*PuppetService) RoomAvatar

func (p *PuppetService) RoomAvatar(roomID string) (*filebox.FileBox, error)

RoomAvatar ...

func (*PuppetService) RoomCreate

func (p *PuppetService) RoomCreate(contactIDList []string, topic string) (string, error)

RoomCreate ...

func (*PuppetService) RoomDel

func (p *PuppetService) RoomDel(roomID, contactID string) error

RoomDel ...

func (*PuppetService) RoomInvitationAccept

func (p *PuppetService) RoomInvitationAccept(roomInvitationID string) error

RoomInvitationAccept ...

func (*PuppetService) RoomInvitationRawPayload

func (p *PuppetService) RoomInvitationRawPayload(id string) (*schemas.RoomInvitationPayload, error)

RoomInvitationRawPayload ...

func (*PuppetService) RoomList

func (p *PuppetService) RoomList() ([]string, error)

RoomList ...

func (*PuppetService) RoomMemberList

func (p *PuppetService) RoomMemberList(roomID string) ([]string, error)

RoomMemberList ...

func (*PuppetService) RoomMemberRawPayload

func (p *PuppetService) RoomMemberRawPayload(roomID string, contactID string) (*schemas.RoomMemberPayload, error)

RoomMemberRawPayload ...

func (*PuppetService) RoomQRCode

func (p *PuppetService) RoomQRCode(roomID string) (string, error)

RoomQRCode ...

func (*PuppetService) RoomQuit

func (p *PuppetService) RoomQuit(roomID string) error

RoomQuit ...

func (*PuppetService) RoomRawPayload

func (p *PuppetService) RoomRawPayload(id string) (*schemas.RoomPayload, error)

RoomRawPayload ...

func (*PuppetService) RoomTopic

func (p *PuppetService) RoomTopic(roomID string) (string, error)

RoomTopic ...

func (*PuppetService) SetContactAlias

func (p *PuppetService) SetContactAlias(contactID string, alias string) error

SetContactAlias ...

func (*PuppetService) SetContactAvatar

func (p *PuppetService) SetContactAvatar(contactID string, fileBox *filebox.FileBox) error

SetContactAvatar ...

func (*PuppetService) SetContactSelfName

func (p *PuppetService) SetContactSelfName(name string) error

SetContactSelfName ...

func (*PuppetService) SetContactSelfSignature

func (p *PuppetService) SetContactSelfSignature(signature string) error

SetContactSelfSignature ...

func (*PuppetService) SetRoomAnnounce

func (p *PuppetService) SetRoomAnnounce(roomID, text string) error

SetRoomAnnounce ...

func (*PuppetService) SetRoomTopic

func (p *PuppetService) SetRoomTopic(roomID string, topic string) error

SetRoomTopic ...

func (*PuppetService) Start

func (p *PuppetService) Start() (err error)

Start ...

func (*PuppetService) Stop

func (p *PuppetService) Stop()

Stop ...

func (*PuppetService) TagContactAdd

func (p *PuppetService) TagContactAdd(id, contactID string) (err error)

TagContactAdd ...

func (*PuppetService) TagContactDelete

func (p *PuppetService) TagContactDelete(id string) (err error)

TagContactDelete ...

func (*PuppetService) TagContactList

func (p *PuppetService) TagContactList(contactID string) ([]string, error)

TagContactList ...

func (*PuppetService) TagContactRemove

func (p *PuppetService) TagContactRemove(id, contactID string) (err error)

TagContactRemove ...

type ServiceEndPoint

type ServiceEndPoint struct {
	IP   string `json:"ip"`
	Port int    `json:"port,omitempty"`
}

ServiceEndPoint api.chatie.io endpoint api response

func (*ServiceEndPoint) IsValid

func (p *ServiceEndPoint) IsValid() bool

IsValid EndPoint is valid

func (*ServiceEndPoint) Target

func (p *ServiceEndPoint) Target() string

Target Export IP+Port

Jump to

Keyboard shortcuts

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