validate

package
v0.0.0-...-969384c Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LdapGroupValidateRule

type LdapGroupValidateRule struct {
}

LdapGroupValidateRule validate the ldap group configuration

func (LdapGroupValidateRule) Validate

func (l LdapGroupValidateRule) Validate(ctx context.Context, cfgMgr config.Manager, cfgs map[string]interface{}) error

Validate validate the ldap group config settings, cfgs is the config items need to be updated, the final config should be merged with the cfgMgr

type Rule

type Rule interface {
	// Validate validates a specific group of configuration items, cfgs contains the config need to be updated, the final config should merged with the cfgMgr
	Validate(ctx context.Context, cfgMgr config.Manager, cfgs map[string]interface{}) error
}

Rule rules to validate the configure input Steps to add validation rule for configure parameter 1. Create/find the model need to validate, add validate tag in the field. 2. Implement the Rule interface like LdapGroupValidateRule 3. Add the rule to validateRules in pkg/config/manager.go

Jump to

Keyboard shortcuts

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