validationrule

package
v0.1.8 Latest Latest
Warning

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

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

Documentation

Overview

Package validationrule describes validation rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutomaticallyNamed

type AutomaticallyNamed struct{}

AutomaticallyNamed can be embedded into a rule struct to indicate that the rule does not require its name to be manually specified because it is automatically generated from other data in the rule.

func (AutomaticallyNamed) RequiresName

func (AutomaticallyNamed) RequiresName() bool

RequiresName returns false.

func (AutomaticallyNamed) SetName

func (AutomaticallyNamed) SetName(string)

SetName is a no-op because the rule does not support manually specifying its name.

type Interface

type Interface interface {
	// Name returns the name of the rule.
	Name() string
	// SetName sets the name of the rule if it is a rule that requires manually specifying its name.
	// This should be a no-op for rules that automatically generate their name.
	SetName(string)
	// RequiresName returns whether the validation rule requires its name to be manually specified.
	// This should return false for rules that automatically generate their name.
	RequiresName() bool
}

Interface defines validation rule behavior.

type ManuallyNamed

type ManuallyNamed struct{}

ManuallyNamed can be embedded into a rule struct to indicate that the rule requires its name to be manually specified.

func (ManuallyNamed) RequiresName

func (ManuallyNamed) RequiresName() bool

RequiresName returns true.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳