Documentation ¶
Overview ¶
Copyright © 2023 Daniel Chalef
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func Glob(ctx context.Context, uri, pattern string) ([]string, error)
- func IsCloudURI(uri string) bool
- func JoinURI(left, right string) string
- func NewReader(ctx context.Context, uri string) (io.ReadCloser, error)
- func NewWriter(ctx context.Context, uri string) (io.WriteCloser, error)
- func OpenBucket(ctx context.Context, uri string) (*blob.Bucket, error)
- func ParseBlobURI(uri string) (scheme, bucket, key string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Glob ¶
Glob enumerates cloud storage objects/file names at a URI and returns a list of objects/ filename URIs that match the given pattern. Context can be used to cancel any cloud operations. Google Cloud Storage, AWS S3, and local filesystem URIs are supported. Use the correct URI scheme for the storage provider (gs://, s3://) or no scheme for local filesystem. The pattern is a glob pattern, not a regular expression.
func IsCloudURI ¶
IsCloudURI returns true if the URI is a cloud storage URI (gs:// or s3://). It does so by attempting to parse the URI and checking if the scheme is non-empty.
func JoinURI ¶
JoinURI joins two URI parts together, removing any trailing slashes from the left part and any leading slashes from the right part.
func NewReader ¶
NewReader creates a new io.ReadCloser for the given URI. Context can be used to cancel any operations. Google Cloud Storage, AWS S3, and local filesystem URIs are supported. Use the correct URI scheme for the storage provider (gs://, s3://) or no scheme for local filesystem. The URI must be a file, not a directory.
func NewWriter ¶
NewWriter creates a new io.WriteCloser for the given URI. Context can be used to cancel any operations. Google Cloud Storage, AWS S3, and local filesystem URIs are supported. Use the correct URI scheme for the storage provider (gs://, s3://) or no scheme for local filesystem.
func OpenBucket ¶
OpenBucket opens a blob storage bucket at the URI. Context can be used to cancel any operations. Google CDK is used to support both AWS S3 and Google Cloud Storage. Use the correct URI scheme to specify the storage provider (gs:// or s3://).
func ParseBlobURI ¶
ParseBlobURI parses a URI into its scheme, bucket, and key components.
Types ¶
This section is empty.