validate

package
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package validate implements validation functions, mainly for strings used in Faws.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCommitTagTooBig            = fmt.Errorf("faws/validate: commit tag is too long")
	ErrCommitTagInvalidCharacters = fmt.Errorf("faws/validate: commit contains illegal characters")
	ErrCommitTagCannotBeEmpty     = fmt.Errorf("faws/validate: commit tag cannot be empty")
)
View Source
var (
	ErrDescriptionTooLong           = fmt.Errorf("faws/validate: description is too long")
	ErrDescriptionInvalidCharacters = fmt.Errorf("faws/validate: description contains invalid characters")
)
View Source
var (
	ErrFileNameTooLong           = fmt.Errorf("faws/validate: filename is too long")
	ErrFileNameEmpty             = fmt.Errorf("faws/validate: filename is empty")
	ErrFileNameSpecialCharacters = fmt.Errorf("faws/validate: filename contains special characters")
	ErrFileNamePathSpecifiers    = fmt.Errorf("faws/validate: filename cannot be current or parent directory specifier")
	ErrFilePathEmpty             = fmt.Errorf("faws/validate: filepath is empty")
)
View Source
var (
	ErrNametagTooLong                    = fmt.Errorf("faws/validate: nametag is too long")
	ErrNametagContainsTrailingWhitespace = fmt.Errorf("faws/validate: nametag contains trailing whitespace")
	ErrNametagInvalidCharacters          = fmt.Errorf("faws/validate: nametag contains invalid characters")
)
View Source
var (
	ErrEmailTooLong = fmt.Errorf("faws/validate: email is too long")
)

Functions

func CommitTag

func CommitTag(tag string) (err error)

CommitTag returns an error if tag is invalid

If the tag is empty, err = ErrCommitTagCannotBeEmpty If the tag is too long, err = ErrCommitTagTooBig If the tag contains illegal characters, err = ErrCommitTagInvalidCharacters

func Description

func Description(description string) (err error)

Description returns an error if description is invalid

If description is too long, err = ErrDescriptionTooLong If description contains illegal characters, err = ErrDescriptionInvalidCharacters

func Email

func Email(n string) (err error)

Email returns an error if email is invalid

func FileName

func FileName(filename string) (err error)

FileName returns an error if the filename is not valid

func FilePath

func FilePath(filepath string) (err error)

FilePath returns an error if the filepath is not valid

func Hex

func Hex(ref string) bool

Hex returns false if ref is not hexadecimal

func Nametag

func Nametag(n string) (err error)

Nametag returns an error if the nametag is invalid

Types

This section is empty.

Jump to

Keyboard shortcuts

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