policypb

package
v0.0.0-...-edbb0c7 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

README

policypb

Variables

Enum value maps for Comparison.

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,
    }
)
var File_policy_proto protoreflect.FileDescriptor

Types

type And

type And struct { ... }

An And policy aggregates sub-policies, requiring all children to be satisfied.

func (*And) Descriptor

func (*And) Descriptor() ([]byte, []int)

Deprecated: Use And.ProtoReflect.Descriptor instead.

func (*And) GetPolicy

func (x *And) GetPolicy() []*Policy

func (*And) ProtoMessage

func (*And) ProtoMessage()

func (*And) ProtoReflect

func (x *And) ProtoReflect() protoreflect.Message

func (*And) Reset

func (x *And) Reset()

func (*And) String

func (x *And) String() string

type Comparison

type Comparison int32

A Comparison operator describes how to match against a given value. All integer comparisons are big-endian, unsigned.

Constants
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

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 { ... }

An Or policy aggregates sub-policies, requiring at least one child to be satisfied.

func (*Or) Descriptor

func (*Or) Descriptor() ([]byte, []int)

Deprecated: Use Or.ProtoReflect.Descriptor instead.

func (*Or) GetPolicy

func (x *Or) GetPolicy() []*Policy

func (*Or) ProtoMessage

func (*Or) ProtoMessage()

func (*Or) ProtoReflect

func (x *Or) ProtoReflect() protoreflect.Message

func (*Or) Reset

func (x *Or) Reset()

func (*Or) String

func (x *Or) String() string

type Policy

type Policy struct { ... }

A Policy represents an AND/OR policy tree describing a set of acceptable states.

func (*Policy) Descriptor

func (*Policy) Descriptor() ([]byte, []int)

Deprecated: Use Policy.ProtoReflect.Descriptor instead.

func (*Policy) GetAnd

func (x *Policy) GetAnd() *And

func (*Policy) GetAssertion

func (m *Policy) GetAssertion() isPolicy_Assertion

func (*Policy) GetOr

func (x *Policy) GetOr() *Or

func (*Policy) GetRule

func (x *Policy) GetRule() *Rule

func (*Policy) ProtoMessage

func (*Policy) ProtoMessage()

func (*Policy) ProtoReflect

func (x *Policy) ProtoReflect() protoreflect.Message

func (*Policy) Reset

func (x *Policy) Reset()

func (*Policy) String

func (x *Policy) String() string

type Policy_And

type Policy_And struct { ... }

type Policy_Or

type Policy_Or struct { ... }

type Policy_Rule

type Policy_Rule struct { ... }

type Rule

type Rule struct { ... }

A leaf rule that is some assertion against RoT state.

func (*Rule) Descriptor

func (*Rule) Descriptor() ([]byte, []int)

Deprecated: Use Rule.ProtoReflect.Descriptor instead.

func (*Rule) GetAssertion

func (m *Rule) GetAssertion() isRule_Assertion

func (*Rule) GetSpam

func (x *Rule) GetSpam() *SpamRule

func (*Rule) ProtoMessage

func (*Rule) ProtoMessage()

func (*Rule) ProtoReflect

func (x *Rule) ProtoReflect() protoreflect.Message

func (*Rule) Reset

func (x *Rule) Reset()

func (*Rule) String

func (x *Rule) String() string

type Rule_Spam

type Rule_Spam struct { ... }

type SpamRule

type SpamRule struct { ... }

A Spam rule asserts a matcher against a sub-array of a spam.

func (*SpamRule) Descriptor

func (*SpamRule) Descriptor() ([]byte, []int)

Deprecated: Use SpamRule.ProtoReflect.Descriptor instead.

func (*SpamRule) GetComparison

func (x *SpamRule) GetComparison() Comparison

func (*SpamRule) GetIndex

func (x *SpamRule) GetIndex() uint32

func (*SpamRule) GetOffset

func (x *SpamRule) GetOffset() uint32

func (*SpamRule) GetOperand

func (x *SpamRule) GetOperand() []byte

func (*SpamRule) ProtoMessage

func (*SpamRule) ProtoMessage()

func (*SpamRule) ProtoReflect

func (x *SpamRule) ProtoReflect() protoreflect.Message

func (*SpamRule) Reset

func (x *SpamRule) Reset()

func (*SpamRule) String

func (x *SpamRule) String() string


Readme created from Go doc with goreadme

Documentation

Index

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) Descriptor() ([]byte, []int)

Deprecated: Use And.ProtoReflect.Descriptor instead.

func (*And) GetPolicy

func (x *And) GetPolicy() []*Policy

func (*And) ProtoMessage

func (*And) ProtoMessage()

func (*And) ProtoReflect

func (x *And) ProtoReflect() protoreflect.Message

func (*And) Reset

func (x *And) Reset()

func (*And) String

func (x *And) String() string

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

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) Descriptor() ([]byte, []int)

Deprecated: Use Or.ProtoReflect.Descriptor instead.

func (*Or) GetPolicy

func (x *Or) GetPolicy() []*Policy

func (*Or) ProtoMessage

func (*Or) ProtoMessage()

func (*Or) ProtoReflect

func (x *Or) ProtoReflect() protoreflect.Message

func (*Or) Reset

func (x *Or) Reset()

func (*Or) String

func (x *Or) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Policy.ProtoReflect.Descriptor instead.

func (*Policy) GetAnd

func (x *Policy) GetAnd() *And

func (*Policy) GetAssertion

func (m *Policy) GetAssertion() isPolicy_Assertion

func (*Policy) GetOr

func (x *Policy) GetOr() *Or

func (*Policy) GetRule

func (x *Policy) GetRule() *Rule

func (*Policy) ProtoMessage

func (*Policy) ProtoMessage()

func (*Policy) ProtoReflect

func (x *Policy) ProtoReflect() protoreflect.Message

func (*Policy) Reset

func (x *Policy) Reset()

func (*Policy) String

func (x *Policy) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Rule.ProtoReflect.Descriptor instead.

func (*Rule) GetAssertion

func (m *Rule) GetAssertion() isRule_Assertion

func (*Rule) GetSpam

func (x *Rule) GetSpam() *SpamRule

func (*Rule) ProtoMessage

func (*Rule) ProtoMessage()

func (*Rule) ProtoReflect

func (x *Rule) ProtoReflect() protoreflect.Message

func (*Rule) Reset

func (x *Rule) Reset()

func (*Rule) String

func (x *Rule) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use SpamRule.ProtoReflect.Descriptor instead.

func (*SpamRule) GetComparison

func (x *SpamRule) GetComparison() Comparison

func (*SpamRule) GetIndex

func (x *SpamRule) GetIndex() uint32

func (*SpamRule) GetOffset

func (x *SpamRule) GetOffset() uint32

func (*SpamRule) GetOperand

func (x *SpamRule) GetOperand() []byte

func (*SpamRule) ProtoMessage

func (*SpamRule) ProtoMessage()

func (*SpamRule) ProtoReflect

func (x *SpamRule) ProtoReflect() protoreflect.Message

func (*SpamRule) Reset

func (x *SpamRule) Reset()

func (*SpamRule) String

func (x *SpamRule) String() string

Jump to

Keyboard shortcuts

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