Skip to content

Commit 5aec0cd

Browse files
author
Janos Bonic
committed
Base structure
Signed-off-by: Janos Bonic <[email protected]>
1 parent e12eef4 commit 5aec0cd

File tree

111 files changed

+1952
-4367
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+1952
-4367
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

.golangci.yml

Lines changed: 0 additions & 90 deletions
This file was deleted.

api.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package registry
2+
3+
import (
4+
"context"
5+
6+
"github.com/opentofu/libregistry/metadata"
7+
"github.com/opentofu/libregistry/types/module"
8+
"github.com/opentofu/libregistry/vcs"
9+
)
10+
11+
// API describes the API interface for accessing the registry.
12+
type API interface {
13+
// AddModule adds a module based on a VCS repository.
14+
AddModule(ctx context.Context, vcsRepository string) error
15+
// UpdateModule updates the list of available versions for a module in the registry from its source repository.
16+
// This function is idempotent and adds the module to the storage if it does not exist yet.
17+
UpdateModule(ctx context.Context, moduleAddr module.Addr) error
18+
}
19+
20+
// New creates a new instance of the registry API with the given GitHub client and data API instance.
21+
func New(vcsClient vcs.Client, dataAPI metadata.ModuleDataAPI) (API, error) {
22+
return &api{
23+
dataAPI,
24+
vcsClient,
25+
}, nil
26+
}
27+
28+
type api struct {
29+
dataAPI metadata.ModuleDataAPI
30+
vcsClient vcs.Client
31+
}

cmd/add-module/main.go

Lines changed: 0 additions & 120 deletions
This file was deleted.

cmd/add-provider/main.go

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)