filesystem

package
v0.0.0-...-35f7450 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2015 License: Apache-2.0 Imports: 15 Imported by: 0

README

Azure Storage Client

This program provides filesystem interfaces that make it easy to access Azure Storage Client.

Installation

go get github.com/MSOpenTech/azure-sdk-for-go
  • Install:
go install github.com/MSOpenTech/azure-sdk-for-go

Deployment

Example:

    cli, err := NewClient(
        AzurestorageAccountName, 
        AzurestorageAccountKey, 
        "core.chinacloudapi.cn", 
        "2014-02-14", 
        true
    )

License

Apache 2.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureClient

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

func NewAzureClient

func NewAzureClient(accountName, accountKey, blobServiceBaseUrl, apiVersion string, useHttps bool) (*AzureClient, error)

NewAzureClient function NewClient constructs a StorageClient and blobStorageClinet. This should be used if the caller wants to specify whether to use HTTPS, a specific REST API version or a custom storage endpoint than Azure Public Cloud. Recommended API version "2014-02-14" synax : AzurestorageAccountName, AzurestorageAccountKey, "core.chinacloudapi.cn", "2014-02-14", true

func (*AzureClient) Exists

func (c *AzureClient) Exists(name string) (bool, error)

AzureClient -> Exist function Only check the BlobName if exist or not User should Provide corresponding ContainerName

func (*AzureClient) Glob

func (c *AzureClient) Glob(pattern string) (matches []string, err error)

AzureClient -> Glob function only supports '*', '?' Syntax: cntName?/part.*

func (*AzureClient) OpenReadCloser

func (c *AzureClient) OpenReadCloser(name string) (io.ReadCloser, error)

AzureClient -> OpenReadCloser function implement by the providing function

func (*AzureClient) OpenWriteCloser

func (c *AzureClient) OpenWriteCloser(name string) (io.WriteCloser, error)

AzureClient -> OpenWriteCloser function If not exist, Create corresponding Container and blob.

func (*AzureClient) Rename

func (c *AzureClient) Rename(oldpath, newpath string) error

AzureClient -> Rename function Azure prevent user renaming their blob Thus this function firstly copy the source blob, when finished, delete the source blob. http://stackoverflow.com/questions/3734672/azure-storage-blob-rename

type AzureFile

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

func (*AzureFile) Close

func (f *AzureFile) Close() error

func (*AzureFile) Write

func (f *AzureFile) Write(b []byte) (int, error)

type Client

type Client interface {
	// Opens the file for reading.
	OpenReadCloser(name string) (io.ReadCloser, error)
	// Opens the file for writing.
	// It creates the file if it didn't exist.
	OpenWriteCloser(name string) (io.WriteCloser, error)
	Exists(name string) (bool, error)
	Rename(oldpath, newpath string) error
	// Glob returns the names of all files matching pattern or
	// nil if there is no matching file.
	Glob(pattern string) (matches []string, err error)
}

func NewHdfsClient

func NewHdfsClient(namenodeAddr, webHdfsAddr, user string) (Client, error)

func NewLocalFSClient

func NewLocalFSClient() Client

type HdfsClient

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

func (*HdfsClient) Exists

func (c *HdfsClient) Exists(name string) (bool, error)

func (*HdfsClient) Glob

func (c *HdfsClient) Glob(pattern string) (matches []string, err error)

only supports '*', '?' Syntax:

/user/hdfs/etl*/part.*

func (*HdfsClient) OpenReadCloser

func (c *HdfsClient) OpenReadCloser(name string) (io.ReadCloser, error)

func (*HdfsClient) OpenWriteCloser

func (c *HdfsClient) OpenWriteCloser(name string) (io.WriteCloser, error)

func (*HdfsClient) Rename

func (c *HdfsClient) Rename(oldpath, newpath string) error

type HdfsFile

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

func (*HdfsFile) Close

func (f *HdfsFile) Close() error

Jump to

Keyboard shortcuts

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