keymk

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultJoiner = constants.Hyphen
	DefaultCap    = constants.Capacity16
)

Variables

View Source
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,
	}

	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{}
)

Functions

This section is empty.

Types

type Key

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

func (*Key) AllRawItems

func (it *Key) AllRawItems() []string

AllRawItems

Returns main + whole chain (raw elements)

func (*Key) AppendChain

func (it *Key) AppendChain(items ...interface{}) *Key

func (*Key) AppendChainKeys

func (it *Key) AppendChainKeys(
	keys ...*Key,
) *Key

func (*Key) AppendChainStrings

func (it *Key) AppendChainStrings(
	items ...string,
) *Key

func (*Key) ClonePtr

func (it *Key) ClonePtr(
	newAppendingChains ...interface{},
) *Key

func (*Key) Compile

func (it *Key) Compile(
	items ...interface{},
) string

func (*Key) CompileKeys

func (it *Key) CompileKeys(
	keys ...*Key,
) string

func (*Key) CompileStrings

func (it *Key) CompileStrings(
	items ...string,
) string

func (*Key) CompiledChain

func (it *Key) CompiledChain() string

func (*Key) ConcatNewUsingKeys

func (it *Key) ConcatNewUsingKeys(
	keys ...*Key,
) *Key

func (*Key) Finalized

func (it *Key) Finalized(
	items ...interface{},
) *Key

func (*Key) HasInChains

func (it *Key) HasInChains(
	chainItem string,
) bool

func (*Key) IntRange added in v1.0.8

func (it *Key) IntRange(
	startIncluding, endIncluding int,
) []string

func (*Key) IntRangeEnding added in v1.0.8

func (it *Key) IntRangeEnding(
	endIncluding int,
) []string

func (*Key) IsComplete

func (it *Key) IsComplete() bool

func (*Key) IsEmpty

func (it *Key) IsEmpty() bool

func (*Key) JoinUsingJoiner

func (it *Key) JoinUsingJoiner(
	joiner string,
	items ...interface{},
) string

func (*Key) JoinUsingOption

func (it *Key) JoinUsingOption(
	tempOption *Option,
	items ...interface{},
) string

func (*Key) KeyChains

func (it *Key) KeyChains() []string

func (*Key) KeyCompiled

func (it *Key) KeyCompiled() string

func (*Key) Length

func (it *Key) Length() int

func (*Key) MainName

func (it *Key) MainName() string

func (*Key) Name

func (it *Key) Name() string

func (*Key) String

func (it *Key) String() string

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)

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

func (*KeyWithLegend) FinalStrings

func (it *KeyWithLegend) FinalStrings(
	request KeyLegendCompileRequest,
) []string

FinalStrings

Returns compiled array from conditions using OutputItemsArray

func (*KeyWithLegend) Group

func (it *KeyWithLegend) Group(group interface{}) string

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

func (*KeyWithLegend) GroupItemString

func (it *KeyWithLegend) GroupItemString(group, item string) string

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

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

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

It will include the existing group. chain (root-pkg-group-item)

func (*KeyWithLegend) ItemEnumByte

func (it *KeyWithLegend) ItemEnumByte(item coreinterface.ByteEnumNamer) string

func (*KeyWithLegend) ItemInt

func (it *KeyWithLegend) ItemInt(itemId int) string

func (*KeyWithLegend) ItemIntRange

func (it *KeyWithLegend) ItemIntRange(startId, endId int) []string

func (*KeyWithLegend) ItemString

func (it *KeyWithLegend) ItemString(item string) string

func (*KeyWithLegend) ItemUInt

func (it *KeyWithLegend) ItemUInt(itemId uint) string

func (*KeyWithLegend) ItemUIntRange

func (it *KeyWithLegend) ItemUIntRange(startId, endId uint) []string

func (*KeyWithLegend) ItemWithoutGroup

func (it *KeyWithLegend) ItemWithoutGroup(item interface{}) string

ItemWithoutGroup

Doesn't include existing group chain (root-pkg-item)

func (*KeyWithLegend) ItemWithoutStateGroup added in v0.9.8

func (it *KeyWithLegend) ItemWithoutStateGroup(item interface{}) string

ItemWithoutStateGroup

Doesn't include existing group chain (root-pkg-item)

func (*KeyWithLegend) OutputItemsArray

func (it *KeyWithLegend) OutputItemsArray(request KeyLegendCompileRequest) []string

OutputItemsArray

Depending on Options
-   IsIgnoreLegendAttachments() - calls OutputWithoutLegend()
-   or else - calls compiles using legends

Chain may look like:
    - root-package-group-state-user-item

Ordering :

  • Root
  • Package
  • Group
  • State
  • User
  • Item

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

func (*KeyWithLegend) StateUserItem added in v0.9.8

func (it *KeyWithLegend) StateUserItem(state, user, item interface{}) string

func (*KeyWithLegend) UptoGroup

func (it *KeyWithLegend) UptoGroup(user string) string

func (*KeyWithLegend) UptoState added in v0.9.8

func (it *KeyWithLegend) UptoState(user string) string

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) Clone

func (it Option) Clone() Option

func (*Option) ClonePtr

func (it *Option) ClonePtr() *Option

func (*Option) IsAddEntryRegardlessOfEmptiness

func (it *Option) IsAddEntryRegardlessOfEmptiness() bool

Jump to

Keyboard shortcuts

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