Documentation
¶
Index ¶
- func GetGraphVertexType(m *model.ServiceResource) string
- func GetVerticesAndEdges(entities model.ServiceResources, vertices []types.GraphVertex, ...) ([]types.GraphVertex, []types.GraphEdge)
- func IsOperable(m *model.ServiceResource) bool
- func Label(ctx context.Context, op optypes.Operator, candidates []*model.ServiceResource) (berr error)
- func ListCandidatesByIDs(ctx context.Context, modelClient model.ClientSet, ids []object.ID) ([]*model.ServiceResource, error)
- func ListCandidatesPageByConnector(ctx context.Context, modelClient model.ClientSet, connectorID object.ID, ...) ([]*model.ServiceResource, error)
- func SetKeys(ctx context.Context, entities model.ServiceResources, ...) model.ServiceResources
- type StateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 IsOperable ¶
func IsOperable(m *model.ServiceResource) bool
func Label ¶
func Label(ctx context.Context, op optypes.Operator, candidates []*model.ServiceResource) (berr error)
Label applies the labels to the given model.ServiceResource list with the given operator.Operator.
func ListCandidatesByIDs ¶
func ListCandidatesByIDs( ctx context.Context, modelClient model.ClientSet, ids []object.ID, ) ([]*model.ServiceResource, error)
ListCandidatesByIDs gets the candidates for Label or State by id list.
func ListCandidatesPageByConnector ¶
func ListCandidatesPageByConnector( ctx context.Context, modelClient model.ClientSet, connectorID object.ID, offset, limit int, ) ([]*model.ServiceResource, error)
ListCandidatesPageByConnector gets the candidates for Label or State by connector id in pagination.
Types ¶
type StateResult ¶
func State ¶
func State( ctx context.Context, op optypes.Operator, modelClient model.ClientSet, candidates []*model.ServiceResource, ) (sr StateResult, berr 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.
func (*StateResult) Merge ¶
func (r *StateResult) Merge(s StateResult)
Click to show internal directories.
Click to hide internal directories.