Documentation ¶
Index ¶
- Constants
- func ReplaceDelimiter(str, delimeter string) string
- func StringsToSet(slice []string) map[string]bool
- func TabExecutor(w io.Writer, tmpl *template.Template, data interface{}) error
- func ToDashCase(str string) string
- func ToDotCase(str string) string
- func ToScreamingCase(str string) string
- func UniqueStrings(slice []string) []string
- type FlattenMap
- func (m *FlattenMap) ChildrenByPrefix(prefix string) (keys []string)
- func (m *FlattenMap) Keys() []string
- func (m *FlattenMap) Set(originalKey, value string)
- func (m *FlattenMap) UnusedKeys(escapedKeys []string) (keys []string)
- func (m *FlattenMap) Value(key string) (value string, ok bool)
- func (m *FlattenMap) Values() []string
Constants ¶
const ( // CharDot represents character ".". CharDot = "." // CharDash represents character "-". CharDash = "-" // CharUnderscore represents character "_". CharUnderscore = "_" )
Variables ¶
This section is empty.
Functions ¶
func ReplaceDelimiter ¶
ReplaceDelimiter changes delimiter of string to new and also connect camel case with it.
func StringsToSet ¶
StringsToSet turns slice into set
func TabExecutor ¶
TabExecutor executes template with tab writter.
func ToDashCase ¶
ToDashCase transform str into dash case (e.g. log-level).
func ToScreamingCase ¶
ToScreamingCase transform str into screaming case (e.g. log.level to LOG_LEVEL).
func UniqueStrings ¶
UniqueStrings returns unique slice.
Types ¶
type FlattenMap ¶
type FlattenMap struct {
// contains filtered or unexported fields
}
FlattenMap implements node.FlattenMap with key's usage record
func (*FlattenMap) ChildrenByPrefix ¶
func (m *FlattenMap) ChildrenByPrefix(prefix string) (keys []string)
ChildrenByPrefix implements node.FlattenMap
func (*FlattenMap) Keys ¶
func (m *FlattenMap) Keys() []string
Keys returns keys in order by when they were set
func (*FlattenMap) Set ¶
func (m *FlattenMap) Set(originalKey, value string)
Set format key to dot-case and set key to value, which also clear key's usage
func (*FlattenMap) UnusedKeys ¶
func (m *FlattenMap) UnusedKeys(escapedKeys []string) (keys []string)
UnusedKeys returns unused keys after they were set
func (*FlattenMap) Value ¶
func (m *FlattenMap) Value(key string) (value string, ok bool)
Value implements node.FlattenMap with recording key's usage
func (*FlattenMap) Values ¶
func (m *FlattenMap) Values() []string
Values returns values in order by when they were set