guard

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStringRequired    = "%s is required"
	ErrStringTooLong     = "%s must be less than %d character(s)"
	ErrStringTooShort    = "%s must be longer than %d character(s)"
	ErrStringLenRequired = "%s must be %d character(s) long"
	ErrInvalidURL        = "%s is not a valid url"
	ErrNotEqual          = "%s is not equal to %s"
)

Functions

func Errorf

func Errorf(format string, args ...interface{}) error

Types

type Guard

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

func New

func New() *Guard

func (*Guard) AddError

func (g *Guard) AddError(err error)

func (*Guard) Error

func (g *Guard) Error() error

func (*Guard) GraphQLError

func (g *Guard) GraphQLError(ctx context.Context) error

func (*Guard) Validate

func (g *Guard) Validate(field, input string) *Suspect

type Suspect

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

func (*Suspect) ExpectEqual

func (s *Suspect) ExpectEqual(field, input string) *Suspect

func (*Suspect) ExpectLen

func (s *Suspect) ExpectLen(length int) *Suspect

func (*Suspect) ExpectMaxLen

func (s *Suspect) ExpectMaxLen(length int) *Suspect

func (*Suspect) ExpectMinLen

func (s *Suspect) ExpectMinLen(length int) *Suspect

func (*Suspect) Required

func (s *Suspect) Required() *Suspect

func (*Suspect) ValidURL

func (s *Suspect) ValidURL() *Suspect

Jump to

Keyboard shortcuts

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