Skip to content

Commit

Permalink
copy more missing code
Browse files Browse the repository at this point in the history
  • Loading branch information
ddowker committed Jun 5, 2024
1 parent fcca94c commit 3ceebdc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions broker/client/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ import (
"sync"

"cloud.google.com/go/storage"
"github.com/gorilla/schema"
"github.com/prometheus/client_golang/prometheus"
log "github.com/sirupsen/logrus"
"go.gazette.dev/core/broker/codecs"
pb "go.gazette.dev/core/broker/protocol"
"golang.org/x/oauth2/google"
"golang.org/x/oauth2/jwt"
"google.golang.org/api/option"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
Expand Down Expand Up @@ -446,6 +448,12 @@ type gcsBackend struct {
client *storage.Client
clientMu sync.Mutex
}
type GSStoreConfig struct {
bucket string
prefix string

RewriterConfig
}

// Arize Open routine with offset for use with consumers and signed URLs.
func (s *gcsBackend) openWithOffset(ctx context.Context, ep *url.URL, fragment pb.Fragment, offset int64) (io.ReadCloser, error) {
Expand Down Expand Up @@ -514,3 +522,15 @@ func (s *gcsBackend) gcsClient(ep *url.URL) (cfg GSStoreConfig, client *storage.

return
}

func parseStoreArgs(ep *url.URL, args interface{}) error {
var decoder = schema.NewDecoder()
decoder.IgnoreUnknownKeys(false)

if q, err := url.ParseQuery(ep.RawQuery); err != nil {
return err
} else if err = decoder.Decode(args, q); err != nil {
return fmt.Errorf("parsing store URL arguments: %s", err)
}
return nil
}

0 comments on commit 3ceebdc

Please sign in to comment.