2020-12-29 10:45:49 +00:00
|
|
|
package callflag
|
2020-03-19 15:52:37 +00:00
|
|
|
|
|
|
|
// CallFlag represents call flag.
|
|
|
|
type CallFlag byte
|
|
|
|
|
|
|
|
// Default flags.
|
|
|
|
const (
|
2020-12-11 07:34:01 +00:00
|
|
|
ReadStates CallFlag = 1 << iota
|
|
|
|
WriteStates
|
2020-03-19 15:52:37 +00:00
|
|
|
AllowCall
|
|
|
|
AllowNotify
|
2020-12-11 07:34:01 +00:00
|
|
|
|
|
|
|
States = ReadStates | WriteStates
|
|
|
|
ReadOnly = ReadStates | AllowCall
|
|
|
|
All = States | AllowCall | AllowNotify
|
2020-06-10 14:24:48 +00:00
|
|
|
NoneFlag CallFlag = 0
|
2020-03-19 15:52:37 +00:00
|
|
|
)
|
2020-06-10 12:50:51 +00:00
|
|
|
|
|
|
|
// Has returns true iff all bits set in cf are also set in f.
|
|
|
|
func (f CallFlag) Has(cf CallFlag) bool {
|
|
|
|
return f&cf == cf
|
|
|
|
}
|