caser

package
v1.0.36 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CaseTypes = caseTypes{
	Err:        errorer.New("invalid CaseType"),
	Invalid:    CaseType("invalid"),
	Camel:      CaseType("camel"),
	Kebab:      CaseType("kebab"),
	KebabLower: CaseType("kebab-lower"),
	KebabUpper: CaseType("kebab-upper"),
	Pascal:     CaseType("pascal"),
	Phrase:     CaseType("phrase"),
	Snake:      CaseType("snake"),
	SnakeLower: CaseType("snake-lower"),
	SnakeUpper: CaseType("snake-upper"),
	Unknown:    CaseType("unknown"),
}

Functions

func CamelToKebab

func CamelToKebab[V ~string](v V) string

func CamelToKebabLower added in v1.0.28

func CamelToKebabLower[V ~string](v V) string

func CamelToKebabUpper

func CamelToKebabUpper[V ~string](v V) string

func CamelToPascal

func CamelToPascal[V ~string](v V) string

func CamelToPhrase

func CamelToPhrase[V ~string](v V) string

func CamelToSnake

func CamelToSnake[V ~string](v V) string

func CamelToSnakeLower added in v1.0.28

func CamelToSnakeLower[V ~string](v V) string

func CamelToSnakeUppser added in v1.0.28

func CamelToSnakeUppser[V ~string](v V) string

func Convert

func Convert[V ~string](v V, from, to CaseType) string

func ConvertAs added in v1.0.28

func ConvertAs[V ~string](v V, convert string) (string, error)

func Converter added in v1.0.28

func Converter[V ~string](convert string) (func(V) string, error)

func ConverterCombinations added in v1.0.29

func ConverterCombinations() []string

func KebabToCamel

func KebabToCamel[V ~string](v V) string

func KebabToPascal

func KebabToPascal[V ~string](v V) string

func KebabToPhrase

func KebabToPhrase[V ~string](v V) string

func KebabToSnake

func KebabToSnake[V ~string](v V) string

func KebabToSnakeLower added in v1.0.28

func KebabToSnakeLower[V ~string](v V) string

func KebabToSnakeUpper

func KebabToSnakeUpper[V ~string](v V) string

func MustConvertAs added in v1.0.28

func MustConvertAs[V ~string](v V, convert string) string

func MustConverter added in v1.0.28

func MustConverter[V ~string](v V, convert string) func(V) string

func PascalToCamel

func PascalToCamel[V ~string](v V) string

func PascalToKebab

func PascalToKebab[V ~string](v V) string

func PascalToKebabLower added in v1.0.28

func PascalToKebabLower[V ~string](v V) string

func PascalToKebabUpper

func PascalToKebabUpper[V ~string](v V) string

func PascalToPhrase

func PascalToPhrase[V ~string](v V) string

func PascalToSnake

func PascalToSnake[V ~string](v V) string

func PascalToSnakeLower added in v1.0.28

func PascalToSnakeLower[V ~string](v V) string

func PascalToSnakeUpper

func PascalToSnakeUpper[V ~string](v V) string

func PhraseToCamel

func PhraseToCamel[V ~string](v V) string

func PhraseToKebab

func PhraseToKebab[V ~string](v V) string

func PhraseToKebabLower added in v1.0.28

func PhraseToKebabLower[V ~string](v V) string

func PhraseToKebabUpper

func PhraseToKebabUpper[V ~string](v V) string

func PhraseToPascal

func PhraseToPascal[V ~string](v V) string

func PhraseToSnake

func PhraseToSnake[V ~string](v V) string

func PhraseToSnakeLower added in v1.0.28

func PhraseToSnakeLower[V ~string](v V) string

func PhraseToSnakeUpper

func PhraseToSnakeUpper[V ~string](v V) string

func SnakeToCamel

func SnakeToCamel[V ~string](v V) string

func SnakeToKebab

func SnakeToKebab[V ~string](v V) string

func SnakeToKebabLower added in v1.0.28

func SnakeToKebabLower[V ~string](v V) string

func SnakeToKebabUpper

func SnakeToKebabUpper[V ~string](v V) string

func SnakeToPascal

func SnakeToPascal[V ~string](v V) string

func SnakeToPhrase

func SnakeToPhrase[V ~string](v V) string

Types

type CaseType

type CaseType string

func (CaseType) MarshalJSON

func (t CaseType) MarshalJSON() ([]byte, error)

func (CaseType) MarshalXML added in v1.0.31

func (t CaseType) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (CaseType) MarshalYAML

func (t CaseType) MarshalYAML() (interface{}, error)

func (*CaseType) Scan

func (t *CaseType) Scan(value interface{}) error

func (CaseType) String

func (t CaseType) String() string

func (*CaseType) UnmarshalJSON

func (t *CaseType) UnmarshalJSON(data []byte) error

func (*CaseType) UnmarshalXML added in v1.0.31

func (t *CaseType) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

func (*CaseType) UnmarshalYAML

func (t *CaseType) UnmarshalYAML(unmarshal func(interface{}) error) error

func (CaseType) Value

func (t CaseType) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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