MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / Check

Method Check

service/service/iml.go:127–142  ·  view source on GitHub ↗
(ctx context.Context, id string, rule map[string]bool)

Source from the content-addressed store, hash-verified

125}
126
127func (i *imlServiceService) Check(ctx context.Context, id string, rule map[string]bool) (*Service, error) {
128 pro, err := i.Get(ctx, id)
129 if err != nil {
130 return nil, err
131 }
132 if rule == nil || len(rule) == 0 {
133 return pro, nil
134 }
135 if rule["as_server"] && !pro.AsServer {
136 return nil, fmt.Errorf("project %s is not as server", id)
137 }
138 if rule["as_app"] && !pro.AsApp {
139 return nil, fmt.Errorf("project %s is not as app", id)
140 }
141 return pro, nil
142}
143
144func (i *imlServiceService) GetLabels(ctx context.Context, ids ...string) map[string]string {
145 if len(ids) == 0 {

Callers

nothing calls this directly

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected