Documentation ¶
Index ¶
- func CreateJWTToken(env string, username string, password string) (string, error)
- func CreateOSIOToken(env string, uuid string, key string, keyID string, valid int64, session string) (string, error)
- func EnsureSuffix(s string, suffix string) string
- func HTTPClient() *http.Client
- func IsBool(value interface{}, key string) error
- func IsDuration(value interface{}, key string) error
- func IsInt(value interface{}, key string) error
- func IsNotEmpty(value interface{}, key string) error
- func IsURL(value interface{}, key string) error
- func NameOfFunction(pc uintptr) string
- type Attributes
- type Data
- type Error
- type ErrorInfo
- type MultiError
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateJWTToken ¶
CreateJWTToken gets raw jwt token from username, password and environment.
func CreateOSIOToken ¶
func CreateOSIOToken(env string, uuid string, key string, keyID string, valid int64, session string) (string, error)
CreateOSIOToken creates OSIO token given inputs such as user identity, environment, etc.
func EnsureSuffix ¶
EnsureSuffix ensures that hte given strings ends with the specified suffix. If the string s already ends with the suffix suffix, then it is returned unmodified, otherwise string s with the suffix appended is returned.
func IsDuration ¶
IsDuration checks if value stored at a given key is a bool.
func IsNotEmpty ¶
IsNotEmpty checks if value stored at given key is empty. if it is empty it returns an error.
func NameOfFunction ¶
NameOfFunction gives name of the current function given program counter.
Types ¶
type Attributes ¶
type Attributes struct { Username string `json:"username"` Email string `json:"email"` FullName string `json:"fullName"` }
Attributes consists of user attributes such as username, email and fullname.
type Data ¶
type Data struct {
Attributes Attributes `json:"attributes"`
}
Data contains user attributes.
type ErrorInfo ¶
ErrorInfo describes an HTTP error, consisting of HTTP status code and error detail.
type MultiError ¶
type MultiError struct {
Errors []error
}
MultiError is a collection of errors.
func (*MultiError) Collect ¶
func (m *MultiError) Collect(err error)
Collect appends an error to this MultiError.
func (*MultiError) Empty ¶
func (m *MultiError) Empty() bool
Empty returns true if current MuiltiError is empty, false otherwise.
func (MultiError) ToError ¶
func (m MultiError) ToError() error
ToError returns a single error made up of all errors in this MultiError.