validators

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeServerName

func SanitizeServerName(name string) string

SanitizeServerName removes any characters that are not alphanumeric, spaces, hyphens, underscores, or periods. Use this when you need to clean a name rather than reject it outright.

func ValidateServerName

func ValidateServerName(name string) bool

ValidateServerName checks if the server name contains only safe characters.

Types

type CreateServerValidator

type CreateServerValidator struct {
	// contains filtered or unexported fields
}

func NewCreateServerValidator

func NewCreateServerValidator(serverService *services.ServerService) *CreateServerValidator

func (*CreateServerValidator) Validate

func (v *CreateServerValidator) Validate(form forms.CreateServer) map[string]string

type ServerUpdateValidator

type ServerUpdateValidator struct {
	// contains filtered or unexported fields
}

func NewServerUpdateValidator

func NewServerUpdateValidator(serverService *services.ServerService) *ServerUpdateValidator

func (*ServerUpdateValidator) Validate

func (v *ServerUpdateValidator) Validate(form forms.UpdateServer, currentServer *models.Server) map[string]string

Jump to

Keyboard shortcuts

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