model

package
v0.0.0-...-bfcc399 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoCustomerInResponse = errors.New("Response has no matching customer")
	ErrMissingField         = "Error missing %v"
)

Functions

This section is empty.

Types

type Falter

type Falter interface {
	Failed() error
}

type GetUserRequest

type GetUserRequest struct {
	A string
}

GetUserRequest collects the request parameters for the GetProducts method.

type GetUserResponse

type GetUserResponse struct {
	V   User  `json:"v"`
	Err error `json:"err,omitempty"` // should be intercepted by Failed/errorEncoder
}

GetUserResponse collects the response values for the GetProducts method.

func (GetUserResponse) Failed

func (r GetUserResponse) Failed() error

Failed implements Failer.

type LoginRequest

type LoginRequest struct {
	Username string
	Password string
}

LoginRequest ..

type LoginResponse

type LoginResponse struct {
	User  *User  `json:"user,omitempty"`
	Token string `json:"token,omitempty"`
	Err   error  `json:"err,omitempty"`
}

LoginResponse ..

type RegisterRequest

type RegisterRequest struct {
	Username  string `json:"username"`
	Password  string `json:"password"`
	Email     string `json:"email"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
}

RegisterRequest struct

type RegisterUserResponse

type RegisterUserResponse struct {
	ID  string `json:"id"`
	Err error  `json:"-"`
}

RegisterUserResponse ...

type User

type User struct {
	FirstName string
	LastName  string
	Email     string
	UserName  string
	Password  string
	UserID    string
	Salt      string
	Authority string
}

func New

func New() User

New ..

func (*User) NewSalt

func (u *User) NewSalt()

NewSalt ..

func (*User) Validate

func (u *User) Validate() error

Validate ..

type UserAuthority

type UserAuthority int
const (
	// UserAuthorityUnknown 未知
	UserAuthorityUnknown UserAuthority = iota
	// UserAuthorityCust 用户
	UserAuthorityCust
	// UserAuthorityTenant 租户/供应商
	UserAuthorityTenant
	// UserAuthorityAdmin 管理员
	UserAuthorityAdmin
)

type UserStatus

type UserStatus int
const (
	// UserStatusUnknown 未知状态
	UserStatusUnknown UserStatus = iota
	// UserStatusCreated 新建正常
	UserStatusCreated
	// UserStatusLocked 锁定
	UserStatusLocked
)

Jump to

Keyboard shortcuts

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