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.
Click to show internal directories.
Click to hide internal directories.