Documentation ¶
Index ¶
- func Discover(ctx context.Context, op optypes.Operator, modelClient model.ClientSet, ...) ([]*model.ServiceResource, error)
- func GetGraphVertexType(m *model.ServiceResource) string
- func GetVerticesAndEdges(entities model.ServiceResources, vertices []types.GraphVertex, ...) ([]types.GraphVertex, []types.GraphEdge)
- func Label(ctx context.Context, op optypes.Operator, candidates []*model.ServiceResource) error
- func SetKeys(ctx context.Context, logger log.Logger, modelClient model.ClientSet, ...)
- type StateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Discover ¶ added in v0.3.1
func Discover( ctx context.Context, op optypes.Operator, modelClient model.ClientSet, candidates []*model.ServiceResource, ) ([]*model.ServiceResource, error)
Discover discovers the components of the given model.ServiceResource with by the given operator.Operator, and returns all the discovered model.ServiceResource items.
The given model.ServiceResource item must be instance shape and managed mode.
The given model.ServiceResource item must specify the following fields: Shape, Mode, ID, DeployerType, Type, Name, ProjectID, EnvironmentID, ServiceID and ConnectorID.
func GetGraphVertexType ¶
func GetGraphVertexType(m *model.ServiceResource) string
func GetVerticesAndEdges ¶
func GetVerticesAndEdges( entities model.ServiceResources, vertices []types.GraphVertex, edges []types.GraphEdge, ) ([]types.GraphVertex, []types.GraphEdge)
GetVerticesAndEdges constructs a graph of the given model.ServiceResource entities with DFS algorithm, and appends the vertices and edges to the given slices.
func Label ¶
Label labels the given model.ServiceResource list with the given operator.Operator.
The given model.ServiceResource item must be instance shape and managed mode.
The given model.ServiceResource item must specify the following fields: Shape, Mode, ID, DeployerType, Type and Name, and the following edges: Project, Environment and Service.
func SetKeys ¶
func SetKeys( ctx context.Context, logger log.Logger, modelClient model.ClientSet, candidates []*model.ServiceResource, operators map[object.ID]optypes.Operator, )
SetKeys sets the keys of the resources for operations like log and exec.
The given model.ServiceResource item must specify the following fields: Shape, Mode, ID, DeployerType, Type, Name and ConnectorID.
Types ¶
type StateResult ¶
func State ¶
func State( ctx context.Context, op optypes.Operator, modelClient model.ClientSet, candidates []*model.ServiceResource, ) (StateResult, error)
State gets status of the given model.ServiceResource list with the given operator.Operator, and represents is ready if both `Error` and `Transitioning` of StateResult are false.
The given model.ServiceResource item must be instance shape and not data mode.
The given model.ServiceResource item must specify the following fields: Shape, Mode, Status, ID, DeployerType, Type and Name.
func (*StateResult) Merge ¶
func (r *StateResult) Merge(s StateResult)