namemapper

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2021 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UNKNOWN     NameStyle = -1
	NATIVE                = 0 // native
	UPPER                 = 1 // uppercase
	LOWER                 = 2 // lowercase
	UPPER_CAMEL           = 3 // upper camel
	LOWER_CAMEL           = 4 // lower camel
	UNDER_SCORE           = 5 // under score
	TITLE                 = 6 // upper first charactor
)

Variables

This section is empty.

Functions

func Convert

func Convert(s string, style NameStyle) string

func Lower

func Lower(s string) string

func LowerCamel

func LowerCamel(s string) string

func Native

func Native(s string) string

func Title

func Title(s string) string

func UnderScore

func UnderScore(s string) string

func Upper

func Upper(s string) string

func UpperCamel

func UpperCamel(s string) string

Types

type Mapper

type Mapper func(string) string

type NameStyle

type NameStyle int

func GetStyleByName

func GetStyleByName(stylename string) NameStyle

func Style

func Style(s string) NameStyle

Style detects name style return NATIVE if style is unknown return UNDER_SCORE if s contain _ return LOWER_CAMEL if first charactor is lowercase return UPPER_CAMEL // retst charactor is uppercase otherwise return NATIVE

Jump to

Keyboard shortcuts

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