github.com/jingcheng-WU/gonum@v0.9.1-0.20210323123734-f1a2a11a8f7b/graph/encoding/encoding.go (about)

     1  // Copyright ©2017 The Gonum Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package encoding
     6  
     7  import "github.com/jingcheng-WU/gonum/graph"
     8  
     9  // Builder is a graph that can have user-defined nodes and edges added.
    10  type Builder interface {
    11  	graph.Graph
    12  	graph.Builder
    13  }
    14  
    15  // MultiBuilder is a graph that can have user-defined nodes and edges added.
    16  type MultiBuilder interface {
    17  	graph.Multigraph
    18  	graph.MultigraphBuilder
    19  }
    20  
    21  // AttributeSetter is implemented by types that can set an encoded graph
    22  // attribute.
    23  type AttributeSetter interface {
    24  	SetAttribute(Attribute) error
    25  }
    26  
    27  // Attributer defines graph.Node or graph.Edge values that can
    28  // specify graph attributes.
    29  type Attributer interface {
    30  	Attributes() []Attribute
    31  }
    32  
    33  // Attribute is an encoded key value attribute pair use in graph encoding.
    34  type Attribute struct {
    35  	Key, Value string
    36  }