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: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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