name

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Name

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

func New

func New(s string) Name

func (Name) AllUpperKebab

func (n Name) AllUpperKebab() string

func (Name) AllUpperSnake

func (n Name) AllUpperSnake() string

func (Name) Append

func (n Name) Append(s string) Name

func (Name) Equal

func (n Name) Equal(other Name) bool

func (Name) FirstUpperKebab

func (n Name) FirstUpperKebab() string

func (Name) FirstUpperSnake

func (n Name) FirstUpperSnake() string

func (Name) Get

func (n Name) Get(i int) Name

func (Name) Join

func (n Name) Join(sep, prefix, suffix string) string

func (Name) Len

func (n Name) Len() int

func (Name) LowerCamel

func (n Name) LowerCamel() string

func (Name) LowerKebab

func (n Name) LowerKebab() string

func (Name) LowerSnake

func (n Name) LowerSnake() string

func (Name) Map

func (n Name) Map(f func(w string) string) Name

func (Name) Prepend

func (n Name) Prepend(s string) Name

func (Name) RemoveIf

func (n Name) RemoveIf(f func(w string) bool) Name

func (Name) Slice

func (n Name) Slice(begin, end int) Name

func (Name) String

func (n Name) String() string

func (Name) UpperCamel

func (n Name) UpperCamel() string

type Registry

type Registry interface {
	Safe(name string) string
}

Registry provides safe names which are not included in the reserved keywords.

func NewRegistry

func NewRegistry(reserved []string, modify func(name string, times int) string) Registry

NewRegistry creates a new name registry. The parameter reserved is a list of reserved keywords. The parameter modify is a function to modify the name when the name is already used, which takes the specified name and the number of the modifications and returns the modified name.

Jump to

Keyboard shortcuts

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