caser

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: MPL-2.0 Imports: 4 Imported by: 3 modules, 7 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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