validator

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package validator provides validators for graylog's create and update APIs. validator uses gopkg.in/go-playground/validator.v9 .

https://godoc.org/gopkg.in/go-playground/validator.v9

role := &graylog.Role{}
if err := validator.CreateValidator.Struct(role); err != nil {
	return "", nil, err
}

Index

Constants

This section is empty.

Variables

View Source
var (
	// CreateValidator validates parameters of Create APIs.
	CreateValidator *validator.Validate
	// UpdateValidator validates parameters of Update APIs.
	UpdateValidator *validator.Validate
)

Functions

func ValidateIndexPrefixRegexp

func ValidateIndexPrefixRegexp(lf validator.FieldLevel) bool

ValidateIndexPrefixRegexp validates index prefix's pattern.

func ValidateObjectID

func ValidateObjectID(lf validator.FieldLevel) bool

ValidateObjectID validates objectID https://docs.mongodb.com/manual/reference/bson-types/#objectid

Types

This section is empty.

Jump to

Keyboard shortcuts

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