Documentation
¶
Index ¶
- Constants
- Variables
- func CleanJson(actual any) string
- func Cleanup(a string) string
- func EqualSets[T comparable](actual, expected []T) (bool, mapset.Set[T])
- func FixJson(b []byte) string
- func IsExpired(endTimeInMilli int64) bool
- func Join(a, b string) string
- func Parent(path string) string
- func PathComponents(path string) []int
- func SafeUnique() int64
- func ValidPrincipal(id string) bool
- type VersionMismatchError
Constants ¶
View Source
const ( StandardPrefix = "am://" UserPrefix = StandardPrefix + "user" WorkloadPrefix = StandardPrefix + "workload" DataPrefix = StandardPrefix + "data" RolePrefix = StandardPrefix + "role" KeyPrefix = StandardPrefix + "key" AnonymousUser = UserPrefix + "/***/***" AnonymousWorkload = WorkloadPrefix + "/***/***" AnonymousDataset = DataPrefix + "/***/***" RedactedRole = "## Redacted role ##" )
Variables ¶
View Source
var (
StandardPattern = regexp.MustCompile(`^` + StandardPrefix + `([a-zA-Z0-9-]+(/[a-zA-Z0-9-]*)*/?)?$`)
)
Functions ¶
func PathComponents ¶
PathComponents returns an array of indexes for all proper component prefixes of a URI omitting the standard lead-in.
For a URI of "am://abc/def/g", this will give back [6, 9, 13, 15]. ``` "am://abc/def/g"[0:6] = "am://" "am://abc/def/g"[0:9] = "am://abc" "am://abc/def/g"[0:13] = "am://abc/def" "am://abc/def/g"[0:15] = "am://abc/def/g" ```
func SafeUnique ¶
func SafeUnique() int64
SafeUnique generates a random integer that javascript won't choke on
func ValidPrincipal ¶
Types ¶
type VersionMismatchError ¶
type VersionMismatchError struct {
Msg string
}
func (VersionMismatchError) Error ¶
func (e VersionMismatchError) Error() string
Click to show internal directories.
Click to hide internal directories.