package auth type User struct { ID string Name string Level string Data map[string]string method Authenticator loggedOut bool } // FullID is the userid prefixed with the method ID func (user *User) FullID() string { return user.method.ID() + ":" + user.ID } // Logout flags the user for logout func (user *User) Logout() { user.loggedOut = true } // LoggedOut returns whether the Logout() function has been called func (user *User) LoggedOut() bool { return user.loggedOut } // NewUser creates a new User object func NewUser(method Authenticator, id, name, level string, data map[string]string) *User { return &User{id, name, level, data, method, false} }