fs

package
v0.0.0-...-cd88b06 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSizedLimitedReader

func NewSizedLimitedReader(r io.Reader, length int64) io.Reader

NewSizedLimitedReader -

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

type CopyOperation struct {
	*Operation

	Source string
	Target string
}

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

func (dir *File) Create(ctx context.Context, req *api.CreateRequest) error

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) FullPath

func (f *File) FullPath() string

FullPath will return the full path

func (*File) Getattr

func (f *File) Getattr(ctx context.Context) (Attr, error)

Getattr returns the file attributes

func (*File) IsDirectory

func (f *File) IsDirectory() bool
func (f *File) IsLink() bool
func (f *File) IsSymlink() bool

func (*File) Lookup

func (dir *File) Lookup(ctx context.Context, name string) error

Lookup -

func (*File) Mkdir

func (dir *File) Mkdir(ctx context.Context, req *api.MkdirRequest) error

Mkdir will make a new directory below current dir

func (*File) ReadDirAll

func (dir *File) ReadDirAll(ctx context.Context) error

ReadDirAll will return all files in current dir

func (*File) RemotePath

func (f *File) RemotePath() string

RemotePath will return the full path on bucket

func (*File) Remove

func (dir *File) Remove(ctx context.Context, req *api.RemoveRequest) error

Remove will delete a file or directory from current directory

func (*File) Rename

func (dir *File) Rename(ctx context.Context, req *api.RenameRequest) error

Rename will rename files

func (*File) Setattr

func (f *File) Setattr(ctx context.Context, req *api.SetattrRequest) error

Setattr - set attribute.

type MoveOperation

type MoveOperation struct {
	*Operation

	Source string
	Target string
}

MoveOperation - Move source object to target object. Copy source to target, delete the source.

type Namespace

type Namespace struct {
	ID string

	api.Config
	// contains filtered or unexported fields
}

func NewNamespace

func NewNamespace(id string, cfg *api.Config, s storage.Storage) *Namespace

func (*Namespace) Root

func (ns *Namespace) Root() *File

type Operation

type Operation struct {
	Error chan error
}

Operation -

type PutOperation

type PutOperation struct {
	*Operation

	Length int64

	Source string
	Target string
}

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.

Jump to

Keyboard shortcuts

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