MCPcopy Create free account
hub / github.com/pydio/cells / Get

Method Get

data/source/sync/dao/sql/sql.go:88–102  ·  view source on GitHub ↗
(ctx context.Context, eTag string)

Source from the content-addressed store, hash-verified

86}
87
88func (s *sqlImpl) Get(ctx context.Context, eTag string) (string, bool) {
89
90 var row *Checksum
91
92 tx := s.instance(ctx).Where(&Checksum{Etag: eTag}).First(&row)
93 if tx.Error != nil {
94 return "", false
95 }
96
97 if tx.RowsAffected == 0 {
98 return "", false
99 }
100
101 return row.Checksum, true
102}
103
104func (s *sqlImpl) Set(ctx context.Context, eTag, checksum string) {
105 tx := s.instance(ctx).Create(&Checksum{Etag: eTag, Checksum: checksum})

Callers

nothing calls this directly

Calls 3

WhereMethod · 0.65
FirstMethod · 0.45
instanceMethod · 0.45

Tested by

no test coverage detected