Documentation ¶
Index ¶
- func ConvertMapInterfaceMapString(v interface{}) interface{}
- func RecursiveCastMapStringInterfaceToMapStringInterface(in map[string]interface{}) map[string]interface{}
- func RegisterMesheryOAMTraits() error
- func RegisterMesheryOAMWorkloads() error
- func RegisterScope(data []byte) (err error)
- func RegisterTrait(data []byte) (err error)
- func RegisterWorkload(data []byte) (err error)
- type Graph
- type Node
- type ParallelProcessGraph
- type ParallelProcessGraphNode
- type Pattern
- func (p *Pattern) GenerateApplicationConfiguration() (v1alpha1.Configuration, error)
- func (p *Pattern) GetApplicationComponent(name string) (v1alpha1.Component, error)
- func (p *Pattern) GetServiceType(name string) string
- func (p *Pattern) ToCytoscapeJS() (cytoscapejs.GraphElem, error)
- func (p *Pattern) ToYAML() ([]byte, error)
- type Plan
- type Queue
- type ScopeCapability
- type Service
- type TraitCapability
- type VisitFn
- type WorkloadCapability
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertMapInterfaceMapString ¶
func ConvertMapInterfaceMapString(v interface{}) interface{}
ConvertMapInterfaceMapString converts map[interface{}]interface{} => map[string]interface{}
It will also convert []interface{} => []string
func RecursiveCastMapStringInterfaceToMapStringInterface ¶
func RecursiveCastMapStringInterfaceToMapStringInterface(in map[string]interface{}) map[string]interface{}
RecursiveCastMapStringInterfaceToMapStringInterface will convert a map[string]interface{} recursively => map[string]interface{}
func RegisterMesheryOAMTraits ¶
func RegisterMesheryOAMTraits() error
RegisterMesheryOAMTraits will register local meshery traits with meshery server
func RegisterMesheryOAMWorkloads ¶
func RegisterMesheryOAMWorkloads() error
RegisterMesheryOAMWorkloads will register local meshery workloads with meshery server
func RegisterScope ¶
RegisterScope will register a Scope definition into the database
func RegisterTrait ¶
RegisterTrait will register a TraitDefinition into the database
func RegisterWorkload ¶
RegisterWorkload will register a workload definition into the database
Types ¶
type Graph ¶
Graph represents the graph data structure
func NewGraph ¶
func NewGraph() *Graph
NewGraph creates a new instance of the graph and returns a pointer to it
func (*Graph) AddEdge ¶
AddEdge adds edge from source to destination nodes
These edges are unidirectional, hence for bidirectional edges this method needs to be called twice
func (*Graph) DetectCycle ¶
DetectCycle will return true if there is a cycle in the graph
type ParallelProcessGraph ¶
type ParallelProcessGraph struct { Edges map[string][]string ParallelProcessGraphNodeMap map[string]*ParallelProcessGraphNode // contains filtered or unexported fields }
ParallelProcessGraph provides methods for parallel processing of the graph
func NewParallelProcessGraph ¶
func NewParallelProcessGraph(g *Graph) *ParallelProcessGraph
NewParallelProcessGraph creates a parallel processing graph from a simple graph returns a pointer to ParallelProcessGraph
func (*ParallelProcessGraph) Traverse ¶
func (g *ParallelProcessGraph) Traverse(fn VisitFn)
Traverse spins up the processes concurrently if it can
type ParallelProcessGraphNode ¶
type ParallelProcessGraphNode struct { Name string Data *Node DepUpdateCh chan struct{} DepCancleCh chan struct{} DepCount int // contains filtered or unexported fields }
ParallelProcessGraphNode is the node for ParallelProcessGraph it contains the constructs for channel based communication
func (*ParallelProcessGraphNode) Process ¶
func (v *ParallelProcessGraphNode) Process(deps []*ParallelProcessGraphNode, wg *sync.WaitGroup, fn VisitFn)
Process starts an internal loop which listens for the signals on the channels and operate accordingly
type Pattern ¶
type Pattern struct { Name string `yaml:"name,omitempty"` Services map[string]*Service `yaml:"services,omitempty"` }
Pattern is the golang representation of the Pattern config file model
func NewPatternFile ¶
NewPatternFile takes in raw yaml and encodes it into a construct
func NewPatternFileFromCytoscapeJSJSON ¶
NewPatternFileFromCytoscapeJSJSON takes in CytoscapeJS JSON and creates a PatternFile from it
func (*Pattern) GenerateApplicationConfiguration ¶
func (p *Pattern) GenerateApplicationConfiguration() (v1alpha1.Configuration, error)
GenerateApplicationConfiguration generates OAM Application Configuration from the the given Pattern file for a particular deploymnet
func (*Pattern) GetApplicationComponent ¶
GetApplicationComponent generates OAM Application Components from the the given Pattern file
func (*Pattern) GetServiceType ¶
GetServiceType returns the type of the service
func (*Pattern) ToCytoscapeJS ¶
func (p *Pattern) ToCytoscapeJS() (cytoscapejs.GraphElem, error)
ToCytoscapeJS converts pattern file into cytoscape object
type Plan ¶
Plan struct represents a node of an execution plan
func CreatePlan ¶
CreatePlan takes in the application components and creates a plan of execution for it
func (*Plan) Execute ¶
Execute traverses the plan and calls the callback function on each of the node
func (*Plan) IsFeasible ¶
IsFeasible returns true if the plan execution is feasible
type ScopeCapability ¶
type ScopeCapability struct { OAMDefinition v1alpha1.ScopeDefinition `json:"oam_definition,omitempty"` // contains filtered or unexported fields }
ScopeCapability is the struct for capturing the ScopeDefinition of a particular type
type Service ¶
type Service struct { Type string `yaml:"type,omitempty"` Namespace string `yaml:"namespace,omitempty"` DependsOn []string `yaml:"dependsOn,omitempty"` Settings map[string]interface{} `yaml:"settings,omitempty"` Traits map[string]interface{} `yaml:"traits,omitempty"` }
Service represents the services defined within the appfile
type TraitCapability ¶
type TraitCapability struct { OAMDefinition v1alpha1.TraitDefinition `json:"oam_definition,omitempty"` // contains filtered or unexported fields }
TraitCapability is the struct for capturing the workload definition of a particular type
func ValidateTrait ¶
func ValidateTrait( trait interface{}, configSpecComp v1alpha1.ConfigurationSpecComponent, af Pattern, ) (*TraitCapability, error)
ValidateTrait takes in a trait and a component and checks if the given trait is legal on that component or not. The function ASSUMES that if this function is called with a trait and corresponding component then the trait DOES EXIST in the ApplicationConfiguration
After checking if the applied trait is legal or not it will validate the schema of the trait
type WorkloadCapability ¶
type WorkloadCapability struct { OAMDefinition v1alpha1.WorkloadDefinition `json:"oam_definition,omitempty"` // contains filtered or unexported fields }
WorkloadCapability is the struct for capturing the workload definition of a particular type
func GetWorkloads ¶
func GetWorkloads() (caps []WorkloadCapability)
GetWorkloads return all of the workloads
func ValidateWorkload ¶
func ValidateWorkload(workload interface{}, component v1alpha1.Component) (*WorkloadCapability, error)
ValidateWorkload takes in a workload and validates it against the corresponding schema