2020-07-10 18:57:57 +01:00
|
|
|
package internal
|
2020-05-31 19:15:57 +01:00
|
|
|
|
2020-07-10 17:09:47 +01:00
|
|
|
// Accountant decribes something that stores accounts and account values
|
|
|
|
type Accountant interface {
|
|
|
|
// RegisterAccount will register a new account and return it's info
|
|
|
|
RegisterAccount(name string) (acc Account, err error)
|
2020-07-07 22:20:23 +01:00
|
|
|
|
2020-07-10 17:09:47 +01:00
|
|
|
// AssignData stores a custom account key value pair
|
|
|
|
AssignData(account string, key string, value string) error
|
|
|
|
|
|
|
|
// GetValue returns custom account data for a specific key
|
|
|
|
GetValue(account string, key string) (string, error)
|
|
|
|
|
|
|
|
// VerifySecret will verify whether the account secret matches with the
|
|
|
|
VerifySecret(account string, secret string) (bool, error)
|
|
|
|
|
|
|
|
// GetSecret gets the secret associated with an account
|
|
|
|
GetSecret(account string) (string, error)
|
|
|
|
}
|
2020-05-31 19:15:57 +01:00
|
|
|
|
|
|
|
// Account represents a registered user
|
|
|
|
type Account struct {
|
|
|
|
// Name simply describes the account and must be unique
|
2020-07-22 19:55:38 +01:00
|
|
|
Name string
|
2020-05-31 19:15:57 +01:00
|
|
|
|
2020-06-10 22:48:45 +01:00
|
|
|
// Data represents internal account data
|
2020-07-22 19:55:38 +01:00
|
|
|
Data map[string]string
|
2020-05-31 19:15:57 +01:00
|
|
|
}
|