Documentation
¶
Overview ¶
Demo code for the Flex primitive.
A presentation of the tview package, implemented with tview.
Navigation ¶
The presentation will advance to the next slide when the primitive demonstrated in the current slide is left (usually by hitting Enter or Escape). Additionally, the following shortcuts can be used:
- Ctrl-N: Jump to next slide
- Ctrl-P: Jump to previous slide
Index ¶
- Variables
- type CView
- func (c *CView) ApiLogin(form *tview.Form)
- func (c *CView) Chat(nextSlide func()) (title string, content tview.Primitive)
- func (c *CView) ChatToUser(userid int, title string)
- func (c *CView) CheckJump(passDone func(), slide string)
- func (c *CView) CheckLogin() bool
- func (c *CView) Cover(nextSlide func()) (title string, content tview.Primitive)
- func (c *CView) Index()
- func (c *CView) JumpTo(pagename string)
- func (c *CView) Login(nextSlide func()) (title string, content tview.Primitive)
- func (c *CView) ReadMessage()
- func (c *CView) Reload(index int, slide Slide)
- func (c *CView) ScreenAndSave(userid int, name string, time string, message string)
- type ClientMessage
- type Slide
- type TypeMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var Exclude_Check []string
不需要检查登录的页面
Functions ¶
This section is empty.
Types ¶
type CView ¶
type CView struct { IsLogin bool App *tview.Application Pages *tview.Pages CurrentSlide string PreviousSlide string Slides []Slide TabInfo *tview.TextView Api *http.Api FriendsList []interface{} UserInfo map[string]interface{} ChatToUserId int //当前聊天用户 MessageList map[int]*list.List //用户消息列表 Ws websocket.Ws TextView *tview.TextView }
func (*CView) CheckLogin ¶
type ClientMessage ¶
type ClientMessage struct { Name string `json:"name"` Avator string `json:"avator"` Id string `json:"id"` Group string `json:"group"` Time string `json:"time"` ToId string `json:"to_id"` Content string `json:"content"` City string `json:"city"` ClientIp string `json:"client_ip"` Refer string `json:"refer"` }
TypeMessage Data
type Slide ¶
Slide is a function which returns the slide's main primitive and its title. It receives a "nextSlide" function which can be called to advance the presentation to the next slide.
type TypeMessage ¶
type TypeMessage struct { Type interface{} `json:"type"` //内容分发类型:ping、init、message 等等 Data interface{} `json:"data"` }
发送内容content 载体
Click to show internal directories.
Click to hide internal directories.