util

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DedupCapabilitySlice added in v0.2.0

func DedupCapabilitySlice(list []pb.Capability) []pb.Capability

DedupCapabilitySlice converts to a map and then back to a pb.Capability slice to dedup pb.Capabilitys by exact matches.

func DedupStringSlice added in v0.2.0

func DedupStringSlice(list []string) []string

DedupStringSlice converts to a map and then back to a string slice to dedup strings by exact matches.

func PatchKeyValueSlice

func PatchKeyValueSlice(slice []string, mode, key, value string) []string

PatchKeyValueSlice patches slices that use key/value pairs. Its designed with more advanced functionality around exact key matching, fuzzy and exact clearing, and OpenLDAP-style Z-Ordering.

func PatchStringSlice

func PatchStringSlice(in []string, patch string, insert bool, matchExact bool) []string

PatchStringSlice patches a string into or out of a slice of other strings. It also ensures that the strings are unique within the slice. When insert is false, the action of the function is to remove the provided patch string from the input slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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