Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func (*Context) FormatValue ¶
func (*Context) GetDefaultValue ¶
type Dependency ¶
type Dependency struct { // gorm.Model NodeTemplateID int //`gorm:"index"` //Foreign key of the node template Type string `json:"type"` //The type of dependency: connect;contained Target string `json:"target"` //The name of target node }
Dependency is relationship between two node
type Link ¶
type Link struct { gorm.Model NodeID int `gorm:"index"` //Foreign key of the node Type string //link type Source string //source node name Target string //target node name }
Link two nodes
type Node ¶
type Node struct { gorm.Model Status TopologyID int `gorm:"index"` //Foreign key of the topology Name string //node name Template string //template name Class string //the name of resource class Address string //address of node. Credential string //credential key Links []*Link //dependencies of node Properties []*Property //the configuration of a node Done chan error `gorm:"-" json:"-"` Timeout chan bool `gorm:"-" json:"-"` }
Node is element of topology
func (*Node) FindLinksByType ¶
findLinksByType return all links of depType
type NodeTemplate ¶
type NodeTemplate struct { Name string `json:"name"` //Node name Type string `json:"type"` //The name of NodeType Parameters []Parameter `json:parameters` //parameters of NodeTemplate Dependencies []Dependency `json:"dependencies"` //The dependencies of node }
NodeTemplate is a prototype of service node.
type Parameter ¶
type Parameter struct { // gorm.Model NodeTemplateID int //`gorm:"index"` //Foreign key of the node template Name string `json:"name"` Value string `json:"value"` }
Parameter is used to generate the node of template
type Property ¶
type Property struct { gorm.Model NodeID int `gorm:"index"` //Foreign key of the node Key string Value string }
Link two nodes
type ServiceTemplate ¶
type ServiceTemplate struct { Path string Name string `json:"name"` Version int32 `json:"version"` Environment string `json:"environment"` //standalone|distributed Inputs []Input `json:"inputs"` Nodes []NodeTemplate `json:"nodes"` }
ServiceTemplate is a prototype of service.
func (*ServiceTemplate) FindTemplate ¶
func (p *ServiceTemplate) FindTemplate(name string) *NodeTemplate
FindNode return the node
func (*ServiceTemplate) NewTopology ¶
func (p *ServiceTemplate) NewTopology(name string, version int, ctx *Context) *Topology
CreateTopology create a topology by the service template.
type Topology ¶
type Topology struct { gorm.Model Status Name string `json:"name"` //topology name Template string `json:"template"` //service template name Version int `json:"version"` //service template version Nodes []*Node `json:"nodes"` }
Topology which has been deployed by the service template
Click to show internal directories.
Click to hide internal directories.