api

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: 3 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

View Source
const (
	// GET operation
	OpsGetFileStatus = "GETFILESTATUS"
	OpsListStatus    = "LISTSTATUS"
	// Get Content Summary of a Directory
	OpsGetContentSummary = "GETCONTENTSUMMARY"
	// Get File Checksum
	OpsGetFileChecksum = "GETFILECHECKSUM"

	// DELETE operation
	OpsDelete = "DELETE"

	// PUT operation
	// Create and Write to a File
	OpsFileCreate = "CREATE"
	// Make a Directory
	OpsDirCreate = "MKDIRS"
	// Rename a File/Directory
	OpsRename = "RENAME"
	// Set Permission
	OpsSetPermission = "SETPERMISSION"
	// Set Access or Modification Time
	OpsSetTimes = "SETTIMES"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Bucket    string
	Location  string
	AccessKey string
	SecretKey string
}

type CreateRequest

type CreateRequest struct {
	Name  string
	Flags OpenFlags
	Mode  os.FileMode
	// Umask of the request. Not supported on OS X.
	Umask os.FileMode
}

A CreateRequest asks to create and open a file (not a directory).

type FlushRequest

type FlushRequest struct {
	Flags     uint32
	LockOwner uint64
}

A FlushRequest asks for the current state of an open file to be flushed to storage, as when a file descriptor is being closed. A single opened Handle may receive multiple FlushRequests over its lifetime.

type FsyncRequest

type FsyncRequest struct {
	// TODO bit 1 is datasync, not well documented upstream
	Flags uint32
	Dir   bool
}

type GetattrRequest

type GetattrRequest struct {
	Flags uint32 // bit flags
}

A GetattrRequest asks for the metadata for the file denoted by r.Node.

type LinkRequest

type LinkRequest struct {
	OldNode uint64
	NewName string
}

A LinkRequest is a request to create a hard link.

type LookupRequest

type LookupRequest struct {
	Name string
}

A LookupRequest asks to look up the given name in the directory named by r.Node.

type MkdirRequest

type MkdirRequest struct {
	Name string
	Mode os.FileMode
	// Umask of the request. Not supported on OS X.
	Umask os.FileMode
}

type MknodRequest

type MknodRequest struct {
	Name string
	Mode os.FileMode
	Rdev uint32
	// Umask of the request. Not supported on OS X.
	Umask os.FileMode
}

type OpenFlags

type OpenFlags uint32

OpenFlags are the O_FOO flags passed to open/create/etc calls. For example, os.O_WRONLY | os.O_APPEND.

type RaftClusterStatusResponse

type RaftClusterStatusResponse struct {
	IsLeader bool
	Leader   string
	Peers    []string
}

type ReleaseFlags

type ReleaseFlags uint32

The ReleaseFlags are used in the Release exchange.

type ReleaseRequest

type ReleaseRequest struct {
	Dir          bool      // is this Releasedir?
	Flags        OpenFlags // flags from OpenRequest
	ReleaseFlags ReleaseFlags
	LockOwner    uint32
}

A ReleaseRequest asks to release (close) an open file handle.

type RemoveRequest

type RemoveRequest struct {
	Name string // name of the entry to remove
	Dir  bool   // is this rmdir?
}

A RemoveRequest asks to remove a file or directory from the directory r.Node.

type RenameRequest

type RenameRequest struct {
	NewDir  uint64
	OldName string
	NewName string
}

A RenameRequest is a request to rename a file.

type SetattrRequest

type SetattrRequest struct {
	Valid SetattrValid
	Size  uint64
	Atime time.Time
	Mtime time.Time
	Mode  os.FileMode
	Uid   uint32
	Gid   uint32

	// OS X only
	Bkuptime time.Time
	Chgtime  time.Time
	Crtime   time.Time
	Flags    uint32 // see chflags(2)
}

A SetattrRequest asks to change one or more attributes associated with a file, as indicated by Valid.

type SetattrValid

type SetattrValid uint32

The SetattrValid are bit flags describing which fields in the SetattrRequest are included in the change.

const (
	SetattrMode   SetattrValid = 1 << 0
	SetattrUid    SetattrValid = 1 << 1
	SetattrGid    SetattrValid = 1 << 2
	SetattrSize   SetattrValid = 1 << 3
	SetattrAtime  SetattrValid = 1 << 4
	SetattrMtime  SetattrValid = 1 << 5
	SetattrHandle SetattrValid = 1 << 6

	// Linux only(?)
	SetattrAtimeNow  SetattrValid = 1 << 7
	SetattrMtimeNow  SetattrValid = 1 << 8
	SetattrLockOwner SetattrValid = 1 << 9 // http://www.mail-archive.com/git-commits-head@vger.kernel.org/msg27852.html

	// OS X only
	SetattrCrtime   SetattrValid = 1 << 28
	SetattrChgtime  SetattrValid = 1 << 29
	SetattrBkuptime SetattrValid = 1 << 30
	SetattrFlags    SetattrValid = 1 << 31
)

func (SetattrValid) Atime

func (fl SetattrValid) Atime() bool

func (SetattrValid) AtimeNow

func (fl SetattrValid) AtimeNow() bool

func (SetattrValid) Bkuptime

func (fl SetattrValid) Bkuptime() bool

func (SetattrValid) Chgtime

func (fl SetattrValid) Chgtime() bool

func (SetattrValid) Crtime

func (fl SetattrValid) Crtime() bool

func (SetattrValid) Flags

func (fl SetattrValid) Flags() bool

func (SetattrValid) Gid

func (fl SetattrValid) Gid() bool

func (SetattrValid) Handle

func (fl SetattrValid) Handle() bool

func (SetattrValid) LockOwner

func (fl SetattrValid) LockOwner() bool

func (SetattrValid) Mode

func (fl SetattrValid) Mode() bool

func (SetattrValid) Mtime

func (fl SetattrValid) Mtime() bool

func (SetattrValid) MtimeNow

func (fl SetattrValid) MtimeNow() bool

func (SetattrValid) Size

func (fl SetattrValid) Size() bool

func (SetattrValid) String

func (fl SetattrValid) String() string

func (SetattrValid) Uid

func (fl SetattrValid) Uid() bool

type SymlinkRequest

type SymlinkRequest struct {
	NewName string
	Target  string
}

A SymlinkRequest is a request to create a symlink making NewName point to Target.

Jump to

Keyboard shortcuts

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