collection

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection interface {
	// FindRegex returns a slice of MatchData for the regex
	FindRegex(key *regexp.Regexp) []types.MatchData

	// FindString returns a slice of MatchData for the string
	FindString(key string) []types.MatchData

	// FindString returns a slice of MatchData for the string
	FindAll() []types.MatchData

	// Name returns the name for the current CollectionMap
	Name() string

	// Reset the current CollectionMap
	Reset()
}

Collection are used to store VARIABLE data for transactions, this data structured is designed to store slices of data for keys Important: CollectionMaps ARE NOT concurrent safe

type Map

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

Map are used to store VARIABLE data for transactions, this data structured is designed to store slices of data for keys Important: CollectionMaps ARE NOT concurrent safe

func NewMap

func NewMap(variable variables.RuleVariable) *Map

NewMap returns a collection of key->[]values

func (*Map) Add

func (c *Map) Add(key string, value string)

Add a value to some key

func (*Map) AddCS

func (c *Map) AddCS(key string, vKey string, vVal string)

AddCS a value to some key with case sensitive vKey

func (*Map) AddUnique

func (c *Map) AddUnique(key string, value string)

AddUnique will add a value to a key if it is not already there

func (*Map) AddUniqueCS

func (c *Map) AddUniqueCS(key string, vKey string, vVal string)

AddUniqueCS will add a value to a key if it is not already there with case sensitive vKey

func (*Map) Data

func (c *Map) Data() map[string][]string

Data returns all the data in the CollectionMap

func (*Map) FindAll

func (c *Map) FindAll() []types.MatchData

FindAll returns all the contained elements

func (*Map) FindRegex

func (c *Map) FindRegex(key *regexp.Regexp) []types.MatchData

FindRegex returns a slice of MatchData for the regex

func (*Map) FindString

func (c *Map) FindString(key string) []types.MatchData

FindString returns a slice of MatchData for the string

func (*Map) Get

func (c *Map) Get(key string) []string

Get returns a slice of strings for a key

func (*Map) Name

func (c *Map) Name() string

Name returns the name for the current CollectionMap

func (*Map) Remove

func (c *Map) Remove(key string)

Remove deletes the key from the CollectionMap

func (*Map) Reset

func (c *Map) Reset()

Reset the current CollectionMap

func (*Map) Set

func (c *Map) Set(key string, values []string)

Set will replace the key's value with this slice internally converts [] string to []types.AnchoredVar

func (*Map) SetCS

func (c *Map) SetCS(key string, vKey string, values []string)

SetCS will replace the key's value with this slice internally converts [] string to []types.AnchoredVar with case sensitive vKey

func (*Map) SetIndex

func (c *Map) SetIndex(key string, index int, value string)

SetIndex will place the value under the index If the index is higher than the current size of the CollectionMap it will be appended

func (*Map) SetIndexCS

func (c *Map) SetIndexCS(key string, index int, vKey string, value string)

SetIndexCS will place the value under the index If the index is higher than the current size of the CollectionMap it will be appended with case sensitive vKey

type Proxy

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

Proxy are used to store VARIABLE data for transactions, this data structured is designed to store slices of data for keys Important: CollectionProxys ARE NOT concurrent safe

func NewProxy

func NewProxy(variable variables.RuleVariable, data ...*Map) *Proxy

NewProxy returns a Proxy collection that merges all collections

func (*Proxy) Data

func (c *Proxy) Data() map[string][]string

Data returns merged data from all CollectionMap

func (*Proxy) FindAll

func (c *Proxy) FindAll() []types.MatchData

FindAll returns all matches for all collections

func (*Proxy) FindRegex

func (c *Proxy) FindRegex(key *regexp.Regexp) []types.MatchData

FindRegex returns a slice of MatchData for the regex

func (*Proxy) FindString

func (c *Proxy) FindString(key string) []types.MatchData

FindString returns a slice of MatchData for the string

func (*Proxy) Get

func (c *Proxy) Get(key string) []string

Get returns the data for the key

func (*Proxy) Name

func (c *Proxy) Name() string

Name returns the name for the current CollectionProxy

func (*Proxy) Reset

func (c *Proxy) Reset()

Reset the current CollectionProxy

type Simple

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

Simple are used to store VARIABLE data for transactions, this data structured is designed to store slices of data for keys Important: CollectionSimples ARE NOT concurrent safe

func NewSimple

func NewSimple(variable variables.RuleVariable) *Simple

NewSimple creates a new CollectionSimple

func (*Simple) FindAll

func (c *Simple) FindAll() []types.MatchData

FindAll returns a single MatchData for the current data

func (*Simple) FindRegex

func (c *Simple) FindRegex(key *regexp.Regexp) []types.MatchData

FindRegex returns a slice of MatchData for the regex

func (*Simple) FindString

func (c *Simple) FindString(key string) []types.MatchData

FindString returns a slice of MatchData for the string

func (*Simple) Int

func (c *Simple) Int() int

Int returns the first int occurrence of a key

func (*Simple) Int64

func (c *Simple) Int64() int64

Int64 returns the first int64 occurrence of a key

func (*Simple) Name

func (c *Simple) Name() string

Name returns the name for the current CollectionSimple

func (*Simple) Reset

func (c *Simple) Reset()

Reset the current CollectionSimple

func (*Simple) Set

func (c *Simple) Set(value string)

Set will replace the key's value with this slice internally converts [] string to []types.AnchoredVar

func (*Simple) String

func (c *Simple) String() string

String returns the first string occurrence of a key

type SizeProxy

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

SizeProxy are used to connect the size of many collection map values and return the sum

func NewCollectionSizeProxy

func NewCollectionSizeProxy(variable variables.RuleVariable, data ...*Map) *SizeProxy

NewCollectionSizeProxy returns a collection that only returns the total sum of all the collections values

func (*SizeProxy) FindAll

func (c *SizeProxy) FindAll() []types.MatchData

FindAll returns a slice of MatchData of all matches

func (*SizeProxy) FindRegex

func (c *SizeProxy) FindRegex(*regexp.Regexp) []types.MatchData

FindRegex returns a slice of MatchData for the regex

func (*SizeProxy) FindString

func (c *SizeProxy) FindString(string) []types.MatchData

FindString returns a slice of MatchData for the string

func (*SizeProxy) Name

func (c *SizeProxy) Name() string

Name returns the name for the current CollectionSizeProxy

func (*SizeProxy) Reset

func (c *SizeProxy) Reset()

Reset the current CollectionSizeProxy

func (*SizeProxy) Size

func (c *SizeProxy) Size() int64

Size returns the size of all the collections values

type TranslationProxy

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

TranslationProxy are used to store VARIABLE data for transactions, this data structured is designed to store slices of data for keys Important: CollectionTranslationProxys ARE NOT concurrent safe

func NewTranslationProxy

func NewTranslationProxy(variable variables.RuleVariable, data ...*Map) *TranslationProxy

NewTranslationProxy creates a translation proxy Translation proxies are used to merge variable keys from multiple collections

func (*TranslationProxy) Data

func (c *TranslationProxy) Data() []string

Data returns the keys of all Proxy collections

func (*TranslationProxy) FindAll

func (c *TranslationProxy) FindAll() []types.MatchData

FindAll returns all keys from Proxy Collections

func (*TranslationProxy) FindRegex

func (c *TranslationProxy) FindRegex(key *regexp.Regexp) []types.MatchData

FindRegex returns a slice of MatchData for the regex

func (*TranslationProxy) FindString

func (c *TranslationProxy) FindString(key string) []types.MatchData

FindString returns a slice of MatchData for the string

func (*TranslationProxy) Get

func (c *TranslationProxy) Get(index int) string

Get the value for the index

func (*TranslationProxy) Name

func (c *TranslationProxy) Name() string

Name returns the name for the current CollectionTranslationProxy

func (*TranslationProxy) Reset

func (c *TranslationProxy) Reset()

Reset the current CollectionTranslationProxy

Jump to

Keyboard shortcuts

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