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

Method Get

service/service-model-mapping/iml.go:27–39  ·  view source on GitHub ↗
(ctx context.Context, sid string)

Source from the content-addressed store, hash-verified

25}
26
27func (i *imlServiceModelMappingService) Get(ctx context.Context, sid string) (*ModelMapping, error) {
28 entity, err := i.store.First(ctx, map[string]interface{}{"sid": sid})
29 if err != nil {
30 if errors.Is(err, gorm.ErrRecordNotFound) {
31 return &ModelMapping{
32 Sid: sid,
33 Content: "",
34 }, nil
35 }
36 return nil, err
37 }
38 return FromEntity(entity), nil
39}
40
41func FromEntity(e *service.ModelMapping) *ModelMapping {
42 content := ""

Callers

nothing calls this directly

Calls 1

FromEntityFunction · 0.70

Tested by

no test coverage detected