Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultEnvironment = "live" DefaultUsername = "-" DefaultUserID = "-1" )
Default user values.
Variables ¶
View Source
var ( ErrNoConfig = fmt.Errorf("config must contain all fields") ErrNoUser = fmt.Errorf("user not found") )
Errors returned by this package.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Host string `toml:"host" xml:"host" json:"host"` User string `toml:"user" xml:"user" json:"user"` Pass string `toml:"pass" xml:"pass" json:"-"` Name string `toml:"name" xml:"name" json:"name"` *log.Logger `json:"-"` }
Config to get user data from the mysql database.
type UI ¶
UI provides an interface to query a database for user info.
type UserInfo ¶
type UserInfo struct { APIKey string `json:"apiKey,omitempty"` Environment string `json:"environment"` Username string `json:"username"` UserID string `json:"userId"` }
UserInfo is the data returned for each user request.
func DefaultUser ¶
func DefaultUser() *UserInfo
DefaultUser returns an empty user with default values.
Click to show internal directories.
Click to hide internal directories.