zeroshade commented on code in PR #58: URL: https://github.com/apache/iceberg-go/pull/58#discussion_r1488083197
########## catalog/catalog.go: ########## @@ -47,19 +52,136 @@ func WithAwsConfig(cfg aws.Config) Option { } } +func WithCredential(cred string) Option { + return func(o *options) { + o.credential = cred + } +} + +func WithOAuthToken(token string) Option { + return func(o *options) { + o.oauthToken = token + } +} + +func WithTLSConfig(config *tls.Config) Option { + return func(o *options) { + o.tlsConfig = config + } +} + +func WithWarehouseLocation(loc string) Option { + return func(o *options) { + o.warehouseLocation = loc + } +} + +func WithMetadataLocation(loc string) Option { + return func(o *options) { + o.metadataLocation = loc + } +} + +func WithSigV4() Option { + return func(o *options) { + o.enableSigv4 = true + o.sigv4Service = "execute-api" + } +} + +func WithSigV4RegionSvc(region, service string) Option { + return func(o *options) { + o.enableSigv4 = true + o.sigv4Region = region + + if service == "" { + o.sigv4Service = "execute-api" + } else { + o.sigv4Service = service + } + } +} + +func WithAuthURI(uri *url.URL) Option { + return func(o *options) { + o.authUri = uri + } +} + +func WithPrefix(prefix string) Option { + return func(o *options) { + o.prefix = prefix + } +} + type Option func(*options) type options struct { awsConfig aws.Config + + tlsConfig *tls.Config + credential string + oauthToken string + warehouseLocation string Review Comment: currently only `credential` is configurable on the CLI. I can add the warehouse and token easily as options. Unless we think that the config file would be better in general -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org