rgw

package
v0.0.0-...-b846661 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoopUserFilter = func(User) bool { return true }

Functions

func FilterUser

func FilterUser(user User, filter ...UserFilter) bool

Types

type User

type User struct {
	Tenant string
	User   string
}

func UserFromUserID

func UserFromUserID(userID string) User

func (User) UserID

func (u User) UserID() string

type UserBuckets

type UserBuckets struct {
	User    User
	Buckets []string
}

type UserBucketsSortedByUser

type UserBucketsSortedByUser []UserBuckets

func (UserBucketsSortedByUser) Len

func (u UserBucketsSortedByUser) Len() int

Len is the number of elements in the collection.

func (UserBucketsSortedByUser) Less

func (u UserBucketsSortedByUser) Less(i int, j int) bool

Less reports whether the element with index i must sort before the element with index j.

If both Less(i, j) and Less(j, i) are false, then the elements at index i and j are considered equal. Sort may place equal elements in any order in the final result, while Stable preserves the original input order of equal elements.

Less must describe a transitive ordering:

  • if both Less(i, j) and Less(j, k) are true, then Less(i, k) must be true as well.
  • if both Less(i, j) and Less(j, k) are false, then Less(i, k) must be false as well.

Note that floating-point comparison (the < operator on float32 or float64 values) is not a transitive ordering when not-a-number (NaN) values are involved. See Float64Slice.Less for a correct implementation for floating-point values.

func (UserBucketsSortedByUser) Swap

func (u UserBucketsSortedByUser) Swap(i int, j int)

Swap swaps the elements with indexes i and j.

type UserFilter

type UserFilter func(User) bool

func FilterByTenantPrefix

func FilterByTenantPrefix(tenantPrefix string) UserFilter

func FilterByUserID

func FilterByUserID(userID string) UserFilter

Jump to

Keyboard shortcuts

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