File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,12 @@ type MultiRepoConfig struct {
5151 DisableLocalCache bool
5252}
5353
54- // MultiRepoClient represents a multi-repository TUF client
54+ // MultiRepoClient represents a multi-repository TUF client.
55+ //
56+ // Thread Safety: MultiRepoClient is NOT safe for concurrent use. If multiple
57+ // goroutines need to use a MultiRepoClient concurrently, external synchronization
58+ // is required (e.g., a sync.Mutex). Alternatively, create separate MultiRepoClient
59+ // instances for each goroutine.
5560type MultiRepoClient struct {
5661 TUFClients map [string ]* updater.Updater
5762 Config * MultiRepoConfig
Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ import (
2424 "github.com/theupdateframework/go-tuf/v2/metadata"
2525)
2626
27- // TrustedMetadata struct for storing trusted metadata
27+ // TrustedMetadata struct for storing trusted metadata.
28+ //
29+ // Thread Safety: TrustedMetadata is NOT safe for concurrent use. If multiple
30+ // goroutines need to access a TrustedMetadata instance concurrently, external
31+ // synchronization is required (e.g., a sync.Mutex).
2832type TrustedMetadata struct {
2933 Root * metadata.Metadata [metadata.RootType ]
3034 Snapshot * metadata.Metadata [metadata.SnapshotType ]
Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ import (
5858// target file is already locally cached.
5959// - DownloadTarget() downloads a target file and ensures it is
6060// verified correct by the metadata.
61+ //
62+ // Thread Safety: Updater is NOT safe for concurrent use. If multiple goroutines
63+ // need to use an Updater concurrently, external synchronization is required
64+ // (e.g., a sync.Mutex). Alternatively, create separate Updater instances for
65+ // each goroutine.
6166type Updater struct {
6267 trusted * trustedmetadata.TrustedMetadata
6368 cfg * config.UpdaterConfig
You can’t perform that action at this time.
0 commit comments