Skip to content

Commit

Permalink
enhancement: Expose Index interface from private (#1847)
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Lock <sam@swlock.co.uk>
  • Loading branch information
Sambigeara committed Oct 25, 2023
1 parent 42e6e61 commit 7123a67
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion private/compile/compile.go
Expand Up @@ -18,6 +18,8 @@ import (
"go.uber.org/zap"
)

type Index = index.Index

type Artefact struct {
Error error
PolicySet *runtimev1.RunnablePolicySet
Expand All @@ -39,7 +41,7 @@ func (e *Errors) Error() string {
}
}

func Files(ctx context.Context, fsys fs.FS) (index.Index, <-chan Artefact, error) {
func Files(ctx context.Context, fsys fs.FS) (Index, <-chan Artefact, error) {
idx, err := index.Build(ctx, fsys)
if err != nil {
idxErrs := new(index.BuildError)
Expand Down
2 changes: 1 addition & 1 deletion private/verify/verify.go
Expand Up @@ -26,7 +26,7 @@ import (
)

// Files runs tests using the policy files in the given file system.
func Files(ctx context.Context, fsys fs.FS, idx index.Index) (*policyv1.TestResults, error) {
func Files(ctx context.Context, fsys fs.FS, idx compile.Index) (*policyv1.TestResults, error) {
if idx == nil {
var err error
idx, err = index.Build(ctx, fsys, index.WithBuildFailureLogLevel(zap.DebugLevel))
Expand Down

0 comments on commit 7123a67

Please sign in to comment.