Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Range ¶
type Range struct {
Start, Stop uint32
}
Range represents a single seq-number or seq-range value (RFC 3501 ABNF). Values may be static (e.g. "1", "2:4") or dynamic (e.g. "*", "1:*"). A seq-number is represented by setting Start = Stop. Zero is used to represent "*", which is safe because seq-number uses nz-number rule. The order of values is always Start <= Stop, except when representing "n:*", where Start = n and Stop = 0.
func (Range) Contains ¶
Contains returns true if the seq-number q is contained in range value s. The dynamic value "*" contains only other "*" values, the dynamic range "n:*" contains "*" and all numbers >= n.
type Set ¶
type Set []Range
Set is used to represent a set of message sequence numbers or UIDs (see sequence-set ABNF rule). The zero value is an empty set.
func (Set) Contains ¶
Contains returns true if the non-zero sequence number or UID q is contained in the set. The dynamic range "n:*" contains all q >= n. It is the caller's responsibility to handle the special case where q is the maximum UID in the mailbox and q < n (i.e. the set cannot match UIDs against "*:n" or "*" since it doesn't know what the maximum value is).