MCPcopy Create free account
hub / github.com/bcspragu/logseq-sync / AddGraphEncryptKey

Method AddGraphEncryptKey

db/sqlite/sqlite.go:149–160  ·  view source on GitHub ↗
(ctx context.Context, gID db.GraphID, gek *db.GraphEncryptKey)

Source from the content-addressed store, hash-verified

147}
148
149func (d *DB) AddGraphEncryptKey(ctx context.Context, gID db.GraphID, gek *db.GraphEncryptKey) error {
150 id := uuid.NewString()
151 if err := d.q.AddGraphEncryptKey(ctx, sqlitedb.AddGraphEncryptKeyParams{
152 ID: id,
153 GraphID: string(gID),
154 EncryptedPrivateKey: gek.EncryptedPrivateKey,
155 PublicKey: gek.PublicKey,
156 }); err != nil {
157 return fmt.Errorf("failed to add graph encrypt key: %w", err)
158 }
159 return nil
160}
161
162func (d *DB) GraphEncryptKeys(ctx context.Context, id db.GraphID) ([]*db.GraphEncryptKey, error) {
163 geks, err := d.q.GraphEncryptKeys(ctx, string(id))

Callers

nothing calls this directly

Implementers 2

DBdb/mem/mem.go
DBdb/sqlite/sqlite.go

Calls 1

AddGraphEncryptKeyMethod · 0.65

Tested by

no test coverage detected