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

Method Latest

service/universally/commit/iml.go:96–106  ·  view source on GitHub ↗
(ctx context.Context, target string, key string)

Source from the content-addressed store, hash-verified

94}
95
96func (i *imlCommitService[T]) Latest(ctx context.Context, target string, key string) (*Commit[T], error) {
97 list, err := i.store.Latest(ctx, key, target)
98 if err != nil {
99 return nil, err
100 }
101 if len(list) == 0 {
102 return nil, gorm.ErrRecordNotFound
103 }
104 result := list[0]
105 return newCommit(result), nil
106}
107
108func (i *imlCommitService[T]) Save(ctx context.Context, target string, key string, data *T) error {
109 return i.store.Save(ctx, key, target, data)

Callers

nothing calls this directly

Calls 2

newCommitFunction · 0.85
LatestMethod · 0.65

Tested by

no test coverage detected