types

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrUsernameInvalid is error message for invalidate username
	ErrUsernameInvalid = errors.New("Username length should > 6 and < 20, only support character, numbers and '_'")
	// ErrPasswordInvalid is error message for invalidate password
	ErrPasswordInvalid = errors.New("Password's length should > 6 and < 20")
)

Functions

This section is empty.

Types

type Response

type Response struct {
	// Success is if a success response
	Success bool `json:"success"`
	// Message is error message
	Message string `json:"message"`
	// Data is response data
	Data interface{} `json:"data"`
}

Response is common api response struct

type UserForm

type UserForm struct {
	// Username is user name
	Username string `json:"username"`
	// Password is user password
	Password string `json:"password"`
}

UserForm is struct for register and login post

func (*UserForm) Validate

func (u *UserForm) Validate() (bool, error)

Validate is UserForm validator

Jump to

Keyboard shortcuts

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