blobfile

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

blobfile

Similar to https://pypi.org/project/blobfile/

Implements fetching of public files only.

Works for:

  1. Paths on a local filesystem

    • <local_path>
  2. Regular http and https urls

    • http://<path>
    • https://<path>
  3. Google Cloud Storage

    • gs://<bucket>
  4. Azure Blob Storage

    • az://<account>/<container>
    • https://<account>.blob.core.windows.net/<container>/
  5. Amazon AWS S3

    • s3://<bucket>/<path>
    • https://<bucket>.s3.amazonaws.com/<object>/
    • https://s3.amazonaws.com/<bucket>/<object>/

Documentation

Index

Constants

View Source
const (
	AzurePathPrefix = "az://"
	S3PathPrefix    = "s3://"
	GcpPathPrefix   = "gs://"
	AzureDomain     = "blob.core.windows.net"
	AwsDomain       = "s3.amazonaws.com"
	GcpDomain       = "storage.googleapis.com"
)

Variables

This section is empty.

Functions

func IsAzurePath

func IsAzurePath(path string) bool

func IsGCPPath

func IsGCPPath(path string) bool

func IsS3Path

func IsS3Path(path string) bool

Types

type Blobfile

type Blobfile struct {
	// contains filtered or unexported fields
}

func NewBlobfile

func NewBlobfile(path string) (blobfile *Blobfile)

func (*Blobfile) Read

func (bf *Blobfile) Read() (data []byte, err error)

type PathType

type PathType int
const (
	LocalPath PathType = iota
	AzurePath
	S3Path
	GcpPath
)

func DetectPathType

func DetectPathType(path string) PathType

func (PathType) String

func (p PathType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL