auth_domain

package
v0.0.0-...-950d083 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Errors

type Errors map[string]error

Errors represents the validation errors that are indexed by struct field names, map or slice keys. values are Error or Errors (for map, slice and array error value is Errors).

func NewValidationErrorMessage

func NewValidationErrorMessage(message string) Errors

NewValidationErrorMessage create new error.

func (Errors) Error

func (es Errors) Error() string

Error returns the error string of Errors.

func (Errors) Filter

func (es Errors) Filter() error

Filter removes all nils from Errors and returns back the updated Errors as an error. If the length of Errors becomes 0, it will return nil.

func (Errors) MarshalJSON

func (es Errors) MarshalJSON() ([]byte, error)

MarshalJSON converts the Errors into a valid JSON.

type HttpError

type HttpError struct {
	Code    int
	Message string
}

func NewHttpError

func NewHttpError(code int, message string) *HttpError

NewHttpError create new error.

func (*HttpError) Error

func (e *HttpError) Error() string

type User

type User struct {
	Id                 uuid.UUID `json:"id"`
	Email              string    `json:"email"`
	Password           string    `json:"-"`
	FirstName          string    `json:"firstName"`
	LastName           string    `json:"lastName"`
	AuthorizationToken *string   `json:"authorizationToken,omitempty"`
	SessionToken       *string   `json:"-"`
}

func NewUser

func NewUser(email, password, firstName, lastName string) *User

func (*User) SetAuthorizationToken

func (u *User) SetAuthorizationToken(token string)

func (*User) Validate

func (u *User) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL