File: local_store.go

package info (click to toggle)
golang-github-theupdateframework-go-tuf 0.5.2-5~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 7,596 kB
  • sloc: python: 163; sh: 37; makefile: 12
file content (29 lines) | stat: -rw-r--r-- 512 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package client

import (
	"encoding/json"
)

func MemoryLocalStore() LocalStore {
	return make(memoryLocalStore)
}

type memoryLocalStore map[string]json.RawMessage

func (m memoryLocalStore) GetMeta() (map[string]json.RawMessage, error) {
	return m, nil
}

func (m memoryLocalStore) SetMeta(name string, meta json.RawMessage) error {
	m[name] = meta
	return nil
}

func (m memoryLocalStore) DeleteMeta(name string) error {
	delete(m, name)
	return nil
}

func (m memoryLocalStore) Close() error {
	return nil
}