Documentation ¶
Overview ¶
Package group provides a method for taking an identifier and value pair, comparing them with other pairs, and then grouping identical values.
Index ¶
- func EncodeByteSliceToCRC32(byt []byte) uint32
- func EncodeByteSliceToMD4(byt []byte) string
- func EncodeByteSliceToMD5(byt []byte) string
- func EncodeByteSliceToSha1(byt []byte) string
- func EncodeByteSliceToUint32(b []byte) uint32
- func GetSortedGroupMapKeys(m map[string][]string) []string
- type IdentifyingPair
- type ValueGrouping
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeByteSliceToCRC32 ¶
func EncodeByteSliceToMD4 ¶
func EncodeByteSliceToMD5 ¶
func EncodeByteSliceToSha1 ¶
func EncodeByteSliceToUint32 ¶
Only hashes first 4 bytes. Probably not useful.
func GetSortedGroupMapKeys ¶
Types ¶
type IdentifyingPair ¶
type IdentifyingPair struct { Key string // WARN: Potentially memory intensive if returning lots of data from ssh command. Might want to consider temp files // if number of bytes exceeds a limit. Value []byte // contains filtered or unexported fields }
func NewIdentifyingPair ¶
func NewIdentifyingPair(Key string, Value []byte) *IdentifyingPair
Creates a new IdentifyingPair, using the provide Key and Value pair. This can then be added to a new ValueGrouping, or otherwise processed.
type ValueGrouping ¶
type ValueGrouping struct { // Representing a byte slice as an encoded value for easy equality check. String slice of members. EncodedValueGroup map[string][]string // Preserve original byte slice EncodedValueToOriginal map[string][]byte Update chan struct{} // contains filtered or unexported fields }
ValueGrouping contains value/member groupings, and should only be written to by using the AddToGroup method.
func NewValueGrouping ¶
func NewValueGrouping() *ValueGrouping
Initialised a new ValueGrouping used to populate
func (*ValueGrouping) AddToGroup ¶
func (v *ValueGrouping) AddToGroup(i *IdentifyingPair)
AddToGroup creates or adds to an EncodedValueGroup. If an entry already exists for the encoded value provided within IdentifyingPair, the additional members will be added. This should be considered the only function for adding groups and members to an EncodedValueGroup.
func (*ValueGrouping) GetMembers ¶
func (v *ValueGrouping) GetMembers(hash string) ([]string, error)