Skip to content

Commit

Permalink
SRVKP-6439 : FixLint
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodbindal committed Sep 25, 2024
1 parent bfd651b commit 2c7d343
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
5 changes: 3 additions & 2 deletions internal/fetch/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package fetch
import (
"context"
"fmt"
"github.com/codeclysm/extract/v3"
"github.com/openshift-pipelines/tekton-caches/internal/provider"
"net/url"
"os"
"strings"

"github.com/codeclysm/extract/v3"
"github.com/openshift-pipelines/tekton-caches/internal/provider"

"github.com/openshift-pipelines/tekton-caches/internal/provider/gcs"
"github.com/openshift-pipelines/tekton-caches/internal/provider/oci"
)
Expand Down
16 changes: 6 additions & 10 deletions internal/provider/S3Provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,29 @@ package provider
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/s3"
"io"
"log"
"os"
"path/filepath"
"strings"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/s3"
)

const (
AwsEnvName = "AWS_SHARED_CREDENTIALS_FILE"
AwsConfigFile = "AWS_CONFIG_FILE"
)

type S3Provider struct {
}

func init() {
log.Println("Init S3 Provider")
Providers["s3"] = S3Provider{}
}
type S3Provider struct{}

func (it S3Provider) Upload(ctx context.Context, target, filePath string) error {
log.Printf("S3: Uploading to %s", target)
return it.upload(ctx, target, filePath)
}

func (it S3Provider) Fetch(ctx context.Context, source, filePath string) error {
log.Printf("S3: Downloading %s", source)
return it.download(ctx, source, filePath)
Expand Down
4 changes: 3 additions & 1 deletion internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package provider

import "context"

var Providers = map[string]Provider{}
var Providers = map[string]Provider{
"s3": S3Provider{},
}

type Provider interface {
Upload(ctx context.Context, target, filePath string) error
Expand Down
5 changes: 3 additions & 2 deletions internal/upload/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package upload
import (
"context"
"fmt"
"github.com/openshift-pipelines/tekton-caches/internal/provider"
"github.com/openshift-pipelines/tekton-caches/internal/utils"
"net/url"
"os"
"strings"

"github.com/openshift-pipelines/tekton-caches/internal/provider"
"github.com/openshift-pipelines/tekton-caches/internal/utils"

"github.com/openshift-pipelines/tekton-caches/internal/provider/gcs"
"github.com/openshift-pipelines/tekton-caches/internal/provider/oci"
)
Expand Down

0 comments on commit 2c7d343

Please sign in to comment.