src/server/pkg/obj/obj.go
func NewClientFromURLAndSecret(url *ObjectStoreURL, reversed ...bool) (c Client, err error) {
	switch url.Store {
	case "s3":
		c, err = NewAmazonClientFromSecret(url.Bucket, reversed...)
	case "gcs":
		fallthrough
	case "gs":
		c, err = NewGoogleClientFromSecret(url.Bucket)
	case "as":
		fallthrough
	case "wasb":
		// In Azure, the first part of the path is the container name.
		c, err = NewMicrosoftClientFromSecret(url.Bucket)
	case "local":
		c, err = NewLocalClient("/" + url.Bucket)
	}
	switch {
	case err != nil:
		return nil, err
	case c != nil:
		return TracingObjClient(url.Store, c), nil
	default:
		return nil, fmt.Errorf("unrecognized object store: %s", url.Bucket)
	}
}
func NewClientFromURLAndSecret(url *ObjectStoreURL, reversed ...bool) (c Client, err error) {
	switch url.Store {
	case "s3":
		c, err = NewAmazonClientFromSecret(url.Bucket, reversed...)
	case "gcs":
		fallthrough
	case "gs":
		c, err = NewGoogleClientFromSecret(url.Bucket)
	case "as":
		fallthrough
	case "wasb":
		// In Azure, the first part of the path is the container name.
		c, err = NewMicrosoftClientFromSecret(url.Bucket)
	case "local":
		c, err = NewLocalClient("/" + url.Bucket)
	}
	switch {
	case err != nil:
		return nil, err
	case c != nil:
		return TracingObjClient(url.Store, c), nil
	default:
		return nil, fmt.Errorf("unrecognized object store: %s", url.Bucket)
	}
}
func NewClientFromURLAndSecret ( url * ObjectStoreURL , reversed ... bool ) ( c Client , err error ) { switch url . Store { case " " : c , err = NewAmazonClientFromSecret ( url . Bucket , reversed ... ) case " " : fallthrough case " " : c , err = NewGoogleClientFromSecret ( url . Bucket ) case " " : fallthrough case " " : // In Azure, the first part of the path is the container name. c , err = NewMicrosoftClientFromSecret ( url . Bucket ) case " " : c , err = NewLocalClient ( " " + url . Bucket ) } switch { case err != nil : return nil , err case c != nil : return TracingObjClient ( url . Store , c ) , nil default : return nil , fmt . Errorf ( " " , url . Bucket ) } }
// NewClientFromURLAndSecret constructs a client by parsing `URL` and then
// constructing the correct client for that URL using secrets.
NewClientFromURLAndSecret constructs a client by parsing URL and then constructing the correct client for that URL using secrets .