Documentation
¶
Index ¶
- Constants
- Variables
- type Key
- func (it *Key) AllRawItems() []string
- func (it *Key) AppendChain(items ...interface{}) *Key
- func (it *Key) AppendChainKeys(keys ...*Key) *Key
- func (it *Key) AppendChainStrings(items ...string) *Key
- func (it *Key) AsJsonContractsBinder() corejson.JsonContractsBinder
- func (it Key) AsJsonMarshaller() corejson.JsonMarshaller
- func (it Key) AsJsonParseSelfInjector() corejson.JsonParseSelfInjector
- func (it *Key) AsJsoner() corejson.Jsoner
- func (it *Key) ClonePtr(newAppendingChains ...interface{}) *Key
- func (it *Key) Compile(items ...interface{}) string
- func (it *Key) CompileKeys(keys ...*Key) string
- func (it *Key) CompileReplaceCurlyKeyMap(mapToReplace map[string]string) string
- func (it *Key) CompileReplaceCurlyKeyMapUsingItems(mapToReplace map[string]string, additionalItems ...interface{}) string
- func (it *Key) CompileReplaceMapUsingItemsOption(isConvKeysToCurlyBraceKeys bool, mapToReplace map[string]string, ...) string
- func (it *Key) CompileStrings(items ...string) string
- func (it *Key) CompiledChain() string
- func (it *Key) ConcatNewUsingKeys(keys ...*Key) *Key
- func (it *Key) Finalized(items ...interface{}) *Key
- func (it *Key) HasInChains(chainItem string) bool
- func (it *Key) IntRange(startIncluding, endIncluding int) []string
- func (it *Key) IntRangeEnding(endIncluding int) []string
- func (it *Key) IsComplete() bool
- func (it *Key) IsEmpty() bool
- func (it *Key) JoinUsingJoiner(joiner string, items ...interface{}) string
- func (it *Key) JoinUsingOption(tempOption *Option, items ...interface{}) string
- func (it Key) Json() corejson.Result
- func (it *Key) JsonModel() keyModel
- func (it *Key) JsonModelAny() interface{}
- func (it *Key) JsonParseSelfInject(jsonResult *corejson.Result) error
- func (it Key) JsonPtr() *corejson.Result
- func (it Key) JsonString() string
- func (it *Key) KeyChains() []string
- func (it *Key) KeyCompiled() string
- func (it *Key) Length() int
- func (it *Key) MainName() string
- func (it *Key) MarshalJSON() ([]byte, error)
- func (it *Key) Name() string
- func (it *Key) ParseInjectUsingJson(jsonResult *corejson.Result) (*Key, error)
- func (it *Key) ParseInjectUsingJsonMust(jsonResult *corejson.Result) *Key
- func (it Key) Serialize() ([]byte, error)
- func (it *Key) String() string
- func (it *Key) TemplateReplacer() templateReplacer
- func (it *Key) UnmarshalJSON(data []byte) error
- type KeyLegendCompileRequest
- type KeyWithLegend
- func (it *KeyWithLegend) Clone() *KeyWithLegend
- func (it *KeyWithLegend) CloneUsing(groupName string) *KeyWithLegend
- func (it *KeyWithLegend) Compile(itemId string) string
- func (it *KeyWithLegend) CompileUsingRequest(request KeyLegendCompileRequest) string
- func (it *KeyWithLegend) FinalStrings(request KeyLegendCompileRequest) []string
- func (it *KeyWithLegend) Group(group interface{}) string
- func (it *KeyWithLegend) GroupByte(group byte) string
- func (it *KeyWithLegend) GroupIntRange(startId, endId int) []string
- func (it *KeyWithLegend) GroupItem(group, item interface{}) string
- func (it *KeyWithLegend) GroupItemIntRange(group string, startId, endId int) []string
- func (it *KeyWithLegend) GroupItemString(group, item string) string
- func (it *KeyWithLegend) GroupName() string
- func (it *KeyWithLegend) GroupStateItemString(group, stateName, item string) string
- func (it *KeyWithLegend) GroupStateUserItem(group, state, user, item interface{}) string
- func (it *KeyWithLegend) GroupStateUserItemString(group, state, user, item string) string
- func (it *KeyWithLegend) GroupString(group string) string
- func (it *KeyWithLegend) GroupUInt(group uint) string
- func (it *KeyWithLegend) GroupUIntRange(startId, endId uint) []string
- func (it *KeyWithLegend) GroupUser(group, user interface{}) string
- func (it *KeyWithLegend) GroupUserByte(group, user byte) string
- func (it *KeyWithLegend) GroupUserItem(group, user, item interface{}) string
- func (it *KeyWithLegend) GroupUserItemInt(group, user, item int) string
- func (it *KeyWithLegend) GroupUserItemString(group, user, item string) string
- func (it *KeyWithLegend) GroupUserItemUint(group, user, item uint) string
- func (it *KeyWithLegend) GroupUserString(group, user string) string
- func (it *KeyWithLegend) IsIgnoreLegendAttachments() bool
- func (it *KeyWithLegend) Item(item interface{}) string
- func (it *KeyWithLegend) ItemEnumByte(item enuminf.ByteEnumNamer) string
- func (it *KeyWithLegend) ItemInt(itemId int) string
- func (it *KeyWithLegend) ItemIntRange(startId, endId int) []string
- func (it *KeyWithLegend) ItemString(item string) string
- func (it *KeyWithLegend) ItemUInt(itemId uint) string
- func (it *KeyWithLegend) ItemUIntRange(startId, endId uint) []string
- func (it *KeyWithLegend) ItemWithoutUser(item interface{}) string
- func (it *KeyWithLegend) ItemWithoutUserGroup(item interface{}) string
- func (it *KeyWithLegend) ItemWithoutUserStateGroup(item interface{}) string
- func (it *KeyWithLegend) OutputItemsArray(request KeyLegendCompileRequest) []string
- func (it *KeyWithLegend) OutputWithoutLegend(request KeyLegendCompileRequest) []string
- func (it *KeyWithLegend) PackageName() string
- func (it *KeyWithLegend) RootName() string
- func (it *KeyWithLegend) StateItem(stateName, item interface{}) string
- func (it *KeyWithLegend) StateItemString(stateName, item string) string
- func (it *KeyWithLegend) StateUser(state, user interface{}) string
- func (it *KeyWithLegend) StateUserItem(state, user, item interface{}) string
- func (it *KeyWithLegend) UpToState(user string) string
- func (it *KeyWithLegend) UserStringWithoutState(user string) string
- type LegendName
- type Option
- type Range
- type TempReplace
Constants ¶
const ( DefaultJoiner = constants.Hyphen DefaultCap = constants.Capacity16 LegendChainSample = "{root}-{package}-{group}-{state}-{user}-{item}" // item refers to the final element like id or file name )
Variables ¶
var ( PipeJoinerOption = &Option{ Joiner: DefaultJoiner, IsSkipEmptyEntry: true, IsUseBrackets: true, StartBracket: constants.Pipe, EndBracket: constants.Pipe, } PipeCurlyJoinerOption = &Option{ Joiner: DefaultJoiner, IsSkipEmptyEntry: true, IsUseBrackets: true, StartBracket: constants.Pipe + constants.CurlyStart, EndBracket: constants.CurlyEnd + constants.Pipe, } PipeSquareJoinerOption = &Option{ Joiner: DefaultJoiner, IsSkipEmptyEntry: true, IsUseBrackets: true, StartBracket: constants.Pipe + constants.SquareStart, EndBracket: constants.SquareEnd + constants.Pipe, } CurlyBracePathJoinerOption = &Option{ Joiner: constants.PathSeparator, IsSkipEmptyEntry: true, IsUseBrackets: true, StartBracket: constants.CurlyStart, EndBracket: constants.CurlyEnd, } CurlyBraceJoinerOption = &Option{ Joiner: DefaultJoiner, IsSkipEmptyEntry: true, IsUseBrackets: true, StartBracket: constants.CurlyStart, EndBracket: constants.CurlyEnd, } BracketJoinerOption = &Option{ Joiner: DefaultJoiner, IsSkipEmptyEntry: true, IsUseBrackets: true, StartBracket: constants.SquareStart, EndBracket: constants.SquareEnd, } ParenthesisJoinerOption = &Option{ Joiner: DefaultJoiner, IsSkipEmptyEntry: true, IsUseBrackets: true, StartBracket: constants.ParenthesisStart, EndBracket: constants.ParenthesisEnd, } JoinerOption = &Option{ Joiner: constants.Hyphen, IsSkipEmptyEntry: true, IsUseBrackets: false, StartBracket: constants.EmptyString, EndBracket: constants.EmptyString, } FullLegends = LegendName{ Root: "root", Package: "package", Group: "group", User: "user", Item: "item", } FullCategoryLegends = LegendName{ Root: "root", Package: "package", Group: "category", User: "user", Item: "item", } FullEventLegends = LegendName{ Root: "root", Package: "package", Group: "event", User: "user", Item: "item", } ShortLegends = LegendName{ Root: "r", Package: "p", Group: "g", User: "u", Item: "i", } ShortEventLegends = LegendName{ Root: "r", Group: "e", Package: "p", Item: "i", } NewKey = &newKeyCreator{} NewKeyWithLegend = &newKeyWithLegendCreator{} FixedLegend = fixedLegend{} )
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
func (*Key) AppendChain ¶
func (*Key) AppendChainKeys ¶
func (*Key) AppendChainStrings ¶
func (*Key) AsJsonContractsBinder ¶ added in v1.1.6
func (it *Key) AsJsonContractsBinder() corejson.JsonContractsBinder
func (Key) AsJsonMarshaller ¶ added in v1.1.6
func (it Key) AsJsonMarshaller() corejson.JsonMarshaller
func (Key) AsJsonParseSelfInjector ¶ added in v1.1.6
func (it Key) AsJsonParseSelfInjector() corejson.JsonParseSelfInjector
func (*Key) CompileKeys ¶
func (*Key) CompileReplaceCurlyKeyMap ¶ added in v1.1.5
CompileReplaceCurlyKeyMap
Keys will be converted to {Key} then replaced
func (*Key) CompileReplaceCurlyKeyMapUsingItems ¶ added in v1.1.5
func (it *Key) CompileReplaceCurlyKeyMapUsingItems( mapToReplace map[string]string, additionalItems ...interface{}, ) string
CompileReplaceCurlyKeyMapUsingItems
Keys will be converted to {Key} then replaced
func (*Key) CompileReplaceMapUsingItemsOption ¶ added in v1.1.5
func (*Key) CompileStrings ¶
func (*Key) CompiledChain ¶
func (*Key) ConcatNewUsingKeys ¶
func (*Key) HasInChains ¶
func (*Key) IntRangeEnding ¶ added in v1.0.8
func (*Key) IsComplete ¶
func (*Key) JoinUsingJoiner ¶
func (*Key) JoinUsingOption ¶
func (*Key) JsonModelAny ¶ added in v1.1.6
func (it *Key) JsonModelAny() interface{}
func (*Key) JsonParseSelfInject ¶ added in v1.1.6
func (Key) JsonString ¶ added in v1.1.6
func (*Key) KeyCompiled ¶
func (*Key) MarshalJSON ¶ added in v1.1.6
func (*Key) ParseInjectUsingJson ¶ added in v1.1.6
ParseInjectUsingJson It will not update the self but creates a new one.
func (*Key) ParseInjectUsingJsonMust ¶ added in v1.1.6
ParseInjectUsingJsonMust Panic if error
func (*Key) TemplateReplacer ¶ added in v1.1.6
func (it *Key) TemplateReplacer() templateReplacer
func (*Key) UnmarshalJSON ¶ added in v1.1.6
type KeyLegendCompileRequest ¶
type KeyLegendCompileRequest struct { StateName, UserId, GroupId, ItemId string }
func (KeyLegendCompileRequest) NewKeyLegend ¶
func (it KeyLegendCompileRequest) NewKeyLegend( option *Option, legendName LegendName, isAttachLegend bool, rootName, packageName, stateName string, ) *KeyWithLegend
func (KeyLegendCompileRequest) NewKeyLegendDefaults ¶
func (it KeyLegendCompileRequest) NewKeyLegendDefaults( rootName, packageName, stateName string, ) *KeyWithLegend
type KeyWithLegend ¶
type KeyWithLegend struct { LegendName LegendName // contains filtered or unexported fields }
KeyWithLegend
Chain Sequence
(Root-Package-Group-State-User-item) aka. LegendChainSample fixed chain (Root-Package) and variable chain (Group-State-User-item) Chain example LegendChainSample Depending on Options - IsIgnoreLegendAttachments() calls or invokes -> OutputWithoutLegend() - or else - calls compiles using legends Chain may look like (Fixed chain "{root}-{package}"): - root-package-group-state-user-item (LegendChainSample) - Fixed chain "{root}-{package}" -- rest will depend on value given on parameter. - Given request to item will only print - "{root}-{package}-{item}" - Given request to state, item will only print - "{root}-{package}-{state}-{item}" - Given request to group will only print - "{root}-{package}-{group}"
Ordering :
- Root
- Package
- Group
- State
- User
- ItemWithoutUser
Example:
- On any value empty in request will be ignored if Option.IsSkipEmptyEntry
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) Clone ¶
func (it *KeyWithLegend) Clone() *KeyWithLegend
func (*KeyWithLegend) CloneUsing ¶
func (it *KeyWithLegend) CloneUsing(groupName string) *KeyWithLegend
func (*KeyWithLegend) Compile ¶
func (it *KeyWithLegend) Compile( itemId string, ) string
func (*KeyWithLegend) CompileUsingRequest ¶
func (it *KeyWithLegend) CompileUsingRequest( request KeyLegendCompileRequest, ) string
CompileUsingRequest
Compiles using FinalStrings
func (*KeyWithLegend) FinalStrings ¶
func (it *KeyWithLegend) FinalStrings( request KeyLegendCompileRequest, ) []string
FinalStrings
Returns compiled array from conditions using OutputItemsArray
Conditions:
- When request given
func (*KeyWithLegend) Group ¶
func (it *KeyWithLegend) Group(group interface{}) string
Group
Returns up to state. Chain sample KeyWithLegend, LegendChainSample State will be used from creation.
Example:
- "{root}-{package}-{group}-{state}"
Missing:
- "{user}-{item}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) GroupByte ¶
func (it *KeyWithLegend) GroupByte(group byte) string
func (*KeyWithLegend) GroupIntRange ¶
func (it *KeyWithLegend) GroupIntRange(startId, endId int) []string
func (*KeyWithLegend) GroupItem ¶
func (it *KeyWithLegend) GroupItem(group, item interface{}) string
func (*KeyWithLegend) GroupItemIntRange ¶
func (it *KeyWithLegend) GroupItemIntRange(group string, startId, endId int) []string
GroupItemIntRange
Returns up to item without user. Chain sample KeyWithLegend, LegendChainSample State, Group, State will be used from creation.
Example:
- "{root}-{package}-{state}-{group}-{item}"
Missing:
- "{user}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) GroupItemString ¶
func (it *KeyWithLegend) GroupItemString(group, item string) string
GroupItemString
Returns up to item without user. Chain sample KeyWithLegend, LegendChainSample State, Group, State will be used from creation.
Example:
- "{root}-{package}-{state}-{group}-{item}"
Missing:
- "{user}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) GroupName ¶
func (it *KeyWithLegend) GroupName() string
func (*KeyWithLegend) GroupStateItemString ¶ added in v0.9.8
func (it *KeyWithLegend) GroupStateItemString(group, stateName, item string) string
func (*KeyWithLegend) GroupStateUserItem ¶ added in v0.9.8
func (it *KeyWithLegend) GroupStateUserItem(group, state, user, item interface{}) string
func (*KeyWithLegend) GroupStateUserItemString ¶ added in v0.9.8
func (it *KeyWithLegend) GroupStateUserItemString( group, state, user, item string, ) string
func (*KeyWithLegend) GroupString ¶
func (it *KeyWithLegend) GroupString(group string) string
GroupString
Returns up to state. Chain sample KeyWithLegend, LegendChainSample State will be used from creation.
Example:
- "{root}-{package}-{group}-{state}"
Missing:
- "{user}-{item}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) GroupUInt ¶
func (it *KeyWithLegend) GroupUInt(group uint) string
func (*KeyWithLegend) GroupUIntRange ¶
func (it *KeyWithLegend) GroupUIntRange(startId, endId uint) []string
func (*KeyWithLegend) GroupUser ¶
func (it *KeyWithLegend) GroupUser(group, user interface{}) string
func (*KeyWithLegend) GroupUserByte ¶
func (it *KeyWithLegend) GroupUserByte(group, user byte) string
func (*KeyWithLegend) GroupUserItem ¶
func (it *KeyWithLegend) GroupUserItem(group, user, item interface{}) string
GroupUserItem
Returns up to item. Chain sample KeyWithLegend, LegendChainSample State will be used from creation.
Example:
- "{root}-{package}-{group}-{state}-{user}-{item}"
Missing:
- Nothing
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) GroupUserItemInt ¶
func (it *KeyWithLegend) GroupUserItemInt(group, user, item int) string
func (*KeyWithLegend) GroupUserItemString ¶
func (it *KeyWithLegend) GroupUserItemString(group, user, item string) string
func (*KeyWithLegend) GroupUserItemUint ¶
func (it *KeyWithLegend) GroupUserItemUint(group, user, item uint) string
func (*KeyWithLegend) GroupUserString ¶
func (it *KeyWithLegend) GroupUserString(group, user string) string
func (*KeyWithLegend) IsIgnoreLegendAttachments ¶
func (it *KeyWithLegend) IsIgnoreLegendAttachments() bool
func (*KeyWithLegend) Item ¶
func (it *KeyWithLegend) Item(item interface{}) string
Item
Returns up to item without user. Chain sample KeyWithLegend, LegendChainSample State, Group, State will be used from creation.
Example:
- "{root}-{package}-{state}-{group}-{item}"
Missing:
- "{user}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) ItemEnumByte ¶
func (it *KeyWithLegend) ItemEnumByte(item enuminf.ByteEnumNamer) string
ItemEnumByte
Returns up to item without user. Chain sample KeyWithLegend, LegendChainSample Group, State will be used from creation.
Example:
- "{root}-{package}-{state}-{group}-{item}"
Missing:
- "{user}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) ItemInt ¶
func (it *KeyWithLegend) ItemInt(itemId int) string
ItemInt
Returns up to item without user. Chain sample KeyWithLegend, LegendChainSample State, Group, State will be used from creation.
Example:
- "{root}-{package}-{state}-{group}-{item}"
Missing:
- "{user}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) ItemIntRange ¶
func (it *KeyWithLegend) ItemIntRange(startId, endId int) []string
func (*KeyWithLegend) ItemString ¶
func (it *KeyWithLegend) ItemString(item string) string
ItemString
Returns up to item without user, group, state. Chain sample KeyWithLegend, LegendChainSample State, Group, State will be used from creation.
Example:
- "{root}-{package}-{state}-{group}-{item}"
Missing:
- "{user}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) ItemUInt ¶
func (it *KeyWithLegend) ItemUInt(itemId uint) string
ItemUInt
Returns up to item without user. Chain sample KeyWithLegend, LegendChainSample State, Group, State will be used from creation.
Example:
- "{root}-{package}-{state}-{group}-{item}"
Missing:
- "{user}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) ItemUIntRange ¶
func (it *KeyWithLegend) ItemUIntRange(startId, endId uint) []string
func (*KeyWithLegend) ItemWithoutUser ¶ added in v1.3.12
func (it *KeyWithLegend) ItemWithoutUser(item interface{}) string
ItemWithoutUser
Returns up to item without user. Chain sample KeyWithLegend, LegendChainSample State, Group will be used from creation.
Example:
- "{root}-{package}-{state}-{group}-{item}"
Missing:
- "{user}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) ItemWithoutUserGroup ¶ added in v1.3.12
func (it *KeyWithLegend) ItemWithoutUserGroup(item interface{}) string
ItemWithoutUserGroup
Returns up to item without user, group. Chain sample KeyWithLegend, LegendChainSample State will be used from creation.
Example:
- "{root}-{package}-{state}-{item}"
Missing:
- "{group}-{user}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) ItemWithoutUserStateGroup ¶ added in v1.3.12
func (it *KeyWithLegend) ItemWithoutUserStateGroup(item interface{}) string
ItemWithoutUserStateGroup
Returns up to item without user, group, state. Chain sample KeyWithLegend, LegendChainSample Nothing will be used from creation.
Example:
- "{root}-{package}-{item}"
Missing:
- "{group}-{state}-{user}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) OutputItemsArray ¶
func (it *KeyWithLegend) OutputItemsArray(request KeyLegendCompileRequest) []string
OutputItemsArray
Chain example LegendChainSample Depending on Options - IsIgnoreLegendAttachments() calls or invokes -> OutputWithoutLegend() - or else - calls compiles using legends Chain may look like: - root-package-group-state-user-item (LegendChainSample)
Ordering :
- Root
- Package
- Group
- State
- User
- ItemWithoutUser
Example:
- On any value empty in request will be ignored if Option.IsSkipEmptyEntry
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) OutputWithoutLegend ¶
func (it *KeyWithLegend) OutputWithoutLegend(request KeyLegendCompileRequest) []string
func (*KeyWithLegend) PackageName ¶
func (it *KeyWithLegend) PackageName() string
func (*KeyWithLegend) RootName ¶
func (it *KeyWithLegend) RootName() string
func (*KeyWithLegend) StateItem ¶ added in v0.9.8
func (it *KeyWithLegend) StateItem(stateName, item interface{}) string
func (*KeyWithLegend) StateItemString ¶ added in v0.9.8
func (it *KeyWithLegend) StateItemString(stateName, item string) string
func (*KeyWithLegend) StateUser ¶ added in v0.9.8
func (it *KeyWithLegend) StateUser(state, user interface{}) string
StateUser
Returns up to user. Chain sample KeyWithLegend, LegendChainSample Group will be used from creation.
Example:
- "{root}-{package}-{group}-{state}-{user}"
Missing:
- "{item}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) StateUserItem ¶ added in v0.9.8
func (it *KeyWithLegend) StateUserItem(state, user, item interface{}) string
StateUserItem
Returns up to item. Chain sample KeyWithLegend, LegendChainSample Group will be used from creation.
Example:
- "{root}-{package}-{group}-{state}-{user}-{item}"
Missing:
- Nothing
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) UpToState ¶ added in v1.3.12
func (it *KeyWithLegend) UpToState(user string) string
UpToState
Returns up to state. Chain sample KeyWithLegend, LegendChainSample State, Group will be used from creation.
Example:
- "{root}-{package}-{group}-{state}"
Missing:
- "{user}-{item}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
func (*KeyWithLegend) UserStringWithoutState ¶ added in v1.3.12
func (it *KeyWithLegend) UserStringWithoutState(user string) string
UserStringWithoutState
Returns up to user without state. Chain sample KeyWithLegend, LegendChainSample Group will be used from creation.
Example:
- "{root}-{package}-{group}--{user}"
Missing:
- "{state}-{item}"
Conditions apply:
- if Option.IsSkipEmptyEntry then empty input wil be ignored.
type LegendName ¶
type LegendName struct {
Root, Group, Package,
State, User, Item string
}
type Option ¶
type Option struct { Joiner string IsSkipEmptyEntry, IsUseBrackets bool StartBracket, EndBracket string }
func (*Option) IsAddEntryRegardlessOfEmptiness ¶
Source Files
¶
- Key.go
- KeyLegendCompileRequest.go
- KeyWithLegend.go
- LegendName.go
- Option.go
- Range.go
- TempReplace.go
- appendAnyItemsWithBaseStrings.go
- appendStringsWithBaseAnyItems.go
- consts.go
- curlyWrap.go
- curlyWrapIf.go
- fixedLegend.go
- keyModel.go
- newKeyCreator.go
- newKeyWithLegendCreator.go
- templateReplacer.go
- vars.go