src/server/pkg/obj/obj.go
func NewGoogleClientFromSecret(bucket string) (Client, error) {
	var err error
	if bucket == "" {
		bucket, err = readSecretFile("/google-bucket")
		if err != nil {
			return nil, fmt.Errorf("google-bucket not found")
		}
	}
	cred, err := readSecretFile("/google-cred")
	if err != nil {
		return nil, fmt.Errorf("google-cred not found")
	}
	var opts []option.ClientOption
	if cred != "" {
		opts = append(opts, option.WithCredentialsFile(secretFile("/google-cred")))
	} else {
		opts = append(opts, option.WithTokenSource(google.ComputeTokenSource("")))
	}
	return NewGoogleClient(bucket, opts)
}
func NewGoogleClientFromSecret(bucket string) (Client, error) {
	var err error
	if bucket == "" {
		bucket, err = readSecretFile("/google-bucket")
		if err != nil {
			return nil, fmt.Errorf("google-bucket not found")
		}
	}
	cred, err := readSecretFile("/google-cred")
	if err != nil {
		return nil, fmt.Errorf("google-cred not found")
	}
	var opts []option.ClientOption
	if cred != "" {
		opts = append(opts, option.WithCredentialsFile(secretFile("/google-cred")))
	} else {
		opts = append(opts, option.WithTokenSource(google.ComputeTokenSource("")))
	}
	return NewGoogleClient(bucket, opts)
}
func NewGoogleClientFromSecret ( bucket string ) ( Client , error ) { var err error if bucket == " " { bucket , err = readSecretFile ( " " ) if err != nil { return nil , fmt . Errorf ( " " ) } } cred , err := readSecretFile ( " " ) if err != nil { return nil , fmt . Errorf ( " " ) } var opts [ ] option . ClientOption if cred != " " { opts = append ( opts , option . WithCredentialsFile ( secretFile ( " " ) ) ) } else { opts = append ( opts , option . WithTokenSource ( google . ComputeTokenSource ( " " ) ) ) } return NewGoogleClient ( bucket , opts ) }
// NewGoogleClientFromSecret creates a google client by reading credentials
// from a mounted GoogleSecret. You may pass "" for bucket in which case it
// will read the bucket from the secret.
NewGoogleClientFromSecret creates a google client by reading credentials from a mounted GoogleSecret . You may pass for bucket in which case it will read the bucket from the secret .