Documentation ¶
Index ¶
- Variables
- type And
- type Comparison
- type Or
- type Policy
- func (*Policy) Descriptor() ([]byte, []int)deprecated
- func (x *Policy) GetAnd() *And
- func (m *Policy) GetAssertion() isPolicy_Assertion
- func (x *Policy) GetOr() *Or
- func (x *Policy) GetRule() *Rule
- func (*Policy) ProtoMessage()
- func (x *Policy) ProtoReflect() protoreflect.Message
- func (x *Policy) Reset()
- func (x *Policy) String() string
- type Policy_And
- type Policy_Or
- type Policy_Rule
- type Rule
- type Rule_Spam
- type SpamRule
- func (*SpamRule) Descriptor() ([]byte, []int)deprecated
- func (x *SpamRule) GetComparison() Comparison
- func (x *SpamRule) GetIndex() uint32
- func (x *SpamRule) GetOffset() uint32
- func (x *SpamRule) GetOperand() []byte
- func (*SpamRule) ProtoMessage()
- func (x *SpamRule) ProtoReflect() protoreflect.Message
- func (x *SpamRule) Reset()
- func (x *SpamRule) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Comparison_name = map[int32]string{ 0: "EQ", 1: "NEQ", 2: "GT", 3: "GTE", 4: "LT", 5: "LTE", 6: "BITSET", 7: "BITCLEAR", } Comparison_value = map[string]int32{ "EQ": 0, "NEQ": 1, "GT": 2, "GTE": 3, "LT": 4, "LTE": 5, "BITSET": 6, "BITCLEAR": 7, } )
Enum value maps for Comparison.
View Source
var File_policy_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type And ¶
type And struct { // The sub-policies to aggregate. Policy []*Policy `protobuf:"bytes,1,rep,name=policy,proto3" json:"policy,omitempty"` // contains filtered or unexported fields }
An And policy aggregates sub-policies, requiring all children to be satisfied.
func (*And) Descriptor
deprecated
func (*And) ProtoMessage ¶
func (*And) ProtoMessage()
func (*And) ProtoReflect ¶
func (x *And) ProtoReflect() protoreflect.Message
type Comparison ¶
type Comparison int32
A Comparison operator describes how to match against a given value. All integer comparisons are big-endian, unsigned.
const ( Comparison_EQ Comparison = 0 Comparison_NEQ Comparison = 1 Comparison_GT Comparison = 2 Comparison_GTE Comparison = 3 Comparison_LT Comparison = 4 Comparison_LTE Comparison = 5 Comparison_BITSET Comparison = 6 Comparison_BITCLEAR Comparison = 7 )
func (Comparison) Descriptor ¶
func (Comparison) Descriptor() protoreflect.EnumDescriptor
func (Comparison) Enum ¶
func (x Comparison) Enum() *Comparison
func (Comparison) EnumDescriptor
deprecated
func (Comparison) EnumDescriptor() ([]byte, []int)
Deprecated: Use Comparison.Descriptor instead.
func (Comparison) Number ¶
func (x Comparison) Number() protoreflect.EnumNumber
func (Comparison) String ¶
func (x Comparison) String() string
func (Comparison) Type ¶
func (Comparison) Type() protoreflect.EnumType
type Or ¶
type Or struct { // The sub-policies to aggregate. Policy []*Policy `protobuf:"bytes,1,rep,name=policy,proto3" json:"policy,omitempty"` // contains filtered or unexported fields }
An Or policy aggregates sub-policies, requiring at least one child to be satisfied.
func (*Or) Descriptor
deprecated
func (*Or) ProtoMessage ¶
func (*Or) ProtoMessage()
func (*Or) ProtoReflect ¶
func (x *Or) ProtoReflect() protoreflect.Message
type Policy ¶
type Policy struct { // Types that are assignable to Assertion: // *Policy_Rule // *Policy_And // *Policy_Or Assertion isPolicy_Assertion `protobuf_oneof:"assertion"` // contains filtered or unexported fields }
A Policy represents an AND/OR policy tree describing a set of acceptable states.
func (*Policy) Descriptor
deprecated
func (*Policy) GetAssertion ¶
func (m *Policy) GetAssertion() isPolicy_Assertion
func (*Policy) ProtoMessage ¶
func (*Policy) ProtoMessage()
func (*Policy) ProtoReflect ¶
func (x *Policy) ProtoReflect() protoreflect.Message
type Policy_And ¶
type Policy_And struct { // AND-aggregation of a set of sub-policies. And *And `protobuf:"bytes,2,opt,name=and,proto3,oneof"` }
type Policy_Or ¶
type Policy_Or struct { // OR-aggregation of a set of sub-policies. Or *Or `protobuf:"bytes,3,opt,name=or,proto3,oneof"` }
type Policy_Rule ¶
type Policy_Rule struct { // A single leaf assertion. Rule *Rule `protobuf:"bytes,1,opt,name=rule,proto3,oneof"` }
type Rule ¶
type Rule struct { // Types that are assignable to Assertion: // *Rule_Spam Assertion isRule_Assertion `protobuf_oneof:"assertion"` // contains filtered or unexported fields }
A leaf rule that is some assertion against RoT state.
func (*Rule) Descriptor
deprecated
func (*Rule) GetAssertion ¶
func (m *Rule) GetAssertion() isRule_Assertion
func (*Rule) ProtoMessage ¶
func (*Rule) ProtoMessage()
func (*Rule) ProtoReflect ¶
func (x *Rule) ProtoReflect() protoreflect.Message
type Rule_Spam ¶
type Rule_Spam struct { // A rule that asserts the value of a particular spam. Spam *SpamRule `protobuf:"bytes,1,opt,name=spam,proto3,oneof"` }
type SpamRule ¶
type SpamRule struct { // The spam index (0 to 65536) to match against. Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` // The number of bytes into the spam the first operand begins at. Offset uint32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` // The comparison operator to use for the rule. Comparison Comparison `protobuf:"varint,3,opt,name=comparison,proto3,enum=policy.Comparison" json:"comparison,omitempty"` // The second operand for the operation. Operand []byte `protobuf:"bytes,4,opt,name=operand,proto3" json:"operand,omitempty"` // contains filtered or unexported fields }
A Spam rule asserts a matcher against a sub-array of a spam.
func (*SpamRule) Descriptor
deprecated
func (*SpamRule) GetComparison ¶
func (x *SpamRule) GetComparison() Comparison
func (*SpamRule) GetOperand ¶
func (*SpamRule) ProtoMessage ¶
func (*SpamRule) ProtoMessage()
func (*SpamRule) ProtoReflect ¶
func (x *SpamRule) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.