Skip to content

Commit fb41e53

Browse files
authored
Move the repository package under examples/repository (#656)
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
1 parent 4eb06c8 commit fb41e53

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

examples/multirepo/repository/generate_metadata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import (
2727
"time"
2828

2929
"github.com/sigstore/sigstore/pkg/signature"
30+
"github.com/theupdateframework/go-tuf/v2/examples/repository/repository"
3031
"github.com/theupdateframework/go-tuf/v2/metadata"
31-
"github.com/theupdateframework/go-tuf/v2/metadata/repository"
3232
)
3333

3434
func main() {

examples/repository/basic_repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ import (
3030
"time"
3131

3232
"github.com/sigstore/sigstore/pkg/signature"
33+
"github.com/theupdateframework/go-tuf/v2/examples/repository/repository"
3334
"github.com/theupdateframework/go-tuf/v2/metadata"
34-
"github.com/theupdateframework/go-tuf/v2/metadata/repository"
3535
)
3636

3737
// A TUF repository example using the low-level TUF Metadata API.

metadata/repository/repository.go renamed to examples/repository/repository/repository.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,57 +21,57 @@ import (
2121
"github.com/theupdateframework/go-tuf/v2/metadata"
2222
)
2323

24-
// repositoryType struct for storing metadata
25-
type repositoryType struct {
24+
// Type struct for storing metadata
25+
type Type struct {
2626
root *metadata.Metadata[metadata.RootType]
2727
snapshot *metadata.Metadata[metadata.SnapshotType]
2828
timestamp *metadata.Metadata[metadata.TimestampType]
2929
targets map[string]*metadata.Metadata[metadata.TargetsType]
3030
}
3131

3232
// New creates an empty repository instance
33-
func New() *repositoryType {
34-
return &repositoryType{
33+
func New() *Type {
34+
return &Type{
3535
targets: map[string]*metadata.Metadata[metadata.TargetsType]{},
3636
}
3737
}
3838

3939
// Root returns metadata of type Root
40-
func (r *repositoryType) Root() *metadata.Metadata[metadata.RootType] {
40+
func (r *Type) Root() *metadata.Metadata[metadata.RootType] {
4141
return r.root
4242
}
4343

4444
// SetRoot sets metadata of type Root
45-
func (r *repositoryType) SetRoot(meta *metadata.Metadata[metadata.RootType]) {
45+
func (r *Type) SetRoot(meta *metadata.Metadata[metadata.RootType]) {
4646
r.root = meta
4747
}
4848

4949
// Snapshot returns metadata of type Snapshot
50-
func (r *repositoryType) Snapshot() *metadata.Metadata[metadata.SnapshotType] {
50+
func (r *Type) Snapshot() *metadata.Metadata[metadata.SnapshotType] {
5151
return r.snapshot
5252
}
5353

5454
// SetSnapshot sets metadata of type Snapshot
55-
func (r *repositoryType) SetSnapshot(meta *metadata.Metadata[metadata.SnapshotType]) {
55+
func (r *Type) SetSnapshot(meta *metadata.Metadata[metadata.SnapshotType]) {
5656
r.snapshot = meta
5757
}
5858

5959
// Timestamp returns metadata of type Timestamp
60-
func (r *repositoryType) Timestamp() *metadata.Metadata[metadata.TimestampType] {
60+
func (r *Type) Timestamp() *metadata.Metadata[metadata.TimestampType] {
6161
return r.timestamp
6262
}
6363

6464
// SetTimestamp sets metadata of type Timestamp
65-
func (r *repositoryType) SetTimestamp(meta *metadata.Metadata[metadata.TimestampType]) {
65+
func (r *Type) SetTimestamp(meta *metadata.Metadata[metadata.TimestampType]) {
6666
r.timestamp = meta
6767
}
6868

6969
// Targets returns metadata of type Targets
70-
func (r *repositoryType) Targets(name string) *metadata.Metadata[metadata.TargetsType] {
70+
func (r *Type) Targets(name string) *metadata.Metadata[metadata.TargetsType] {
7171
return r.targets[name]
7272
}
7373

7474
// SetTargets sets metadata of type Targets
75-
func (r *repositoryType) SetTargets(name string, meta *metadata.Metadata[metadata.TargetsType]) {
75+
func (r *Type) SetTargets(name string, meta *metadata.Metadata[metadata.TargetsType]) {
7676
r.targets[name] = meta
7777
}

0 commit comments

Comments
 (0)