netmap

package module
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: GPL-3.0 Imports: 17 Imported by: 4

README

NetMap

Build Status codecov Report GitHub release

Demo

asciicast

select 1 Country, filter Location NE Asia Example 1

select 2 City, filter Location EQ Europe Example 2

Description

This is REPL for interacting with netmap in NEOFS and applying placement rules to it. Netmap and CRUSH enchacement with FILTERs is described in research plan.

Commands

To see help for specific command type command help.

help

help

Get a list of commands.

exit

exit

Exit program.

load

load <filename>

Load netmap from specified file.

save

save <filename>

Save netmap to specified file.

clear

clear

Clear current netmap.

select

select <number> <key>

Example:

>>> add 1 /Location:Europe/Country:Germany
>>> add 2 /Location:Europe/Country:Austria
>>> add 3 /Location:Asia/Country:Korea
>>> add 4 /Location:Asia/Country:Japan
>>> select 1 Location
>>> select 2 Country
filter

filter <key> <operation> <value>

Operation can be one of EQ, NE, LT, LE, GT, GE

Example:

>>> add 1 /Location:Europe/Country:Germany
>>> add 2 /Location:Europe/Country:Austria
>>> filter Country NE Austria
get-selection

get-selection

Get nodes from current selection.

Example:

>>> load /examples/map2
>>> select 1 Country
>>> filter Location NE Asia
>>> get-selection
[13 14]
clear-selection

clear-selection

Clear current selection.

dump-selection

dump-selection <filename>

Dump netmap in graphical format. If using docker, /pics directory is mounted as temp on host.

Documentation

Index

Constants

View Source
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

View Source
var (
	ErrInvalidLengthSelector = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSelector   = fmt.Errorf("proto: integer overflow")
)
View Source
var Operation_name = map[int32]string{
	0: "NP",
	1: "EQ",
	2: "NE",
	3: "GT",
	4: "GE",
	5: "LT",
	6: "LE",
	7: "OR",
	8: "AND",
}
View Source
var Operation_value = map[string]int32{
	"NP":  0,
	"EQ":  1,
	"NE":  2,
	"GT":  3,
	"GE":  4,
	"LT":  5,
	"LE":  6,
	"OR":  7,
	"AND": 8,
}
View Source
var Type_name = map[int32]string{
	0: "String",
	1: "Integer",
}
View Source
var Type_value = map[string]int32{
	"String":  0,
	"Integer": 1,
}

Functions

func CapWeightFunc added in v1.5.2

func CapWeightFunc(n Node) float64

CapWeightFunc calculates weight which is equal to capacity.

func PriceWeightFunc added in v1.6.0

func PriceWeightFunc(n Node) float64

PriceWeightFunc calculates weight which is equal to price.

Types

type Aggregator added in v1.5.2

type Aggregator interface {
	Add(float64)
	Compute() float64
	Clear()
}

Aggregator can calculate some value across all netmap such as median, minimum or maximum.

func NewMaxAgg added in v1.6.1

func NewMaxAgg() Aggregator

NewMaxAgg returns an aggregator which computes max value.

func NewMeanAgg added in v1.6.0

func NewMeanAgg() Aggregator

NewMeanAgg returns an aggregator which computes mean value by recalculating it on every addition.

func NewMeanIQRAgg added in v1.6.0

func NewMeanIQRAgg() Aggregator

NewMeanIQRAgg returns an aggregator which computes mean value of values from IQR interval.

func NewMeanSumAgg added in v1.6.0

func NewMeanSumAgg() Aggregator

NewMeanSumAgg returns an aggregator which computes mean value by keeping total sum.

func NewMinAgg added in v1.6.0

func NewMinAgg() Aggregator

NewMinAgg returns an aggregator which computes min value.

type AggregatorFactory added in v1.6.0

type AggregatorFactory struct {
	New func() Aggregator
}

AggregatorFactory is a Factory for a specific Aggregator

type Bucket

type Bucket struct {
	Key   string
	Value string
	// contains filtered or unexported fields
}

Bucket represents netmap as graph.

func (*Bucket) AddBucket

func (b *Bucket) AddBucket(o string, n Nodes) error

AddBucket add bucket corresponding to option o with nodes n as subbucket to b.

func (*Bucket) AddChild

func (b *Bucket) AddChild(c Bucket)

AddChild adds c as direct child to b.

func (*Bucket) AddNode

func (b *Bucket) AddNode(n uint32, opts ...string) error

AddNode adds node n with options opts to b.

func (*Bucket) AddStrawNode added in v1.5.0

func (b *Bucket) AddStrawNode(n Node, opts ...string) error

AddStrawNode adds straw node n with options opts to b. Straws are an analogy of weights in CRUSH algorithm paper.

func (Bucket) CheckConflicts

func (b Bucket) CheckConflicts(b1 Bucket) bool

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) Children

func (b Bucket) Children() []Bucket

Children returns array of subbuckets of b.

func (Bucket) Copy

func (b Bucket) Copy() (bc Bucket)

Copy returns deep copy of Bucket.

func (Bucket) Dump

func (b Bucket) Dump(name string) error

Dump dumps string representation of Bucket in *.dot format to file name.

func (Bucket) DumpWithSelection

func (b Bucket) DumpWithSelection(name string, b1 Bucket) error

DumpWithSelection dumps string representation of Bucket in *.dot format where subgraph b1 is highlighted to file name.

func (Bucket) Equals

func (b Bucket) Equals(b1 Bucket) bool

Equals checks if b and b1 represent the same Bucket (excluding contained nodes).

func (*Bucket) FindGraph

func (b *Bucket) FindGraph(pivot []byte, ss ...SFGroup) (c *Bucket)

FindGraph returns random subgraph, corresponding to specified placement rule.

func (*Bucket) FindNodes

func (b *Bucket) FindNodes(pivot []byte, ss ...SFGroup) (nodes Nodes)

FindNodes returns list of nodes, corresponding to specified placement rule.

func (Bucket) GetMaxSelection

func (b Bucket) GetMaxSelection(s SFGroup) (r *Bucket)

GetMaxSelection returns 'maximal container' -- subgraph which contains any other subgraph satisfying specified selects and filters.

func (Bucket) GetNodesByOption

func (b Bucket) GetNodesByOption(opts ...string) Nodes

GetNodesByOption returns list of nodes possessing specified options.

func (Bucket) GetSelection

func (b Bucket) GetSelection(ss []Select, pivot []byte) *Bucket

GetSelection returns subgraph, satisfying specified selections. It is assumed that all filters were already applied.

func (Bucket) Hash

func (b Bucket) Hash() uint64

Hash uses murmur3 hash to return uint64.

func (Bucket) IsValid

func (b Bucket) IsValid() bool

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

func (b Bucket) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (*Bucket) Merge

func (b *Bucket) Merge(b1 Bucket)

Merge merges b1 into b assuming there are no conflicts.

func (Bucket) Name

func (b Bucket) Name() string

Name return b's short string identifier.

func (Bucket) Nodelist

func (b Bucket) Nodelist() (r Nodes)

Nodelist returns slice of nodes belonging to b.

func (*Bucket) Read

func (b *Bucket) Read(r io.Reader) error

Read reads Bucket in serialized form: [lnName][Name][lnNodes][Node1]...[NodeN][lnSubprops][sub1]...[subN]

func (Bucket) Sdump

func (b Bucket) Sdump() (string, error)

Sdump returns string representation of Bucket in *.dot format.

func (Bucket) SdumpWithSelection

func (b Bucket) SdumpWithSelection(b1 Bucket) (string, error)

SdumpWithSelection returns string representation of Bucket in *.dot format where subgraph b1 is highlighted.

func (*Bucket) Traverse added in v1.5.2

func (b *Bucket) Traverse(a Aggregator, wf WeightFunc) Aggregator

Traverse adds all Bucket nodes to a and returns it's argument.

func (*Bucket) TraverseTree added in v1.6.0

func (b *Bucket) TraverseTree(af AggregatorFactory, wf WeightFunc)

TraverseTree computes weight for every Bucket and all of its children.

func (*Bucket) UnmarshalBinary

func (b *Bucket) UnmarshalBinary(data []byte) (err error)

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*Bucket) UpdateIndices

func (b *Bucket) UpdateIndices(tr map[uint32]Node) Bucket

UpdateIndices is auxiliary function used to update indices of all nodes according to tr.

func (Bucket) Write

func (b Bucket) Write(w io.Writer) error

Writes Bucket with this byte structure [lnName][Name][lnNodes][Node1]...[NodeN][lnSubprops][sub1]...[subN]

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) Check

func (f Filter) Check(b Bucket) bool

Check checks is Bucket satisfies filter f.

func (*Filter) Descriptor

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

func (Filter) Filter

func (f Filter) Filter(bs ...Bucket) []Bucket

Filter returns sublist of bs, satisfying f.

func (*Filter) GetF

func (m *Filter) GetF() *SimpleFilter

func (*Filter) GetKey

func (m *Filter) GetKey() string

func (*Filter) Marshal

func (m *Filter) Marshal() (dAtA []byte, err error)

func (*Filter) MarshalTo

func (m *Filter) MarshalTo(dAtA []byte) (int, error)

func (*Filter) MarshalToSizedBuffer added in v1.5.4

func (m *Filter) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Filter) ProtoMessage

func (*Filter) ProtoMessage()

func (*Filter) Reset

func (m *Filter) Reset()

func (*Filter) Size

func (m *Filter) Size() (n int)

func (*Filter) String

func (m *Filter) String() string

func (*Filter) Unmarshal

func (m *Filter) Unmarshal(dAtA []byte) error

func (*Filter) XXX_DiscardUnknown

func (m *Filter) XXX_DiscardUnknown()

func (*Filter) XXX_Marshal

func (m *Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Filter) XXX_Merge

func (m *Filter) XXX_Merge(src proto.Message)

func (*Filter) XXX_Size

func (m *Filter) XXX_Size() int

func (*Filter) XXX_Unmarshal

func (m *Filter) XXX_Unmarshal(b []byte) error

type FilterFunc

type FilterFunc func(Nodes) Nodes

FilterFunc is generic type for filtering function on nodes.

type Graph

type Graph = *gographviz.Graph

Graph is short synonym for convinience.

type Node added in v1.5.0

type Node struct {
	N uint32
	C uint64
	P uint64
}

Node type represents single graph leaf with index N, capacity C and price P.

func (Node) Hash added in v1.5.0

func (n Node) Hash() uint64

Hash is a function from hrw.Hasher interface. It is implemented to support weighted hrw therefore sort function sorts nodes based on their `N` value.

func (*Node) Read added in v1.5.0

func (n *Node) Read(r io.Reader) error

func (Node) Write added in v1.5.0

func (n Node) Write(w io.Writer) error

type Nodes added in v1.5.0

type Nodes []Node

Nodes represents slice of graph leafs.

func (Nodes) Len added in v1.5.0

func (n Nodes) Len() int

func (Nodes) Less added in v1.5.0

func (n Nodes) Less(i, j int) bool

func (Nodes) Nodes added in v1.5.0

func (n Nodes) Nodes() []uint32

Nodes returns slice of nodes indexes N.

func (*Nodes) Read added in v1.5.0

func (n *Nodes) Read(r io.Reader) error

func (Nodes) Swap added in v1.5.0

func (n Nodes) Swap(i, j int)

func (Nodes) Weights added in v1.5.0

func (n Nodes) Weights() []float64

Weights returns slice ow nodes weights W.

func (Nodes) Write added in v1.5.0

func (n Nodes) Write(w io.Writer) error

type Normalizer added in v1.5.2

type Normalizer interface {
	Normalize(w float64) float64
}

Normalizer normalizes weight.

func NewConstNorm added in v1.6.1

func NewConstNorm(value float64) Normalizer

NewConstNorm returns a normalizer which returns a constant values

func NewMaxNorm added in v1.6.1

func NewMaxNorm(max float64) Normalizer

NewMaxNorm returns a normalizer which normalize values in range of 0.0 to 1.0 to a maximum value.

func NewReverseMinNorm added in v1.6.1

func NewReverseMinNorm(min float64) Normalizer

NewReverseMinNorm returns a normalizer which normalize values in range of 0.0 to 1.0 to a minimum value.

func NewSigmoidNorm added in v1.6.1

func NewSigmoidNorm(scale float64) Normalizer

NewSigmoidNorm returns a normalizer which normalize values in range of 0.0 to 1.0 to a scaled sigmoid.

type Operation

type Operation int32
const (
	Operation_NP  Operation = 0
	Operation_EQ  Operation = 1
	Operation_NE  Operation = 2
	Operation_GT  Operation = 3
	Operation_GE  Operation = 4
	Operation_LT  Operation = 5
	Operation_LE  Operation = 6
	Operation_OR  Operation = 7
	Operation_AND Operation = 8
)

func (Operation) EnumDescriptor

func (Operation) EnumDescriptor() ([]byte, []int)

func (Operation) String

func (x Operation) String() string

type PlacementRule

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

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

func (*PlacementRule) GetReplFactor

func (m *PlacementRule) GetReplFactor() uint32

func (*PlacementRule) GetSFGroups

func (m *PlacementRule) GetSFGroups() []SFGroup

func (*PlacementRule) Marshal

func (m *PlacementRule) Marshal() (dAtA []byte, err error)

func (*PlacementRule) MarshalTo

func (m *PlacementRule) MarshalTo(dAtA []byte) (int, error)

func (*PlacementRule) MarshalToSizedBuffer added in v1.5.4

func (m *PlacementRule) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*PlacementRule) ProtoMessage

func (*PlacementRule) ProtoMessage()

func (*PlacementRule) Reset

func (m *PlacementRule) Reset()

func (*PlacementRule) Size

func (m *PlacementRule) Size() (n int)

func (*PlacementRule) String

func (m *PlacementRule) String() string

func (*PlacementRule) Unmarshal

func (m *PlacementRule) Unmarshal(dAtA []byte) error

func (*PlacementRule) XXX_DiscardUnknown

func (m *PlacementRule) XXX_DiscardUnknown()

func (*PlacementRule) XXX_Marshal

func (m *PlacementRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PlacementRule) XXX_Merge

func (m *PlacementRule) XXX_Merge(src proto.Message)

func (*PlacementRule) XXX_Size

func (m *PlacementRule) XXX_Size() int

func (*PlacementRule) XXX_Unmarshal

func (m *PlacementRule) XXX_Unmarshal(b []byte) error

type Policy

type Policy struct {
	Size       int64
	ReplFactor int
	NodeCount  int
}

Policy specifies parameters for storage selection.

type SFGroup

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"`
	Exclude              []uint32 `protobuf:"varint,3,rep,packed,name=Exclude,proto3" json:"Exclude,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*SFGroup) Descriptor

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

func (*SFGroup) GetExclude added in v1.4.0

func (m *SFGroup) GetExclude() []uint32

func (*SFGroup) GetFilters

func (m *SFGroup) GetFilters() []Filter

func (*SFGroup) GetSelectors

func (m *SFGroup) GetSelectors() []Select

func (*SFGroup) Marshal

func (m *SFGroup) Marshal() (dAtA []byte, err error)

func (*SFGroup) MarshalTo

func (m *SFGroup) MarshalTo(dAtA []byte) (int, error)

func (*SFGroup) MarshalToSizedBuffer added in v1.5.4

func (m *SFGroup) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SFGroup) ProtoMessage

func (*SFGroup) ProtoMessage()

func (*SFGroup) Reset

func (m *SFGroup) Reset()

func (*SFGroup) Size

func (m *SFGroup) Size() (n int)

func (*SFGroup) String

func (m *SFGroup) String() string

func (*SFGroup) Unmarshal

func (m *SFGroup) Unmarshal(dAtA []byte) error

func (*SFGroup) XXX_DiscardUnknown

func (m *SFGroup) XXX_DiscardUnknown()

func (*SFGroup) XXX_Marshal

func (m *SFGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SFGroup) XXX_Merge

func (m *SFGroup) XXX_Merge(src proto.Message)

func (*SFGroup) XXX_Size

func (m *SFGroup) XXX_Size() int

func (*SFGroup) XXX_Unmarshal

func (m *SFGroup) XXX_Unmarshal(b []byte) error

type Select

type Select struct {
	Count                uint32   `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) Descriptor() ([]byte, []int)

func (*Select) GetCount

func (m *Select) GetCount() uint32

func (*Select) GetKey

func (m *Select) GetKey() string

func (*Select) Marshal

func (m *Select) Marshal() (dAtA []byte, err error)

func (*Select) MarshalTo

func (m *Select) MarshalTo(dAtA []byte) (int, error)

func (*Select) MarshalToSizedBuffer added in v1.5.4

func (m *Select) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Select) ProtoMessage

func (*Select) ProtoMessage()

func (*Select) Reset

func (m *Select) Reset()

func (*Select) Size

func (m *Select) Size() (n int)

func (*Select) String

func (m *Select) String() string

func (*Select) Unmarshal

func (m *Select) Unmarshal(dAtA []byte) error

func (*Select) XXX_DiscardUnknown

func (m *Select) XXX_DiscardUnknown()

func (*Select) XXX_Marshal

func (m *Select) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Select) XXX_Merge

func (m *Select) XXX_Merge(src proto.Message)

func (*Select) XXX_Size

func (m *Select) XXX_Size() int

func (*Select) XXX_Unmarshal

func (m *Select) XXX_Unmarshal(b []byte) error

type SimpleFilter

type SimpleFilter struct {
	Op Operation `protobuf:"varint,1,opt,name=Op,proto3,enum=netmap.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) MarshalTo

func (m *SimpleFilter) MarshalTo(dAtA []byte) (int, error)

func (*SimpleFilter) MarshalToSizedBuffer added in v1.5.4

func (m *SimpleFilter) MarshalToSizedBuffer(dAtA []byte) (int, 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_OneofWrappers added in v1.5.4

func (*SimpleFilter) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers 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" json:"FArgs,omitempty"`
}

func (*SimpleFilter_FArgs) MarshalTo

func (m *SimpleFilter_FArgs) MarshalTo(dAtA []byte) (int, error)

func (*SimpleFilter_FArgs) MarshalToSizedBuffer added in v1.5.4

func (m *SimpleFilter_FArgs) MarshalToSizedBuffer(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" json:"Value,omitempty"`
}

func (*SimpleFilter_Value) MarshalTo

func (m *SimpleFilter_Value) MarshalTo(dAtA []byte) (int, error)

func (*SimpleFilter_Value) MarshalToSizedBuffer added in v1.5.4

func (m *SimpleFilter_Value) MarshalToSizedBuffer(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"`
	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) MarshalTo

func (m *SimpleFilters) MarshalTo(dAtA []byte) (int, error)

func (*SimpleFilters) MarshalToSizedBuffer added in v1.5.4

func (m *SimpleFilters) MarshalToSizedBuffer(dAtA []byte) (int, 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

type Type

type Type int32
const (
	Type_String  Type = 0
	Type_Integer Type = 1
)

func (Type) EnumDescriptor

func (Type) EnumDescriptor() ([]byte, []int)

func (Type) String

func (x Type) String() string

type WeightFunc added in v1.5.2

type WeightFunc = func(n Node) float64

WeightFunc calculates n's weight.

func NewWeightFunc added in v1.5.2

func NewWeightFunc(capNorm, priceNorm Normalizer) WeightFunc

NewWeightFunc returns WeightFunc which multiplies normalized capacity and price. TODO generic solution for arbitrary number of weights

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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