validations

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package validations contains validation functions for ent fields

Package validations contains validation functions for ent fields

Index

Constants

This section is empty.

Variables

View Source
var ErrFieldEmpty = errors.New("must not be empty")

ErrFieldEmpty is returned when a field is empty

View Source
var ErrInvalidIPAddress = errors.New("invalid ip address")

ErrInvalidIPAddress is returned when the given string is not a valid IP address

View Source
var ErrRestrictedPort = errors.New("port number restricted")

ErrRestrictedPort is returned when the given port is restricted

Functions

func IPAddress

func IPAddress(ip string) error

IPAddress validates if the given string is a valid IP address

func NameField added in v0.3.2

func NameField(name string) error

NameField validates the name field

func OptionalNameField added in v0.3.2

func OptionalNameField(name string) error

OptionalNameField validates the name field when optional

func RestrictedPorts added in v0.0.26

func RestrictedPorts(port int) error

RestrictedPorts validates if the given port is restricted

Types

This section is empty.

Jump to

Keyboard shortcuts

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