Documentation
¶
Overview ¶
Copyright 2017 The GoStor Authors All rights reserved.
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 NewSizedLimitedReader(r io.Reader, length int64) io.Reader
- type Attr
- type CopyOperation
- type File
- func (dir *File) Create(ctx context.Context, req *api.CreateRequest) error
- func (f *File) FullPath() string
- func (f *File) Getattr(ctx context.Context) (Attr, error)
- func (f *File) IsDirectory() bool
- func (f *File) IsLink() bool
- func (f *File) IsSymlink() bool
- func (dir *File) Lookup(ctx context.Context, name string) error
- func (dir *File) Mkdir(ctx context.Context, req *api.MkdirRequest) error
- func (dir *File) ReadDirAll(ctx context.Context) error
- func (f *File) RemotePath() string
- func (dir *File) Remove(ctx context.Context, req *api.RemoveRequest) error
- func (dir *File) Rename(ctx context.Context, req *api.RenameRequest) error
- func (f *File) Setattr(ctx context.Context, req *api.SetattrRequest) error
- type MoveOperation
- type Namespace
- type Operation
- type PutOperation
- type SizedLimitedReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attr ¶
type Attr struct {
Inode uint64 // inode number
Size uint64 // size in bytes
Atime time.Time // time of last access
Mtime time.Time // time of last modification
Ctime time.Time // time of last inode change
Crtime time.Time // time of creation (OS X only)
Mode os.FileMode // file mode
Nlink uint32 // number of links (usually 1)
Uid uint32 // owner uid
Gid uint32 // group gid
Flags uint32 // chflags(2) flags (OS X only)
}
An Attr is the metadata for a single file or directory.
type CopyOperation ¶
CopyOperation - Copy source object to target.
type File ¶
type File struct {
Attr
Parent *File
Directory bool
Symlink bool
Link bool
Path string
Checksum string
Hash []byte
// contains filtered or unexported fields
}
File implements both Node and Handle for the hello file.
func (*File) Create ¶
Create will return a new empty file in current dir, if the file is currently locked, it will wait for the lock to be freed.
func (*File) IsDirectory ¶
func (*File) ReadDirAll ¶
ReadDirAll will return all files in current dir
func (*File) RemotePath ¶
RemotePath will return the full path on bucket
type MoveOperation ¶
MoveOperation - Move source object to target object. Copy source to target, delete the source.
type PutOperation ¶
PutOperation - Copy source file to target.
type SizedLimitedReader ¶
type SizedLimitedReader struct {
*io.LimitedReader
// contains filtered or unexported fields
}
SizedLimitedReader -
func (*SizedLimitedReader) Size ¶
func (slr *SizedLimitedReader) Size() int64
Size - returns the size of the underlying reader.