util

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 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

Array2DEquals determines whether two 2-dimensional string arrays are identical.

func ArrayEquals

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

ArrayEquals determines whether two string arrays are identical.

func ArrayRemoveDuplicates

func ArrayRemoveDuplicates(s *[]string)

ArrayRemoveDuplicates removes any duplicated elements in a string array.

func ArrayToString

func ArrayToString(s []string) string

ArrayToString gets a printable string for a string array.

func EscapeAssertion

func EscapeAssertion(s string) string

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

func FixAttribute

func FixAttribute(s string) string

FixAttribute translates the ABAC attributes into functions.

func KeyMatch

func KeyMatch(key1 string, key2 string) bool

KeyMatch determines 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)

KeyMatchFunc is the wrapper for KeyMatch.

func RegexMatch added in v0.0.4

func RegexMatch(key1 string, key2 string) bool

RegexMatch determines whether key1 matches the pattern of key2 in regular expression.

func RegexMatchFunc added in v0.0.4

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

RegexMatchFunc is the wrapper for RegexMatch.

func RemoveComments added in v0.1.0

func RemoveComments(s string) string

RemoveComments removes the comments starting with # in the text.

func SetEquals added in v0.0.4

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

SetEquals determines 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