validator

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NameRegex 名前正規表現
	NameRegex = regexp.MustCompile(`^[a-zA-Z0-9_-]{1,32}$`)
	// ChannelRegex チャンネル名正規表現
	ChannelRegex = regexp.MustCompile(`^[a-zA-Z0-9-_]{1,20}$`)
	// PasswordRegex パスワード正規表現
	PasswordRegex = regexp.MustCompile(`^[\x20-\x7E]{10,32}$`)
	// TwitterIDRegex ツイッターIDの正規表現
	TwitterIDRegex = regexp.MustCompile(`^[a-zA-Z0-9_]{1,15}$`)
)

Functions

func ValidateStruct

func ValidateStruct(i interface{}) error

ValidateStruct 構造体を検証します

func ValidateVar

func ValidateVar(i interface{}, tag string) error

ValidateVar 値を検証します

Types

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator echo用バリデーター

func New

func New() *Validator

New echo用バリデーター

func (*Validator) Validate

func (v *Validator) Validate(i interface{}) error

Validate 構造体を検証します

Jump to

Keyboard shortcuts

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