Core functionality for new aiterp.net servers
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
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} }
|