Documentation ¶
Index ¶
- Variables
- func AssertNoError(err error)
- func DialRouter(operator string, urlStr string, registerClient ClientRegistrar) (*websocket.Conn, error)
- func HostAccount(id string, creater func(*AccountEventEmitter) *Account) error
- func HostApp(id string, creater func(*AppApi) *App) error
- func HostClient(registerClient ClientRegistrar, configRPC RPCConfigurator) error
- func IsValidMsgType(msgType string) bool
- type Account
- type AccountEventEmitter
- type App
- type AppApi
- type ClientRegistrar
- type EventResultType
- type Manager
- type MsgBuilder
- type MsgEntity
- type MsgInfo
- type MsgType
- type RPCConfigurator
Constants ¶
This section is empty.
Variables ¶
View Source
var MsgTypePattern = regexp.MustCompile(`^[a-z0-9_\.]+$`)
Functions ¶
func AssertNoError ¶
func AssertNoError(err error)
func DialRouter ¶
func HostAccount ¶
func HostAccount(id string, creater func(*AccountEventEmitter) *Account) error
func HostClient ¶
func HostClient(registerClient ClientRegistrar, configRPC RPCConfigurator) error
func IsValidMsgType ¶
Types ¶
type Account ¶
type Account struct { GetGroupName func(id string) (string, error) GetUserName func(id string) (string, error) SendChatMessage func(msgType MsgType, source string, target string, message string) error RemoveMember func(source string, target string) error ShutupMember func(source string, target string, duration int) error ShutupAllMember func(source string, shutupSwitch bool) error GetMemberName func(source string, target string) (string, error) GetUserAvatar func(id string) (string, error) GetSelfID func() (string, error) GetPlatformID func() (string, error) GetGroupList func() ([]string, error) GetMemberList func(id string) ([]string, error) }
func (*Account) Register ¶
func (a *Account) Register(rpc *wsrpc.WebsocketRPC)
type AccountEventEmitter ¶
type AccountEventEmitter struct { OnReceiveChatMessage func(msgType MsgType, source string, sender string, message string, info MsgInfo) error OnMemberJoined func(source string, sender string, inviter string) error OnMemberLeft func(source string, sender string) error ProcessGroupInvitation func(sender string, target string, reason string) (EventResultType, *string, error) ProcessFriendRequest func(sender string, reason string) (EventResultType, *string, error) ProcessMembershipRequest func(source string, sender string, inviter string, reason string) (EventResultType, *string, error) }
func (*AccountEventEmitter) Get ¶
func (a *AccountEventEmitter) Get(rpcConn *wsrpc.WebsocketRPCConn)
type App ¶
type App struct { OnReceiveChatMessage func(bot string, msgType MsgType, source string, sender string, message string, info MsgInfo) (EventResultType, error) OnMemberJoined func(bot string, source string, sender string, inviter string) (EventResultType, error) OnMemberLeft func(bot string, source string, sender string) (EventResultType, error) ProcessGroupInvitation func(bot string, sender string, target string, reason string) (EventResultType, *string, error) ProcessFriendRequest func(bot string, sender string, reason string) (EventResultType, *string, error) ProcessMembershipRequest func(bot string, source string, sender string, inviter string, reason string) (EventResultType, *string, error) }
func (*App) Register ¶
func (a *App) Register(rpc *wsrpc.WebsocketRPC)
type AppApi ¶
type AppApi struct { GetGroupName func(bot string, id string) (string, error) GetUserName func(bot string, id string) (string, error) SendChatMessage func(bot string, msgType MsgType, source string, target string, message string) error RemoveMember func(bot string, source string, target string) error ShutupMember func(bot string, source string, target string, duration int) error ShutupAllMember func(bot string, source string, shutupSwitch bool) error GetMemberName func(bot string, source string, target string) (string, error) GetUserAvatar func(bot string, id string) (string, error) GetSelfID func(bot string) (string, error) GetPlatformID func(bot string) (string, error) GetGroupList func(bot string) ([]string, error) GetMemberList func(bot string, id string) ([]string, error) GetBotList func() ([]string, error) }
func (*AppApi) Get ¶
func (a *AppApi) Get(rpcConn *wsrpc.WebsocketRPCConn)
type ClientRegistrar ¶
type EventResultType ¶
type EventResultType int
const AcceptRequest EventResultType = 10
const CompleteEvent EventResultType = 2
const ContinueEvent EventResultType = 1
const IgnoreEvent EventResultType = 0
const RejectRequest EventResultType = 20
type Manager ¶
type Manager struct { RegisterApp func(id string) (string, error) RegisterAccount func(id string) (string, error) }
func (*Manager) Get ¶
func (a *Manager) Get(rpcConn *wsrpc.WebsocketRPCConn)
type MsgBuilder ¶
type MsgBuilder struct {
// contains filtered or unexported fields
}
func (*MsgBuilder) String ¶
func (b *MsgBuilder) String() string
func (*MsgBuilder) WriteEntity ¶
func (b *MsgBuilder) WriteEntity(e MsgEntity) *MsgBuilder
func (*MsgBuilder) WriteRaw ¶
func (b *MsgBuilder) WriteRaw(s []byte) *MsgBuilder
func (*MsgBuilder) WriteRawString ¶
func (b *MsgBuilder) WriteRawString(s string) *MsgBuilder
func (*MsgBuilder) WriteString ¶
func (b *MsgBuilder) WriteString(s string) *MsgBuilder
WriteString is similar to writeArgString
type MsgEntity ¶
func (*MsgEntity) FirstArgOrEmpty ¶
type RPCConfigurator ¶
type RPCConfigurator func(rpc *wsrpc.WebsocketRPC, rpcConn *wsrpc.WebsocketRPCConn) error
Click to show internal directories.
Click to hide internal directories.