go_names

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Title = cases.Title(language.English).String
)

Functions

func Escape

func Escape(n string) string

func GoLexName

func GoLexName(n string) []string

func GoMergeNames

func GoMergeNames(n1, n2 string) string

func GoName

func GoName(n string) string

func GoNameNoReserved

func GoNameNoReserved(n string) string

func GoSnakeCase

func GoSnakeCase(n string) string

func LexName

func LexName(n string) []string

func Unescape

func Unescape(n string) string

Types

type Config

type Config struct {
	Rename     map[string][]string            `yaml:"rename"`
	Rotate     map[string]string              `yaml:"rotate"`
	Abbr       map[string]string              `yaml:"abbr"`
	Split      map[string][]string            `yaml:"split"`
	LookBehind map[string]map[string][]string `yaml:"lookBehind"`
	Trim       struct {
		Words     []string            `yaml:"word"`
		Word      map[string]struct{} `yaml:"-"`
		PrefixAll []string            `yaml:"prefixAll"`
		Prefixes  []string            `yaml:"prefix"`
		Prefix    map[string]struct{} `yaml:"-"`
		Suffix    []string            `yaml:"suffix"`
	}
}

func LoadConfig

func LoadConfig() *Config

type Lexer

type Lexer struct {
	*Config
}

type Namer

type Namer struct {
	*Config
}

func (*Namer) GoName

func (nr *Namer) GoName(n string) []string

func (*Namer) GoNameNoReserved

func (nr *Namer) GoNameNoReserved(n string) []string

func (*Namer) MergeNames

func (nr *Namer) MergeNames(n1, n2 string) string

Jump to

Keyboard shortcuts

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