util

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Array2DEquals

func Array2DEquals(a [][]string, b [][]string) bool

Determine whether two 2-dimensional string arrays are identical.

func ArrayEquals

func ArrayEquals(a []string, b []string) bool

Determine whether two string arrays are identical.

func ArrayRemoveDuplicates

func ArrayRemoveDuplicates(s *[]string)

Remove any duplicated elements in a string array.

func ArrayToString

func ArrayToString(s []string) string

Get a printable string for a string array.

func EscapeAssertion

func EscapeAssertion(s string) string

Escape the dots in the assertion, because the expression evaluation doesn't support such variable names.

func FixAttribute

func FixAttribute(s string) string

Translate the ABAC attributes into functions.

func KeyMatch

func KeyMatch(key1 string, key2 string) bool

Determine whether key1 matches the pattern of key2 (similar to RESTful path), key2 can contain a *. For example, /foo/bar matches /foo/*

func KeyMatchFunc

func KeyMatchFunc(args ...interface{}) (interface{}, error)

The wrapper for KeyMatch.

func RegexMatch added in v0.0.4

func RegexMatch(key1 string, key2 string) bool

Determine whether key1 matches the pattern of key2 in regular expression.

func RegexMatchFunc added in v0.0.4

func RegexMatchFunc(args ...interface{}) (interface{}, error)

The wrapper for RegexMatch.

func SetEquals added in v0.0.4

func SetEquals(a []string, b []string) bool

Determine whether two string sets are identical.

Types

This section is empty.

Jump to

Keyboard shortcuts

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