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

Commit

Permalink
add LoginUser and IsLogin and resolved #6
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Apr 16, 2016
1 parent e8484ac commit 60c0b22
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ type Conn struct {
appendData bool
}

func (conn *Conn) LoginUser() string {
return conn.user
}

func (conn *Conn) IsLogin() bool {
return len(conn.user) > 0
}

// returns a random 20 char string that can be used as a unique session ID
func newSessionId() string {
hash := sha256.New()
Expand Down

0 comments on commit 60c0b22

Please sign in to comment.