Documentation ¶
Overview ¶
Package alluxio provides the Alluxio file system client.
Index ¶
- type Client
- func (client *Client) Close(id int) error
- func (client *Client) CreateDirectory(path string, options *option.CreateDirectory) error
- func (client *Client) CreateFile(path string, options *option.CreateFile) (int, error)
- func (client *Client) Delete(path string, options *option.Delete) error
- func (client *Client) Exists(path string, options *option.Exists) (bool, error)
- func (client *Client) Free(path string, options *option.Free) error
- func (client *Client) GetStatus(path string, options *option.GetStatus) (*wire.FileInfo, error)
- func (client *Client) ListStatus(path string, options *option.ListStatus) (wire.FileInfos, error)
- func (client *Client) Mount(path, src string, options *option.Mount) error
- func (client *Client) OpenFile(path string, options *option.OpenFile) (int, error)
- func (client *Client) Read(id int) (io.ReadCloser, error)
- func (client *Client) Rename(path, dst string, options *option.Rename) error
- func (client *Client) SetAttribute(path string, options *option.SetAttribute) error
- func (client *Client) Unmount(path string, options *option.Unmount) error
- func (client *Client) Write(id int, input io.Reader) (int, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Example (Download) ¶
fs := NewClient("localhost", 39999, time.Minute) id, err := fs.OpenFile("/test_file", &option.OpenFile{}) if err != nil { log.Fatal(err) } r, err := fs.Read(id) if err != nil { log.Fatal(err) } defer r.Close() defer fs.Close(id) if _, err := io.Copy(ioutil.Discard, r); err != nil { log.Fatal(err) }
Output:
Example (Exists) ¶
fs := NewClient("localhost", 39999, time.Minute) ok, err := fs.Exists("/test_path", &option.Exists{}) if err != nil { log.Fatal(err) } fmt.Println(ok)
Output:
Example (ListStatus) ¶
fs := NewClient("localhost", 39999, time.Minute) fileInfos, err := fs.ListStatus("/test_path", &option.ListStatus{}) if err != nil { log.Fatal(err) } for _, fileInfo := range fileInfos { fmt.Println(fileInfo.Name) }
Output:
Example (Upload) ¶
fs := NewClient("localhost", 39999, time.Minute) id, err := fs.CreateFile("/test_file", &option.CreateFile{}) if err != nil { log.Fatal(err) } n, err := fs.Write(id, bytes.NewBuffer(make([]byte, 1024))) if err != nil { log.Fatal(err) } defer fs.Close(id) fmt.Println(n)
Output:
func (*Client) CreateDirectory ¶
func (client *Client) CreateDirectory(path string, options *option.CreateDirectory) error
CreateDirectory creates a directory.
func (*Client) CreateFile ¶
CreateFile creates a file, returning a stream id.
func (*Client) ListStatus ¶
ListStatus lists path statuses.
func (*Client) Read ¶
func (client *Client) Read(id int) (io.ReadCloser, error)
Read reads from a stream.
func (*Client) SetAttribute ¶
func (client *Client) SetAttribute(path string, options *option.SetAttribute) error
SetAttribute sets path attributes.
Directories ¶
Path | Synopsis |
---|---|
Package option contains types for method options.
|
Package option contains types for method options. |
Package optiontest contains utilities for testing method options.
|
Package optiontest contains utilities for testing method options. |
Package wire contains Alluxio file system wire types.
|
Package wire contains Alluxio file system wire types. |
Package wiretest contains utilites for testing Alluxio file system wire types.
|
Package wiretest contains utilites for testing Alluxio file system wire types. |
Click to show internal directories.
Click to hide internal directories.