Help us shape the future of Go! Take the 2026 Go Developer Survey

caser

package
v1.45.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MPL-2.0 Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caser added in v0.11.0

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

func New added in v0.11.0

func New(opts ...Option) *Caser

New creates a new instance of caser

func (*Caser) ToCamel added in v0.11.0

func (c *Caser) ToCamel(s string) string

ToCamel returns a string converted from snake case to camel case

func (*Caser) ToPascal added in v0.11.0

func (c *Caser) ToPascal(s string) string

ToPascal returns a string converted from snake case to pascal case

func (*Caser) ToSnake added in v0.11.0

func (c *Caser) ToSnake(s string) string

ToSnake converts a given string to snake case

func (*Caser) ToTitle added in v1.43.0

func (c *Caser) ToTitle(s string) string

ToTitle returns a string converted from snake case to title case. Title case is similar to camel case, but spaces are used in between words.

type Option added in v0.11.0

type Option func(*Caser)

func WithCustomExceptions added in v0.11.0

func WithCustomExceptions(fields map[string]string) Option

WithCustomExceptions allows to specify custom exceptions for caser. The parameter is a map of snake:camel values like map[string]string{"oauth":"OAuth"}

func WithCustomInitialisms added in v0.11.0

func WithCustomInitialisms(fields map[string]bool) Option

WithCustomInitialisms allows specifying custom initialisms for caser.

Jump to

Keyboard shortcuts

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