v2

package
v0.0.0-...-5b7b398 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2015 License: BSD-2-Clause Imports: 21 Imported by: 0

Documentation

Overview

Package v2 is a generated protocol buffer package.

It is generated from these files:

data.proto

It has these top-level messages:

FileMetadata
LeafRecordEntry
LeafRecord
GetKeyReq
GetKeyResp
GetLocalPathReq
GetLocalPathResp
PutLocalPathReq
LinkReq
UnlinkReq
SimpleResp
Request
CacheEntry
RootLog

Index

Constants

View Source
const (
	INVALID sourceEnum = iota
	REMOTE
	LOCAL
)
View Source
const KEY_STR_LEN = 44
View Source
const STAT_ERROR_MISSING = "missing"
View Source
const STAT_ERROR_NONE = ""

Variables

View Source
var CacheEntry_SourceType_name = map[int32]string{
	0: "INVALID",
	2: "LOCAL",
	1: "REMOTE",
}
View Source
var CacheEntry_SourceType_value = map[string]int32{
	"INVALID": 0,
	"LOCAL":   2,
	"REMOTE":  1,
}
View Source
var EMPTY_DIR = Leaf{/* contains filtered or unexported fields */}
View Source
var KEY_TO_FILENAME []byte = []byte("keyToFilename")
View Source
var LEASE_TIMEOUT uint64 = 60 * 60 * 24
View Source
var NO_SUCH_KEY = errors.New("No such key")
View Source
var NO_SUCH_PATH = errors.New("No such path")
View Source
var ROOT_TO_KEY []byte = []byte("rootToKey")
View Source
var Request_Type_name = map[int32]string{
	1: "GET_KEY",
	2: "GET_LOCAL_PATH",
	3: "PUT_LOCAL_PATH",
	4: "LINK",
	5: "UNLINK",
}
View Source
var Request_Type_value = map[string]int32{
	"GET_KEY":        1,
	"GET_LOCAL_PATH": 2,
	"PUT_LOCAL_PATH": 3,
	"LINK":           4,
	"UNLINK":         5,
}
View Source
var RootLog_EntryType_name = map[int32]string{
	0: "INVALID",
	1: "LEASE",
	2: "LABEL",
}
View Source
var RootLog_EntryType_value = map[string]int32{
	"INVALID": 0,
	"LEASE":   1,
	"LABEL":   2,
}

Functions

func InitDb

func InitDb(filename string) (*bolt.DB, error)

func NewFilesystemCacheDB

func NewFilesystemCacheDB(root string, db *bolt.DB) (*filesystemCacheDB, error)

func NewMemCacheDB

func NewMemCacheDB() *memcacheDB

func PackFileMetadata

func PackFileMetadata(metadata *FileMetadata) []byte

func PackLeaf

func PackLeaf(leaf *Leaf) []byte

func ServerAccept

func ServerAccept(server *rpc.Server, lis net.Listener)

func StartJsonRpc

func StartJsonRpc(bindAddr string, ac *AtomicClient) error

func StartServer

func StartServer(bindAddr string, jsonBindAddr string, atomic Atomic) error

Types

type Atomic

type Atomic interface {
	GetDirectoryIterator(path *Path) (Iterator, error)
	GetMetadata(path *Path) (*FileMetadata, error)

	Put(destination *Path, resource Resource) (*Key, error)
	GetResource(key *Key) Resource

	Link(key *Key, path *Path, isDir bool) error
	Unlink(path *Path) error

	CreateResourceForLocalFile(localFile string) (Resource, error)

	Pull(tag string, lease *Lease) (*Key, error)
	Push(key *Key, new_tag string, lease *Lease) error

	ForEachRoot(prefix string, callback func(name string, key *Key)) error
}

type AtomicClient

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

A wrapper around Atomic which uses simple types for its parameters.

func (*AtomicClient) GetKey

func (ac *AtomicClient) GetKey(path string, key *string) error

func (*AtomicClient) GetLocalPath

func (ac *AtomicClient) GetLocalPath(path string, localPath *string) error
func (ac *AtomicClient) Link(args *LinkArgs, result *string) error

func (*AtomicClient) ListFiles

func (ac *AtomicClient) ListFiles(path string, result *[]ListFilesRecord) error

func (*AtomicClient) ListRoots

func (ac *AtomicClient) ListRoots(prefix string, resultPtr *[]ListRootsRecord) error

func (*AtomicClient) MakeDir

func (ac *AtomicClient) MakeDir(path string, result *string) error

func (*AtomicClient) Pull

func (ac *AtomicClient) Pull(args *PullArgs, result *string) error

func (*AtomicClient) Push

func (ac *AtomicClient) Push(args *PushArgs, result *string) error

func (*AtomicClient) PutLocalPath

func (ac *AtomicClient) PutLocalPath(args *PutLocalPathArgs, result *string) error

func (*AtomicClient) Stat

func (ac *AtomicClient) Stat(path string, result *StatResponse) error
func (ac *AtomicClient) Unlink(path string, result *string) error

type AtomicState

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

func NewAtomicState

func NewAtomicState(dirService DirectoryService, chunks *ChunkCache, cache *filesystemCacheDB, tags TagService, roots RootMap) *AtomicState

func (*AtomicState) CreateResourceForLocalFile

func (self *AtomicState) CreateResourceForLocalFile(localFile string) (Resource, error)

func (*AtomicState) DumpDebug

func (self *AtomicState) DumpDebug()

func (*AtomicState) ForEachRoot

func (self *AtomicState) ForEachRoot(prefix string, callback func(name string, key *Key)) error

func (*AtomicState) GC

func (self *AtomicState) GC()

func (*AtomicState) GetDirectoryIterator

func (self *AtomicState) GetDirectoryIterator(path *Path) (Iterator, error)

func (*AtomicState) GetMetadata

func (self *AtomicState) GetMetadata(path *Path) (*FileMetadata, error)

returns nil if no file with that path exists

func (*AtomicState) GetResource

func (self *AtomicState) GetResource(key *Key) Resource
func (self *AtomicState) Link(key *Key, path *Path, isDir bool) error

func (*AtomicState) Pull

func (self *AtomicState) Pull(tag string, lease *Lease) (*Key, error)

func (*AtomicState) Push

func (self *AtomicState) Push(key *Key, tag string, lease *Lease) error

func (*AtomicState) Put

func (self *AtomicState) Put(destination *Path, resource Resource) (*Key, error)
func (self *AtomicState) Unlink(path *Path) error

type Branch

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

type BranchEntry

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

type CacheEntry

type CacheEntry struct {
	Filename         *string                `protobuf:"bytes,1,req" json:"Filename,omitempty"`
	Source           *CacheEntry_SourceType `protobuf:"varint,2,req,enum=v2.CacheEntry_SourceType" json:"Source,omitempty"`
	XXX_unrecognized []byte                 `json:"-"`
}

func (*CacheEntry) GetFilename

func (m *CacheEntry) GetFilename() string

func (*CacheEntry) GetSource

func (m *CacheEntry) GetSource() CacheEntry_SourceType

func (*CacheEntry) ProtoMessage

func (*CacheEntry) ProtoMessage()

func (*CacheEntry) Reset

func (m *CacheEntry) Reset()

func (*CacheEntry) String

func (m *CacheEntry) String() string

type CacheEntry_SourceType

type CacheEntry_SourceType int32
const (
	CacheEntry_INVALID CacheEntry_SourceType = 0
	CacheEntry_LOCAL   CacheEntry_SourceType = 2
	CacheEntry_REMOTE  CacheEntry_SourceType = 1
)

func (CacheEntry_SourceType) Enum

func (CacheEntry_SourceType) String

func (x CacheEntry_SourceType) String() string

func (*CacheEntry_SourceType) UnmarshalJSON

func (x *CacheEntry_SourceType) UnmarshalJSON(data []byte) error

type ChunkCache

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

func NewChunkCache

func NewChunkCache(remote ChunkService, local cacheDB) *ChunkCache

func (*ChunkCache) Dump

func (c *ChunkCache) Dump()

func (*ChunkCache) Get

func (c *ChunkCache) Get(key *Key) (Resource, error)

func (*ChunkCache) PushToRemote

func (c *ChunkCache) PushToRemote(key *Key) error

func (*ChunkCache) Put

func (c *ChunkCache) Put(key *Key, resource Resource) error

type ChunkService

type ChunkService interface {
	// all methods are threadsafe
	Get(key *Key) (Resource, error)
	Put(key *Key, resource Resource) error
}

type DbRootMap

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

func (*DbRootMap) ForEach

func (self *DbRootMap) ForEach(callback func(name string, x *FileMetadata))

func (*DbRootMap) Get

func (self *DbRootMap) Get(name string) (*FileMetadata, bool)

func (*DbRootMap) Set

func (self *DbRootMap) Set(name string, value *FileMetadata)

type Directory

type Directory interface {
	Get(name string) (*FileMetadata, error)
	Put(name string, metadata *FileMetadata) (*Key, int64, error)
	Remove(name string) (*Key, int64, error)
	Iterate() Iterator
	GetTotalSize() (int64, error)
}

type DirectoryService

type DirectoryService interface {
	GetDirectory(key *Key) Directory
}

type FileMetadata

type FileMetadata struct {
	Size             *int64 `protobuf:"varint,1,opt,name=size" json:"size,omitempty"`
	Key              []byte `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"`
	CreationTime     *int64 `protobuf:"varint,3,opt,name=creation_time" json:"creation_time,omitempty"`
	IsDir            *bool  `protobuf:"varint,4,opt" json:"IsDir,omitempty"`
	TotalSize        *int64 `protobuf:"varint,5,opt,name=totalSize" json:"totalSize,omitempty"`
	XXX_unrecognized []byte `json:"-"`
}

func UnpackFileMetadata

func UnpackFileMetadata(r io.Reader) *FileMetadata

func (*FileMetadata) GetCreationTime

func (m *FileMetadata) GetCreationTime() int64

func (*FileMetadata) GetIsDir

func (m *FileMetadata) GetIsDir() bool

func (*FileMetadata) GetKey

func (m *FileMetadata) GetKey() []byte

func (*FileMetadata) GetSize

func (m *FileMetadata) GetSize() int64

func (*FileMetadata) GetTotalSize

func (m *FileMetadata) GetTotalSize() int64

func (*FileMetadata) ProtoMessage

func (*FileMetadata) ProtoMessage()

func (*FileMetadata) Reset

func (m *FileMetadata) Reset()

func (*FileMetadata) String

func (m *FileMetadata) String() string

type FileResource

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

type FilesystemResource

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

func NewFileResource

func NewFileResource(filename string) (*FilesystemResource, error)

func (*FilesystemResource) AsBytes

func (r *FilesystemResource) AsBytes() []byte

func (*FilesystemResource) GetLength

func (r *FilesystemResource) GetLength() int64

func (*FilesystemResource) GetReader

func (r *FilesystemResource) GetReader() io.Reader

type GetKeyReq

type GetKeyReq struct {
	Path             *string `protobuf:"bytes,1,req,name=path" json:"path,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*GetKeyReq) GetPath

func (m *GetKeyReq) GetPath() string

func (*GetKeyReq) ProtoMessage

func (*GetKeyReq) ProtoMessage()

func (*GetKeyReq) Reset

func (m *GetKeyReq) Reset()

func (*GetKeyReq) String

func (m *GetKeyReq) String() string

type GetKeyResp

type GetKeyResp struct {
	IsSuccess        *bool   `protobuf:"varint,1,req,name=isSuccess" json:"isSuccess,omitempty"`
	Key              *string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*GetKeyResp) GetIsSuccess

func (m *GetKeyResp) GetIsSuccess() bool

func (*GetKeyResp) GetKey

func (m *GetKeyResp) GetKey() string

func (*GetKeyResp) ProtoMessage

func (*GetKeyResp) ProtoMessage()

func (*GetKeyResp) Reset

func (m *GetKeyResp) Reset()

func (*GetKeyResp) String

func (m *GetKeyResp) String() string

type GetLocalPathReq

type GetLocalPathReq struct {
	Path             *string `protobuf:"bytes,1,req,name=path" json:"path,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*GetLocalPathReq) GetPath

func (m *GetLocalPathReq) GetPath() string

func (*GetLocalPathReq) ProtoMessage

func (*GetLocalPathReq) ProtoMessage()

func (*GetLocalPathReq) Reset

func (m *GetLocalPathReq) Reset()

func (*GetLocalPathReq) String

func (m *GetLocalPathReq) String() string

type GetLocalPathResp

type GetLocalPathResp struct {
	IsSuccess        *bool   `protobuf:"varint,1,req,name=isSuccess" json:"isSuccess,omitempty"`
	Path             *string `protobuf:"bytes,2,opt,name=path" json:"path,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*GetLocalPathResp) GetIsSuccess

func (m *GetLocalPathResp) GetIsSuccess() bool

func (*GetLocalPathResp) GetPath

func (m *GetLocalPathResp) GetPath() string

func (*GetLocalPathResp) ProtoMessage

func (*GetLocalPathResp) ProtoMessage()

func (*GetLocalPathResp) Reset

func (m *GetLocalPathResp) Reset()

func (*GetLocalPathResp) String

func (m *GetLocalPathResp) String() string

type IterableChunkService

type IterableChunkService interface {
	ChunkService
	Iterate() KeyIterator
}

type Iterator

type Iterator interface {
	HasNext() bool
	Next() (string, *FileMetadata)
}

func NewMemDirIterator

func NewMemDirIterator(names []string, metadatas []*FileMetadata) Iterator

type Key

type Key [32]byte
var EMPTY_DIR_KEY *Key = &EMPTY_DIR_KEY_
var EMPTY_DIR_KEY_ Key = ([32]byte{1, 1, 1, 1,
	1, 1, 1, 1,
	1, 1, 1, 1,
	1, 1, 1, 1,
	1, 1, 1, 1,
	1, 1, 1, 1,
	1, 1, 1, 1,
	1, 1, 1, 1})

func CreateAnonymousRefLeaf

func CreateAnonymousRefLeaf(chunks ChunkService, metadatas []*FileMetadata) *Key

create a leaf which only contains the specified metadata and the filenames do not matter this is used to create a set of references which are used in the transient refs.

func KeyFromBytes

func KeyFromBytes(bytes []byte) *Key

func NewKey

func NewKey(key string) *Key

func (*Key) AsBytes

func (k *Key) AsBytes() []byte

func (Key) String

func (k Key) String() string

type KeyIterator

type KeyIterator interface {
	HasNext() bool
	Next() *Key
}

type Leaf

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

func CopyLeafWithInsertion

func CopyLeafWithInsertion(leaf *Leaf, insertIndex int, entry *LeafEntry) *Leaf

func CopyLeafWithMutation

func CopyLeafWithMutation(leaf *Leaf, replaceIndex int, entry *LeafEntry) *Leaf

func CopyLeafWithRemoval

func CopyLeafWithRemoval(leaf *Leaf, removeIndex int) *Leaf

func UnpackLeaf

func UnpackLeaf(data []byte) *Leaf

func (*Leaf) GetTotalSize

func (d *Leaf) GetTotalSize() int64

type LeafDir

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

func (*LeafDir) Get

func (d *LeafDir) Get(name string) (*FileMetadata, error)

func (*LeafDir) GetTotalSize

func (d *LeafDir) GetTotalSize() (int64, error)

func (*LeafDir) Iterate

func (d *LeafDir) Iterate() Iterator

func (*LeafDir) Put

func (d *LeafDir) Put(name string, metadata *FileMetadata) (*Key, int64, error)

func (*LeafDir) Remove

func (d *LeafDir) Remove(name string) (*Key, int64, error)

type LeafDirService

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

func NewLeafDirService

func NewLeafDirService(chunks ChunkService) *LeafDirService

func (*LeafDirService) GetDirectory

func (s *LeafDirService) GetDirectory(key *Key) Directory

type LeafEntry

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

func UnpackLeafEntry

func UnpackLeafEntry(entry *LeafRecordEntry) *LeafEntry

type LeafIterator

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

func (*LeafIterator) HasNext

func (it *LeafIterator) HasNext() bool

func (*LeafIterator) Next

func (it *LeafIterator) Next() (string, *FileMetadata)

type LeafRecord

type LeafRecord struct {
	Entries          []*LeafRecordEntry `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"`
	XXX_unrecognized []byte             `json:"-"`
}

func (*LeafRecord) GetEntries

func (m *LeafRecord) GetEntries() []*LeafRecordEntry

func (*LeafRecord) ProtoMessage

func (*LeafRecord) ProtoMessage()

func (*LeafRecord) Reset

func (m *LeafRecord) Reset()

func (*LeafRecord) String

func (m *LeafRecord) String() string

type LeafRecordEntry

type LeafRecordEntry struct {
	Name             *string       `protobuf:"bytes,1,req,name=name" json:"name,omitempty"`
	Metadata         *FileMetadata `protobuf:"bytes,2,req,name=metadata" json:"metadata,omitempty"`
	XXX_unrecognized []byte        `json:"-"`
}

func (*LeafRecordEntry) GetMetadata

func (m *LeafRecordEntry) GetMetadata() *FileMetadata

func (*LeafRecordEntry) GetName

func (m *LeafRecordEntry) GetName() string

func (*LeafRecordEntry) ProtoMessage

func (*LeafRecordEntry) ProtoMessage()

func (*LeafRecordEntry) Reset

func (m *LeafRecordEntry) Reset()

func (*LeafRecordEntry) String

func (m *LeafRecordEntry) String() string

type Lease

type Lease struct {
}

type LinkArgs

type LinkArgs struct {
	Key   string
	Path  string
	IsDir bool
}

type LinkReq

type LinkReq struct {
	Key              *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"`
	Path             *string `protobuf:"bytes,2,req,name=path" json:"path,omitempty"`
	IsDir            *bool   `protobuf:"varint,3,req,name=isDir" json:"isDir,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

responses with SimpleResp

func (*LinkReq) GetIsDir

func (m *LinkReq) GetIsDir() bool

func (*LinkReq) GetKey

func (m *LinkReq) GetKey() string

func (*LinkReq) GetPath

func (m *LinkReq) GetPath() string

func (*LinkReq) ProtoMessage

func (*LinkReq) ProtoMessage()

func (*LinkReq) Reset

func (m *LinkReq) Reset()

func (*LinkReq) String

func (m *LinkReq) String() string

type ListFilesRecord

type ListFilesRecord struct {
	Name         string
	IsDir        bool
	Size         int64
	TotalSize    int64
	CreationTime int64
}

type ListRootsRecord

type ListRootsRecord struct {
	Name string
	Key  *Key
}

type MemChunkService

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

func NewMemChunkService

func NewMemChunkService() *MemChunkService

func (*MemChunkService) Get

func (c *MemChunkService) Get(key *Key) (Resource, error)

func (*MemChunkService) Iterate

func (self *MemChunkService) Iterate() KeyIterator

func (*MemChunkService) PrintDebug

func (self *MemChunkService) PrintDebug()

func (*MemChunkService) Put

func (c *MemChunkService) Put(key *Key, resource Resource) error

type MemDirIterator

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

func (*MemDirIterator) HasNext

func (m *MemDirIterator) HasNext() bool

func (*MemDirIterator) Len

func (m *MemDirIterator) Len() int

func (*MemDirIterator) Less

func (m *MemDirIterator) Less(i, j int) bool

func (*MemDirIterator) Next

func (m *MemDirIterator) Next() (string, *FileMetadata)

func (*MemDirIterator) Swap

func (m *MemDirIterator) Swap(i, j int)

type MemKeyIterator

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

func (*MemKeyIterator) HasNext

func (self *MemKeyIterator) HasNext() bool

func (*MemKeyIterator) Next

func (self *MemKeyIterator) Next() *Key

type MemResource

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

func (*MemResource) AsBytes

func (r *MemResource) AsBytes() []byte

func (*MemResource) GetLength

func (r *MemResource) GetLength() int64

func (*MemResource) GetReader

func (r *MemResource) GetReader() io.Reader

type MemRootMap

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

func (*MemRootMap) ForEach

func (self *MemRootMap) ForEach(callback func(name string, x *FileMetadata))

func (*MemRootMap) Get

func (self *MemRootMap) Get(name string) (*FileMetadata, bool)

func (*MemRootMap) Set

func (self *MemRootMap) Set(name string, value *FileMetadata)

type MemTagService

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

func NewMemTagService

func NewMemTagService() *MemTagService

func (*MemTagService) ForEach

func (m *MemTagService) ForEach(callback func(name string, key *Key))

func (*MemTagService) Get

func (m *MemTagService) Get(tag string) (*Key, error)

func (*MemTagService) Put

func (m *MemTagService) Put(tag string, key *Key) error

type NodeStore

type NodeStore interface {
	GetLeaf(key *Key) *Leaf
	StoreLeaf(leaf *Leaf) *Key
	GetBranch(key *Key) *Branch
	StoreBranch(branch *Branch) *Key

	GetDirectory(key *Key) *Directory
}

type Path

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

func NewPath

func NewPath(path string) *Path

func (*Path) IsRoot

func (p *Path) IsRoot() bool

func (*Path) Split

func (p *Path) Split() (*Path, string)

type PullArgs

type PullArgs struct {
	Tag         string
	Destination string
}

type PushArgs

type PushArgs struct {
	Source string
	Tag    string
}

type PutLocalPathArgs

type PutLocalPathArgs struct {
	LocalPath string
	DestPath  string
}

type PutLocalPathReq

type PutLocalPathReq struct {
	Path             *string `protobuf:"bytes,1,req,name=path" json:"path,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

responses with SimpleResp

func (*PutLocalPathReq) GetPath

func (m *PutLocalPathReq) GetPath() string

func (*PutLocalPathReq) ProtoMessage

func (*PutLocalPathReq) ProtoMessage()

func (*PutLocalPathReq) Reset

func (m *PutLocalPathReq) Reset()

func (*PutLocalPathReq) String

func (m *PutLocalPathReq) String() string

type Request

type Request struct {
	Type             *Request_Type    `protobuf:"varint,1,req,name=type,enum=v2.Request_Type" json:"type,omitempty"`
	GetKey           *GetKeyReq       `protobuf:"bytes,2,opt" json:"GetKey,omitempty"`
	GetLocalPath     *GetLocalPathReq `protobuf:"bytes,3,opt" json:"GetLocalPath,omitempty"`
	PutLocalPath     *PutLocalPathReq `protobuf:"bytes,4,opt" json:"PutLocalPath,omitempty"`
	Link             *LinkReq         `protobuf:"bytes,5,opt" json:"Link,omitempty"`
	Unlink           *UnlinkReq       `protobuf:"bytes,6,opt" json:"Unlink,omitempty"`
	XXX_unrecognized []byte           `json:"-"`
}

func (*Request) GetGetKey

func (m *Request) GetGetKey() *GetKeyReq

func (*Request) GetGetLocalPath

func (m *Request) GetGetLocalPath() *GetLocalPathReq
func (m *Request) GetLink() *LinkReq

func (*Request) GetPutLocalPath

func (m *Request) GetPutLocalPath() *PutLocalPathReq

func (*Request) GetType

func (m *Request) GetType() Request_Type
func (m *Request) GetUnlink() *UnlinkReq

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) String

func (m *Request) String() string

type Request_Type

type Request_Type int32
const (
	Request_GET_KEY        Request_Type = 1
	Request_GET_LOCAL_PATH Request_Type = 2
	Request_PUT_LOCAL_PATH Request_Type = 3
	Request_LINK           Request_Type = 4
	Request_UNLINK         Request_Type = 5
)

func (Request_Type) Enum

func (x Request_Type) Enum() *Request_Type

func (Request_Type) String

func (x Request_Type) String() string

func (*Request_Type) UnmarshalJSON

func (x *Request_Type) UnmarshalJSON(data []byte) error

type Resource

type Resource interface {
	AsBytes() []byte
	GetReader() io.Reader
	GetLength() int64
}

func NewMemResource

func NewMemResource(data []byte) Resource

type RootLog

type RootLog struct {
	Type             *RootLog_EntryType `protobuf:"varint,1,req,enum=v2.RootLog_EntryType" json:"Type,omitempty"`
	Name             *string            `protobuf:"bytes,2,opt" json:"Name,omitempty"`
	Key              []byte             `protobuf:"bytes,3,opt" json:"Key,omitempty"`
	Expiry           *uint64            `protobuf:"varint,4,opt" json:"Expiry,omitempty"`
	XXX_unrecognized []byte             `json:"-"`
}

func (*RootLog) GetExpiry

func (m *RootLog) GetExpiry() uint64

func (*RootLog) GetKey

func (m *RootLog) GetKey() []byte

func (*RootLog) GetName

func (m *RootLog) GetName() string

func (*RootLog) GetType

func (m *RootLog) GetType() RootLog_EntryType

func (*RootLog) ProtoMessage

func (*RootLog) ProtoMessage()

func (*RootLog) Reset

func (m *RootLog) Reset()

func (*RootLog) String

func (m *RootLog) String() string

type RootLog_EntryType

type RootLog_EntryType int32
const (
	RootLog_INVALID RootLog_EntryType = 0
	RootLog_LEASE   RootLog_EntryType = 1
	RootLog_LABEL   RootLog_EntryType = 2
)

func (RootLog_EntryType) Enum

func (RootLog_EntryType) String

func (x RootLog_EntryType) String() string

func (*RootLog_EntryType) UnmarshalJSON

func (x *RootLog_EntryType) UnmarshalJSON(data []byte) error

type RootMap

type RootMap interface {
	Get(name string) (*FileMetadata, bool)
	Set(name string, value *FileMetadata)
	ForEach(func(name string, x *FileMetadata))
}

func NewDbRootMap

func NewDbRootMap(db *bolt.DB) RootMap

func NewMemRootMap

func NewMemRootMap() RootMap

type SimpleResp

type SimpleResp struct {
	IsSuccess        *bool  `protobuf:"varint,1,req,name=isSuccess" json:"isSuccess,omitempty"`
	XXX_unrecognized []byte `json:"-"`
}

func (*SimpleResp) GetIsSuccess

func (m *SimpleResp) GetIsSuccess() bool

func (*SimpleResp) ProtoMessage

func (*SimpleResp) ProtoMessage()

func (*SimpleResp) Reset

func (m *SimpleResp) Reset()

func (*SimpleResp) String

func (m *SimpleResp) String() string

type StatResponse

type StatResponse struct {
	Size         int64
	Key          []byte
	CreationTime int64
	IsDir        bool
	TotalSize    int64
	Error        string
}

type TagService

type TagService interface {
	Put(name string, key *Key) error
	Get(name string) (*Key, error)
	ForEach(callback func(name string, key *Key))
}

type TreeSettings

type TreeSettings struct {
	MaxBlockSize int
	MinBlockSize int
}

type TreeStats

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

type UnlinkReq

type UnlinkReq struct {
	Path             *string `protobuf:"bytes,1,req,name=path" json:"path,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

responses with SimpleResp

func (*UnlinkReq) GetPath

func (m *UnlinkReq) GetPath() string

func (*UnlinkReq) ProtoMessage

func (*UnlinkReq) ProtoMessage()

func (*UnlinkReq) Reset

func (m *UnlinkReq) Reset()

func (*UnlinkReq) String

func (m *UnlinkReq) String() string

Directories

Path Synopsis
Hellofs implements a simple "hello world" file system.
Hellofs implements a simple "hello world" file system.

Jump to

Keyboard shortcuts

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