Versions in this module Expand all Collapse all v1 v1.0.1 Jan 28, 2021 v1.0.0 Jan 18, 2021 Changes in this version + var ErrorDuplicatedUser = errors.New("duplicated user") + var ErrorEmptyEmailOrPwd = errors.New("username and password should not be empty") + var ErrorTokenNotFound = errors.New("token not found") + var ErrorUnauthorized = errors.New("user not authorized") + func ServeHTTP(settings config.Schema) (err error) + type APIAccount struct + Address string + Faucet bool + GenesisBalance string + Name string + Validator bool + type APIEvent struct + Accounts map[string]APIAccount + CreatedOn time.Time + EndsOn time.Time + ID string + Owner string + Provider string + StartsOn time.Time + State map[string]APIMachineConfig + TokenSymbol string + func ToAPIEvent(evt *model.Event) (aEvt APIEvent) + func ToAPIEvents(evts *[]model.Event) (aEvts []APIEvent) + type APIMachineConfig struct + IPAddress string + MachineName string + TendermintNodeID string + type APIReply struct + Message string + Status int + func APIReplyErr(code int, m string) APIReply + func APIReplyOK(m string) APIReply + type APIStatus struct + Status string + Uptime string + Version string + type User struct + Email string + PasswordHash string + type UserCredentials struct + Email string + Pass string + type UsersDB struct + func NewUserDB(dbPath string) (db *UsersDB, err error) + func (db *UsersDB) DropToken(token string) + func (db *UsersDB) GetEmailFromToken(token string) (email string, err error) + func (db *UsersDB) IsAuthorized(email, pass string) (token string, err error) + func (db *UsersDB) IsTokenAuthorized(token string) (email string, err error) + func (db *UsersDB) RegisterUser(email, pass string) (err error)