Skip to content
This repository was archived by the owner on Jul 8, 2020. It is now read-only.

Commit 60c0b22

Browse files
committed
add LoginUser and IsLogin and resolved #6
1 parent e8484ac commit 60c0b22

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

conn.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ type Conn struct {
3535
appendData bool
3636
}
3737

38+
func (conn *Conn) LoginUser() string {
39+
return conn.user
40+
}
41+
42+
func (conn *Conn) IsLogin() bool {
43+
return len(conn.user) > 0
44+
}
45+
3846
// returns a random 20 char string that can be used as a unique session ID
3947
func newSessionId() string {
4048
hash := sha256.New()

0 commit comments

Comments
 (0)