Documentation ¶
Overview ¶
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func Clear()
- func CloseClient(user string) bool
- func CloseMessage(user string, types ...string)
- func NewUserNotices() *userNotices
- func OpenClient(user string)
- func OpenMessage(user string, types ...string)
- func Recv(user string) <-chan *Message
- func RecvJSON(user string) []byte
- func RecvXML(user string) []byte
- func Send(user string, message *Message)
- func Stdout(message *Message)
- type Message
- type Notice
- type OnlineUser
Constants ¶
const ( Succeed = 1 Failed = 0 Unauthenticated = -1 Forbid = -2 )
Variables ¶
var DefaultUserNotices = NewUserNotices()
Functions ¶
func CloseClient ¶
func CloseMessage ¶
func NewUserNotices ¶
func NewUserNotices() *userNotices
func OpenClient ¶
func OpenClient(user string)
func OpenMessage ¶
Types ¶
type Message ¶
type Message struct { Type string `json:"type" xml:"type"` Title string `json:"title" xml:"title"` Status int `json:"status" xml:"status"` Content interface{} `json:"content" xml:"content"` }
func NewMessage ¶
func NewMessage() *Message
type OnlineUser ¶
func NewOnlineUser ¶
func NewOnlineUser() *OnlineUser