caser

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MPL-2.0 Imports: 4 Imported by: 2

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

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 camel:snake 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