MCPcopy
hub / github.com/apache/devlake / GetBlueprints

Function GetBlueprints

backend/server/services/blueprint.go:76–98  ·  view source on GitHub ↗

GetBlueprints returns a paginated list of Blueprints based on `query`

(query *BlueprintQuery, shouldSanitize bool)

Source from the content-addressed store, hash-verified

74
75// GetBlueprints returns a paginated list of Blueprints based on `query`
76func GetBlueprints(query *BlueprintQuery, shouldSanitize bool) ([]*models.Blueprint, int64, errors.Error) {
77 blueprints, count, err := bpManager.GetDbBlueprints(&services.GetBlueprintQuery{
78 Enable: query.Enable,
79 IsManual: query.IsManual,
80 Label: query.Label,
81 SkipRecords: query.GetSkip(),
82 PageSize: query.GetPageSize(),
83 Type: query.Type,
84 })
85 if err != nil {
86 return nil, 0, err
87 }
88 if shouldSanitize {
89 for idx, bp := range blueprints {
90 if err := SanitizeBlueprint(bp); err != nil {
91 return nil, 0, errors.Convert(err)
92 } else {
93 blueprints[idx] = bp
94 }
95 }
96 }
97 return blueprints, count, nil
98}
99
100// GetBlueprint returns the detail of a given Blueprint ID
101func GetBlueprint(blueprintId uint64, shouldSanitize bool) (*models.Blueprint, errors.Error) {

Callers

nothing calls this directly

Calls 5

SanitizeBlueprintFunction · 0.85
GetDbBlueprintsMethod · 0.80
GetSkipMethod · 0.80
GetPageSizeMethod · 0.80
ConvertMethod · 0.45

Tested by

no test coverage detected