kvutil

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsIDs

func ContainsIDs(key string, ids map[string]string) bool

ContainsIDs checks if a key contains specific ID values. It returns true if the key contains all ID types and values specified in the ids map.

func ExtractIDsFromKey

func ExtractIDsFromKey(key string, idTypes ...string) ([]string, error)

ExtractIDsFromKey extracts specific IDs from a given key based on the provided structure. It returns a slice of extracted ID values in the order of provided ID types. If any ID type is not found in the key, it returns an error.

func ExtractLastKeySegmentList

func ExtractLastKeySegmentList(keyValue []kvstore.KeyValue) ([]string, error)

ExtractLastKeySegmentList function extracts the last segment of each key in the keyValue slice.

func FilterKvListBy

func FilterKvListBy(kvs []kvstore.KeyValue, prefixKey string, depthAfterPrefix int) []kvstore.KeyValue

FilterKvListBy filters a slice of KeyValue pairs based on the given prefix key. It returns a new slice containing only the key-value pairs that match the prefix criteria.

func FilterKvMapBy

func FilterKvMapBy(kvmap kvstore.KeyValueMap, prefixKey string, depthAfterPrefix int) kvstore.KeyValueMap

FilterKvMapBy filters a KeyValue map based on the given prefix key. It returns a new KeyValue map containing only the key-value pairs that match the prefix criteria.

func GetKeyList

func GetKeyList(kvs []kvstore.KeyValue) []string

GetKeyList extracts keys from a slice of KeyValue pairs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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