Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler implements topology operations
func NewHandler ¶
func NewHandler(repo Repository) *Handler
NewHandler returns a new topology Handler
type Repository ¶
type Repository interface { // FindAll returns all the topology objects from storage FindAll() ([]Topology, error) // Store stores a new topology object Store(t Topology) error // Update updates a topology Update(t Topology) error // DeleteAll deletes all the stored objects DeleteAll() error // Count counts the topology objects stored Count() (int64, error) }
Repository defines the methods to be implemented by the storage layer.
func NewRepository ¶
func NewRepository(c *mongo.Client) Repository
NewRepository returns a new mongo Repository
type Topology ¶
type Topology struct { ID primitive.ObjectID `json:"id" bson:"_id"` Hosts []string `json:"hosts" bson:"hosts"` Switches []string `json:"switches" bson:"switches"` Links []string `json:"links" bson:"links"` DOT string `json:"dot" bson:"dot"` DOTImg string `json:"dot_img" bson:"dot_img"` }
Topology represents a data-plane topology
Click to show internal directories.
Click to hide internal directories.