Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlerFindAllActive ¶
func HandlerFindAllActive(repository Repository) gin.HandlerFunc
HandlerFindAllActive returns a resource list
Types ¶
type Edge ¶
type Edge struct {
ID string `json:"id"`
From string `json:"from"`
To string `json:"to"`
Type string `json:"type"`
Properties interface{} `json:"properties"`
}
Edge define a edge resource
type Graph ¶
Graph define a graph resource
type ImplementEdge ¶
type ImplementEdge interface {
GetID() string
GetFrom() string
GetTo() string
GetType() string
GetProperties() interface{}
}
ImplementEdge defines and identifiable node entity
type ImplementNode ¶
type ImplementNode interface {
GetID() string
GetName() string
GetType() string
GetEdges() []ImplementEdge
}
ImplementNode define an entity which can have dependencies
func Convert ¶
func Convert(repo Repository, entities []interface{}) []ImplementNode
Convert to dependencies node behaviour
type ImplementsGraph ¶
type ImplementsGraph interface {
}
ImplementsGraph defines and identifiable node entity
type Node ¶
type Node struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
Properties interface{} `json:"properties"`
}
Node define a node resource
type Repository ¶
type Repository interface {
FindAll() (*Graph, error)
FindAllActive(map[string]interface{}) (*Graph, error)
GetType() reflect.Type
// Map api entity to graph entity
Map(entity interface{}, others map[string]ImplementNode) ImplementNode
// Resolve entity dependencies
Resolve(entity interface{}, mappers map[string]ImplementNode)
}
Repository defines a normal repository
Source Files
¶
- graph.go
- type.go
Click to show internal directories.
Click to hide internal directories.