MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / syncAuthFile

Method syncAuthFile

internal/store/postgresstore.go:495–507  ·  view source on GitHub ↗
(ctx context.Context, relID, path string)

Source from the content-addressed store, hash-verified

493}
494
495func (s *PostgresStore) syncAuthFile(ctx context.Context, relID, path string) error {
496 data, err := os.ReadFile(path)
497 if err != nil {
498 if errors.Is(err, fs.ErrNotExist) {
499 return s.deleteAuthRecord(ctx, relID)
500 }
501 return fmt.Errorf("postgres store: read auth file: %w", err)
502 }
503 if len(data) == 0 {
504 return s.deleteAuthRecord(ctx, relID)
505 }
506 return s.persistAuth(ctx, relID, data)
507}
508
509func (s *PostgresStore) upsertAuthRecord(ctx context.Context, relID, path string) error {
510 data, err := os.ReadFile(path)

Callers 1

PersistAuthFilesMethod · 0.95

Calls 2

deleteAuthRecordMethod · 0.95
persistAuthMethod · 0.95

Tested by

no test coverage detected