Documentation
¶
Index ¶
- Constants
- Variables
- type Bucket
- func (b *Bucket) AddBucket(o string, n []int32) error
- func (b *Bucket) AddChild(c Bucket)
- func (b *Bucket) AddNode(n int32, opts ...string) error
- func (b Bucket) CheckConflicts(b1 Bucket) bool
- func (b Bucket) Children() []Bucket
- func (b Bucket) Copy() Bucket
- func (b Bucket) Dump(name string) error
- func (b Bucket) DumpWithSelection(name string, b1 Bucket) error
- func (b Bucket) Equals(b1 Bucket) bool
- func (b *Bucket) FindGraph(pivot []byte, ss ...SFGroup) (c *Bucket)
- func (b *Bucket) FindNodes(pivot []byte, ss ...SFGroup) (nodes []int32)
- func (b Bucket) GetMaxSelection(ss []Select, fs []Filter) (r *Bucket)
- func (b Bucket) GetNodesByOption(opts ...string) []int32
- func (b Bucket) GetSelection(ss []Select, pivot []byte) *Bucket
- func (b Bucket) Hash() uint64
- func (b Bucket) IsValid() bool
- func (b Bucket) MarshalBinary() ([]byte, error)
- func (b *Bucket) Merge(b1 Bucket)
- func (b Bucket) Name() string
- func (b Bucket) Nodelist() (r []int32)
- func (b *Bucket) Read(r io.Reader) error
- func (b Bucket) Sdump() (string, error)
- func (b Bucket) SdumpWithSelection(b1 Bucket) (string, error)
- func (b *Bucket) UnmarshalBinary(data []byte) (err error)
- func (b *Bucket) UpdateIndices(tr map[int32]int32) Bucket
- func (b Bucket) Write(w io.Writer) error
- type Filter
- func (f Filter) Check(b Bucket) bool
- func (*Filter) Descriptor() ([]byte, []int)
- func (f Filter) Filter(bs ...Bucket) []Bucket
- func (m *Filter) GetF() *SimpleFilter
- func (m *Filter) GetKey() string
- func (m *Filter) Marshal() (dAtA []byte, err error)
- func (m *Filter) MarshalTo(dAtA []byte) (int, error)
- func (*Filter) ProtoMessage()
- func (m *Filter) Reset()
- func (m *Filter) Size() (n int)
- func (m *Filter) String() string
- func (m *Filter) Unmarshal(dAtA []byte) error
- func (m *Filter) XXX_DiscardUnknown()
- func (m *Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Filter) XXX_Merge(src proto.Message)
- func (m *Filter) XXX_Size() int
- func (m *Filter) XXX_Unmarshal(b []byte) error
- type FilterFunc
- type Graph
- type Int32Slice
- type Operation
- type PlacementRule
- func (*PlacementRule) Descriptor() ([]byte, []int)
- func (m *PlacementRule) GetReplFactor() uint32
- func (m *PlacementRule) GetSFGroups() []SFGroup
- func (m *PlacementRule) Marshal() (dAtA []byte, err error)
- func (m *PlacementRule) MarshalTo(dAtA []byte) (int, error)
- func (*PlacementRule) ProtoMessage()
- func (m *PlacementRule) Reset()
- func (m *PlacementRule) Size() (n int)
- func (m *PlacementRule) String() string
- func (m *PlacementRule) Unmarshal(dAtA []byte) error
- func (m *PlacementRule) XXX_DiscardUnknown()
- func (m *PlacementRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PlacementRule) XXX_Merge(src proto.Message)
- func (m *PlacementRule) XXX_Size() int
- func (m *PlacementRule) XXX_Unmarshal(b []byte) error
- type Policy
- type SFGroup
- func (*SFGroup) Descriptor() ([]byte, []int)
- func (m *SFGroup) GetFilters() []Filter
- func (m *SFGroup) GetSelectors() []Select
- func (m *SFGroup) Marshal() (dAtA []byte, err error)
- func (m *SFGroup) MarshalTo(dAtA []byte) (int, error)
- func (*SFGroup) ProtoMessage()
- func (m *SFGroup) Reset()
- func (m *SFGroup) Size() (n int)
- func (m *SFGroup) String() string
- func (m *SFGroup) Unmarshal(dAtA []byte) error
- func (m *SFGroup) XXX_DiscardUnknown()
- func (m *SFGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SFGroup) XXX_Merge(src proto.Message)
- func (m *SFGroup) XXX_Size() int
- func (m *SFGroup) XXX_Unmarshal(b []byte) error
- type Select
- func (*Select) Descriptor() ([]byte, []int)
- func (m *Select) GetCount() int32
- func (m *Select) GetKey() string
- func (m *Select) Marshal() (dAtA []byte, err error)
- func (m *Select) MarshalTo(dAtA []byte) (int, error)
- func (*Select) ProtoMessage()
- func (m *Select) Reset()
- func (m *Select) Size() (n int)
- func (m *Select) String() string
- func (m *Select) Unmarshal(dAtA []byte) error
- func (m *Select) XXX_DiscardUnknown()
- func (m *Select) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Select) XXX_Merge(src proto.Message)
- func (m *Select) XXX_Size() int
- func (m *Select) XXX_Unmarshal(b []byte) error
- type SimpleFilter
- func FilterAND(fs ...*SimpleFilter) *SimpleFilter
- func FilterEQ(v string) *SimpleFilter
- func FilterGE(v int64) *SimpleFilter
- func FilterGT(v int64) *SimpleFilter
- func FilterIn(values ...string) *SimpleFilter
- func FilterLE(v int64) *SimpleFilter
- func FilterLT(v int64) *SimpleFilter
- func FilterNE(v string) *SimpleFilter
- func FilterNotIn(values ...string) *SimpleFilter
- func FilterOR(fs ...*SimpleFilter) *SimpleFilter
- func NewFilter(op Operation, value string) *SimpleFilter
- func (sf SimpleFilter) Check(value string) bool
- func (*SimpleFilter) Descriptor() ([]byte, []int)
- func (m *SimpleFilter) GetArgs() isSimpleFilter_Args
- func (m *SimpleFilter) GetFArgs() *SimpleFilters
- func (m *SimpleFilter) GetOp() Operation
- func (m *SimpleFilter) GetValue() string
- func (m *SimpleFilter) Marshal() (dAtA []byte, err error)
- func (m *SimpleFilter) MarshalTo(dAtA []byte) (int, error)
- func (*SimpleFilter) ProtoMessage()
- func (m *SimpleFilter) Reset()
- func (m *SimpleFilter) Size() (n int)
- func (m *SimpleFilter) String() string
- func (m *SimpleFilter) Unmarshal(dAtA []byte) error
- func (m *SimpleFilter) XXX_DiscardUnknown()
- func (m *SimpleFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SimpleFilter) XXX_Merge(src proto.Message)
- func (*SimpleFilter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- func (m *SimpleFilter) XXX_Size() int
- func (m *SimpleFilter) XXX_Unmarshal(b []byte) error
- type SimpleFilter_FArgs
- type SimpleFilter_Value
- type SimpleFilters
- func (*SimpleFilters) Descriptor() ([]byte, []int)
- func (m *SimpleFilters) GetFilters() []*SimpleFilter
- func (m *SimpleFilters) Marshal() (dAtA []byte, err error)
- func (m *SimpleFilters) MarshalTo(dAtA []byte) (int, error)
- func (*SimpleFilters) ProtoMessage()
- func (m *SimpleFilters) Reset()
- func (m *SimpleFilters) Size() (n int)
- func (m *SimpleFilters) String() string
- func (m *SimpleFilters) Unmarshal(dAtA []byte) error
- func (m *SimpleFilters) XXX_DiscardUnknown()
- func (m *SimpleFilters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SimpleFilters) XXX_Merge(src proto.Message)
- func (m *SimpleFilters) XXX_Size() int
- func (m *SimpleFilters) XXX_Unmarshal(b []byte) error
- type Type
Constants ¶
const ( // Separator separates key:value pairs in string representation of options. Separator = "/" // NodesBucket is the name for optionless bucket containing only nodes. NodesBucket = "Node" )
Variables ¶
var ( ErrInvalidLengthSelector = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowSelector = fmt.Errorf("proto: integer overflow") )
var Operation_name = map[int32]string{
0: "NP",
1: "EQ",
2: "NE",
3: "GT",
4: "GE",
5: "LT",
6: "LE",
7: "OR",
8: "AND",
}
var Operation_value = map[string]int32{
"NP": 0,
"EQ": 1,
"NE": 2,
"GT": 3,
"GE": 4,
"LT": 5,
"LE": 6,
"OR": 7,
"AND": 8,
}
var Type_name = map[int32]string{
0: "String",
1: "Integer",
}
var Type_value = map[string]int32{
"String": 0,
"Integer": 1,
}
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
Bucket represents netmap as graph.
func (*Bucket) AddBucket ¶
AddBucket add bucket corresponding to option o with nodes n as subbucket to b.
func (Bucket) CheckConflicts ¶
CheckConflicts checks if b1 is ready to merge with b. Conflict is a situation, when node has different values for the same option in b and b1.
func (Bucket) DumpWithSelection ¶
DumpWithSelection dumps string representation of Bucket in *.dot format where subgraph b1 is highlighted to file name.
func (Bucket) Equals ¶
Equals checks if b and b1 represent the same Bucket (excluding contained nodes).
func (*Bucket) FindGraph ¶
FindGraph returns random subgraph, corresponding to specified placement rule.
func (*Bucket) FindNodes ¶
FindNodes returns list of nodes, corresponding to specified placement rule.
func (Bucket) GetMaxSelection ¶
GetMaxSelection returns 'maximal container' -- subgraph which contains any other subgraph satisfying specified selects and filters.
func (Bucket) GetNodesByOption ¶
GetNodesByOption returns list of nodes possessing specified options.
func (Bucket) GetSelection ¶
GetSelection returns subgraph, satisfying specified selections. It is assumed that all filters were already applied.
func (Bucket) IsValid ¶
IsValid checks if bucket is well-formed: - all nodes contained in sub-bucket must belong to this - there must be no nodes belonging to 2 buckets
func (Bucket) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*Bucket) Read ¶
Read reads Bucket in serialized form: [lnName][Name][lnNodes][Node1]...[NodeN][lnSubprops][sub1]...[subN]
func (Bucket) SdumpWithSelection ¶
SdumpWithSelection returns string representation of Bucket in *.dot format where subgraph b1 is highlighted.
func (*Bucket) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*Bucket) UpdateIndices ¶
UpdateIndices is auxiliary function used to update indices of all nodes according to tr.
type Filter ¶
type Filter struct {
Key string `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"`
F *SimpleFilter `protobuf:"bytes,2,opt,name=F,proto3" json:"F,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Filter) Descriptor ¶
func (*Filter) GetF ¶
func (m *Filter) GetF() *SimpleFilter
func (*Filter) ProtoMessage ¶
func (*Filter) ProtoMessage()
func (*Filter) XXX_DiscardUnknown ¶
func (m *Filter) XXX_DiscardUnknown()
func (*Filter) XXX_Marshal ¶
func (*Filter) XXX_Unmarshal ¶
type FilterFunc ¶
FilterFunc is generic type for filtering function on nodes.
type Int32Slice ¶
type Int32Slice []int32
Int32Slice is generic type for more convenient sorting.
func (Int32Slice) Len ¶
func (p Int32Slice) Len() int
func (Int32Slice) Less ¶
func (p Int32Slice) Less(i, j int) bool
func (Int32Slice) Swap ¶
func (p Int32Slice) Swap(i, j int)
type PlacementRule ¶ added in v1.0.6
type PlacementRule struct {
ReplFactor uint32 `protobuf:"varint,1,opt,name=ReplFactor,proto3" json:"ReplFactor,omitempty"`
SFGroups []SFGroup `protobuf:"bytes,2,rep,name=SFGroups,proto3" json:"SFGroups"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*PlacementRule) Descriptor ¶ added in v1.0.6
func (*PlacementRule) Descriptor() ([]byte, []int)
func (*PlacementRule) GetReplFactor ¶ added in v1.0.6
func (m *PlacementRule) GetReplFactor() uint32
func (*PlacementRule) GetSFGroups ¶ added in v1.0.6
func (m *PlacementRule) GetSFGroups() []SFGroup
func (*PlacementRule) Marshal ¶ added in v1.0.6
func (m *PlacementRule) Marshal() (dAtA []byte, err error)
func (*PlacementRule) MarshalTo ¶ added in v1.0.6
func (m *PlacementRule) MarshalTo(dAtA []byte) (int, error)
func (*PlacementRule) ProtoMessage ¶ added in v1.0.6
func (*PlacementRule) ProtoMessage()
func (*PlacementRule) Reset ¶ added in v1.0.6
func (m *PlacementRule) Reset()
func (*PlacementRule) Size ¶ added in v1.0.6
func (m *PlacementRule) Size() (n int)
func (*PlacementRule) String ¶ added in v1.0.6
func (m *PlacementRule) String() string
func (*PlacementRule) Unmarshal ¶ added in v1.0.6
func (m *PlacementRule) Unmarshal(dAtA []byte) error
func (*PlacementRule) XXX_DiscardUnknown ¶ added in v1.0.6
func (m *PlacementRule) XXX_DiscardUnknown()
func (*PlacementRule) XXX_Marshal ¶ added in v1.0.6
func (m *PlacementRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PlacementRule) XXX_Merge ¶ added in v1.0.6
func (m *PlacementRule) XXX_Merge(src proto.Message)
func (*PlacementRule) XXX_Size ¶ added in v1.0.6
func (m *PlacementRule) XXX_Size() int
func (*PlacementRule) XXX_Unmarshal ¶ added in v1.0.6
func (m *PlacementRule) XXX_Unmarshal(b []byte) error
type SFGroup ¶ added in v1.0.5
type SFGroup struct {
Filters []Filter `protobuf:"bytes,1,rep,name=Filters,proto3" json:"Filters"`
Selectors []Select `protobuf:"bytes,2,rep,name=Selectors,proto3" json:"Selectors"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*SFGroup) Descriptor ¶ added in v1.0.5
func (*SFGroup) GetFilters ¶ added in v1.0.5
func (*SFGroup) GetSelectors ¶ added in v1.0.5
func (*SFGroup) ProtoMessage ¶ added in v1.0.5
func (*SFGroup) ProtoMessage()
func (*SFGroup) XXX_DiscardUnknown ¶ added in v1.0.5
func (m *SFGroup) XXX_DiscardUnknown()
func (*SFGroup) XXX_Marshal ¶ added in v1.0.5
func (*SFGroup) XXX_Unmarshal ¶ added in v1.0.5
type Select ¶
type Select struct {
Count int32 `protobuf:"varint,1,opt,name=Count,proto3" json:"Count,omitempty"`
Key string `protobuf:"bytes,2,opt,name=Key,proto3" json:"Key,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Select) Descriptor ¶
func (*Select) ProtoMessage ¶
func (*Select) ProtoMessage()
func (*Select) XXX_DiscardUnknown ¶
func (m *Select) XXX_DiscardUnknown()
func (*Select) XXX_Marshal ¶
func (*Select) XXX_Unmarshal ¶
type SimpleFilter ¶
type SimpleFilter struct {
Op Operation `protobuf:"varint,1,opt,name=Op,proto3,enum=netgraph.Operation" json:"Op,omitempty"`
// Types that are valid to be assigned to Args:
// *SimpleFilter_Value
// *SimpleFilter_FArgs
Args isSimpleFilter_Args `protobuf_oneof:"Args"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func FilterAND ¶
func FilterAND(fs ...*SimpleFilter) *SimpleFilter
FilterAND returns AND combination of filters.
func FilterEQ ¶
func FilterEQ(v string) *SimpleFilter
FilterEQ returns filter, which checks if value is equal to v.
func FilterGE ¶
func FilterGE(v int64) *SimpleFilter
FilterGE returns filter, which checks if value is greater or equal than v.
func FilterGT ¶
func FilterGT(v int64) *SimpleFilter
FilterGT returns filter, which checks if value is greater than v.
func FilterIn ¶
func FilterIn(values ...string) *SimpleFilter
FilterIn returns filter, which checks if value is in specified list.
func FilterLE ¶
func FilterLE(v int64) *SimpleFilter
FilterLE returns filter, which checks if value is less or equal than v.
func FilterLT ¶
func FilterLT(v int64) *SimpleFilter
FilterLT returns filter, which checks if value is less than v.
func FilterNE ¶
func FilterNE(v string) *SimpleFilter
FilterNE returns filter, which checks if value is not equal to v.
func FilterNotIn ¶
func FilterNotIn(values ...string) *SimpleFilter
FilterNotIn returns filter, which checks if value is not in specified list.
func FilterOR ¶
func FilterOR(fs ...*SimpleFilter) *SimpleFilter
FilterOR returns OR combination of filters.
func NewFilter ¶
func NewFilter(op Operation, value string) *SimpleFilter
NewFilter constructs SimpleFilter.
func (SimpleFilter) Check ¶
func (sf SimpleFilter) Check(value string) bool
Check returns result of applying sf to value. For numeric comparisons, value is parsed to int64.
func (*SimpleFilter) Descriptor ¶
func (*SimpleFilter) Descriptor() ([]byte, []int)
func (*SimpleFilter) GetArgs ¶
func (m *SimpleFilter) GetArgs() isSimpleFilter_Args
func (*SimpleFilter) GetFArgs ¶
func (m *SimpleFilter) GetFArgs() *SimpleFilters
func (*SimpleFilter) GetOp ¶
func (m *SimpleFilter) GetOp() Operation
func (*SimpleFilter) GetValue ¶
func (m *SimpleFilter) GetValue() string
func (*SimpleFilter) Marshal ¶
func (m *SimpleFilter) Marshal() (dAtA []byte, err error)
func (*SimpleFilter) ProtoMessage ¶
func (*SimpleFilter) ProtoMessage()
func (*SimpleFilter) Reset ¶
func (m *SimpleFilter) Reset()
func (*SimpleFilter) Size ¶
func (m *SimpleFilter) Size() (n int)
func (*SimpleFilter) String ¶
func (m *SimpleFilter) String() string
func (*SimpleFilter) Unmarshal ¶
func (m *SimpleFilter) Unmarshal(dAtA []byte) error
func (*SimpleFilter) XXX_DiscardUnknown ¶
func (m *SimpleFilter) XXX_DiscardUnknown()
func (*SimpleFilter) XXX_Marshal ¶
func (m *SimpleFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SimpleFilter) XXX_Merge ¶
func (m *SimpleFilter) XXX_Merge(src proto.Message)
func (*SimpleFilter) XXX_OneofFuncs ¶
func (*SimpleFilter) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (*SimpleFilter) XXX_Size ¶
func (m *SimpleFilter) XXX_Size() int
func (*SimpleFilter) XXX_Unmarshal ¶
func (m *SimpleFilter) XXX_Unmarshal(b []byte) error
type SimpleFilter_FArgs ¶
type SimpleFilter_FArgs struct {
FArgs *SimpleFilters `protobuf:"bytes,3,opt,name=FArgs,proto3,oneof"`
}
func (*SimpleFilter_FArgs) MarshalTo ¶
func (m *SimpleFilter_FArgs) MarshalTo(dAtA []byte) (int, error)
func (*SimpleFilter_FArgs) Size ¶
func (m *SimpleFilter_FArgs) Size() (n int)
type SimpleFilter_Value ¶
type SimpleFilter_Value struct {
Value string `protobuf:"bytes,2,opt,name=Value,proto3,oneof"`
}
func (*SimpleFilter_Value) MarshalTo ¶
func (m *SimpleFilter_Value) MarshalTo(dAtA []byte) (int, error)
func (*SimpleFilter_Value) Size ¶
func (m *SimpleFilter_Value) Size() (n int)
type SimpleFilters ¶
type SimpleFilters struct {
Filters []*SimpleFilter `protobuf:"bytes,1,rep,name=Filters,proto3" json:"Filters,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*SimpleFilters) Descriptor ¶
func (*SimpleFilters) Descriptor() ([]byte, []int)
func (*SimpleFilters) GetFilters ¶
func (m *SimpleFilters) GetFilters() []*SimpleFilter
func (*SimpleFilters) Marshal ¶
func (m *SimpleFilters) Marshal() (dAtA []byte, err error)
func (*SimpleFilters) ProtoMessage ¶
func (*SimpleFilters) ProtoMessage()
func (*SimpleFilters) Reset ¶
func (m *SimpleFilters) Reset()
func (*SimpleFilters) Size ¶
func (m *SimpleFilters) Size() (n int)
func (*SimpleFilters) String ¶
func (m *SimpleFilters) String() string
func (*SimpleFilters) Unmarshal ¶
func (m *SimpleFilters) Unmarshal(dAtA []byte) error
func (*SimpleFilters) XXX_DiscardUnknown ¶
func (m *SimpleFilters) XXX_DiscardUnknown()
func (*SimpleFilters) XXX_Marshal ¶
func (m *SimpleFilters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SimpleFilters) XXX_Merge ¶
func (m *SimpleFilters) XXX_Merge(src proto.Message)
func (*SimpleFilters) XXX_Size ¶
func (m *SimpleFilters) XXX_Size() int
func (*SimpleFilters) XXX_Unmarshal ¶
func (m *SimpleFilters) XXX_Unmarshal(b []byte) error