func WriteCustomAssets(encoder Encoder, opts *AssetOpts, args []string, objectStoreBackend string,
	persistentDiskBackend string, secure, isS3V2 bool) error {
	switch objectStoreBackend {
	case "s3":
		if len(args) != s3CustomArgs {
			return fmt.Errorf("Expected %d arguments for disk+s3 backend", s3CustomArgs)
		}
		volumeSize, err := strconv.Atoi(args[1])
		if err != nil {
			return fmt.Errorf("volume size needs to be an integer; instead got %v", args[1])
		}
		switch persistentDiskBackend {
		case "aws":
			if err := WriteAssets(encoder, opts, minioBackend, amazonBackend, volumeSize, ""); err != nil {
				return err
			}
		case "google":
			if err := WriteAssets(encoder, opts, minioBackend, googleBackend, volumeSize, ""); err != nil {
				return err
			}
		case "azure":
			if err := WriteAssets(encoder, opts, minioBackend, microsoftBackend, volumeSize, ""); err != nil {
				return err
			}
		default:
			return fmt.Errorf("Did not recognize the choice of persistent-disk")
		}
		return WriteSecret(encoder, MinioSecret(args[2], args[3], args[4], args[5], secure, isS3V2), opts)
	default:
		return fmt.Errorf("Did not recognize the choice of object-store")
	}
}
func WriteCustomAssets(encoder Encoder, opts *AssetOpts, args []string, objectStoreBackend string,
	persistentDiskBackend string, secure, isS3V2 bool) error {
	switch objectStoreBackend {
	case "s3":
		if len(args) != s3CustomArgs {
			return fmt.Errorf("Expected %d arguments for disk+s3 backend", s3CustomArgs)
		}
		volumeSize, err := strconv.Atoi(args[1])
		if err != nil {
			return fmt.Errorf("volume size needs to be an integer; instead got %v", args[1])
		}
		switch persistentDiskBackend {
		case "aws":
			if err := WriteAssets(encoder, opts, minioBackend, amazonBackend, volumeSize, ""); err != nil {
				return err
			}
		case "google":
			if err := WriteAssets(encoder, opts, minioBackend, googleBackend, volumeSize, ""); err != nil {
				return err
			}
		case "azure":
			if err := WriteAssets(encoder, opts, minioBackend, microsoftBackend, volumeSize, ""); err != nil {
				return err
			}
		default:
			return fmt.Errorf("Did not recognize the choice of persistent-disk")
		}
		return WriteSecret(encoder, MinioSecret(args[2], args[3], args[4], args[5], secure, isS3V2), opts)
	default:
		return fmt.Errorf("Did not recognize the choice of object-store")
	}
}
func WriteCustomAssets ( encoder Encoder , opts * AssetOpts , args [ ] string , objectStoreBackend string , persistentDiskBackend string , secure , isS3V2 bool ) error { switch objectStoreBackend { case " " : if len ( args ) != s3CustomArgs { return fmt . Errorf ( " " , s3CustomArgs ) } volumeSize , err := strconv . Atoi ( args [ 1 ] ) if err != nil { return fmt . Errorf ( " " , args [ 1 ] ) } switch persistentDiskBackend { case " " : if err := WriteAssets ( encoder , opts , minioBackend , amazonBackend , volumeSize , " " ) ; err != nil { return err } case " " : if err := WriteAssets ( encoder , opts , minioBackend , googleBackend , volumeSize , " " ) ; err != nil { return err } case " " : if err := WriteAssets ( encoder , opts , minioBackend , microsoftBackend , volumeSize , " " ) ; err != nil { return err } default : return fmt . Errorf ( " " ) } return WriteSecret ( encoder , MinioSecret ( args [ 2 ] , args [ 3 ] , args [ 4 ] , args [ 5 ] , secure , isS3V2 ) , opts ) default : return fmt . Errorf ( " " ) } }
// WriteCustomAssets writes assets to a custom combination of object-store and persistent disk.
WriteCustomAssets writes assets to a custom combination of object - store and persistent disk .