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

Method List

stores/universally/commit/store.go:35–52  ·  view source on GitHub ↗
(ctx context.Context, uuids ...string)

Source from the content-addressed store, hash-verified

33}
34
35func (h *Store[H]) List(ctx context.Context, uuids ...string) ([]*Commit[H], error) {
36 if len(uuids) == 0 {
37 return nil, errors.New("uuids is empty")
38 }
39 db := h.db.DB(ctx).Table(h.commitTableName)
40 if len(uuids) == 1 {
41 db = db.Where("`uuid` = ?", uuids[0])
42 } else {
43 db = db.Where("`uuid` in ?", uuids)
44 }
45
46 var commit = make([]*Commit[H], 0, len(uuids))
47 err := db.Find(&commit).Error
48 if err != nil {
49 return nil, err
50 }
51 return commit, nil
52}
53
54func NewCommitStore[H any](name string) *Store[H] {
55 return &Store[H]{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected