Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidRange = errors.New("invalid range; a range must consist of positive integers and the upper bound must be greater than or equal to the lower bound")
)
Range errors
Functions ¶
func IsUserAllowed ¶
IsUserAllowed checks that the given user is numeric and is contained by the given RangeList
Types ¶
type ErrParseRange ¶
type ErrParseRange struct {
// contains filtered or unexported fields
}
ErrParseRange is an error encountered while parsing a Range
func (*ErrParseRange) Error ¶
func (e *ErrParseRange) Error() string
type Range ¶
type Range struct {
// contains filtered or unexported fields
}
Range represents a range of user ids. It can be unbound at either end with a nil value I both From and To are present, To must be greater than or equal to From. Bounds are inclusive
func NewRangeFrom ¶
NewRangeFrom creates a new range with only the lower bound
func NewRangeTo ¶
NewRangeTo creates a new range with only the upper bound
func ParseRange ¶
ParseRange creates a Range from a given string
type RangeList ¶
type RangeList []*Range
RangeList is a list of user ranges
func ParseRangeList ¶
ParseRangeList parses a string that contains a comma-separated list of ranges
func (*RangeList) Contains ¶
Contains returns true if the uid is contained by any range in the RangeList