nastra commented on code in PR #58: URL: https://github.com/apache/iceberg-go/pull/58#discussion_r1488126836
########## 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: I think a config file makes more sense, because then configs can be specifig to catalogs. Otherwise you'd have to maintain all the available config options as CLI options -- 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