Documentation ¶
Index ¶
- Constants
- func FromProtoEntry(msg *rfspb.Entry, e *Entry)
- func NewVolumeClient(addr string) (vpb.VolumeServerClient, error)
- type Attr
- type Controller
- type Entry
- func (e *Entry) CombineChunksGetContent() error
- func (e *Entry) DecodeAttributesAndChunks(data []byte) error
- func (e *Entry) EncodeAttributesAndChunks() ([]byte, error)
- func (e *Entry) SplitToChunks(chunkSize uint64) error
- func (e *Entry) ToExistingProtoEntry(message *rfspb.Entry, hasContent bool) error
- type EtcdStore
- func (es *EtcdStore) Close()
- func (es *EtcdStore) DeleteEntry(ctx context.Context, path string) error
- func (es *EtcdStore) GetEntry(ctx context.Context, path string) (*Entry, error)
- func (es *EtcdStore) GetVolumesStatus() ([]*vpb.VolumeStatus, error)
- func (es *EtcdStore) GetVolumesStatusChan() chan *VolumeUpdateEvent
- func (es *EtcdStore) InsertEntry(ctx context.Context, dir string, entry *Entry) error
- func (es *EtcdStore) IsLeader() bool
- func (es *EtcdStore) KvGet(ctx context.Context, key string) (string, error)
- func (es *EtcdStore) KvPut(ctx context.Context, key, value string) error
- func (es *EtcdStore) ListEntries(ctx context.Context, dir string) ([]*Entry, error)
- type MetaServer
- func (ms *MetaServer) AppendFile(ctx context.Context, req *mpb.AppendFileRequest) (*mpb.AppendFileResponse, error)
- func (ms *MetaServer) CreateFile(ctx context.Context, req *mpb.CreateFileRequest) (*mpb.CreateFileResponse, error)
- func (ms *MetaServer) GetFile(ctx context.Context, req *mpb.GetFileRequest) (*mpb.GetFileResponse, error)
- func (ms *MetaServer) List(ctx context.Context, req *mpb.ListRequest) (*mpb.ListResponse, error)
- func (ms *MetaServer) Mkdir(ctx context.Context, req *mpb.MkdirRequest) (*mpb.MkdirResponse, error)
- func (ms *MetaServer) Move(ctx context.Context, req *mpb.MoveRequest) (*mpb.MoveResponse, error)
- func (ms *MetaServer) Remove(ctx context.Context, req *mpb.RemoveRequest) (*mpb.RemoveResponse, error)
- func (ms *MetaServer) Stat(ctx context.Context, req *mpb.StatRequest) (*mpb.StatResponse, error)
- type VolumeUpdateEvent
Constants ¶
View Source
const ( VolumeEventTypePut = iota VolumeEventTypeDelete )
Variables ¶
This section is empty.
Functions ¶
func FromProtoEntry ¶
func NewVolumeClient ¶
func NewVolumeClient(addr string) (vpb.VolumeServerClient, error)
Types ¶
type Attr ¶
type Attr struct { Mtime time.Time // time of last modification Crtime time.Time // time of creation (OS X only) Mode os.FileMode // file mode Uid uint32 // owner uid Gid uint32 // group gid Mime string // mime type TtlSec int32 // ttl in seconds UserName string GroupNames []string SymlinkTarget string Md5 []byte FileSize uint64 Rdev uint32 Inode uint64 }
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(ctx context.Context) *Controller
type Entry ¶
type Entry struct { Name string Attr Extended map[string][]byte // the following is for files Chunks []*rfspb.FileChunk `json:"chunks,omitempty"` // HardLinkId HardLinkId // HardLinkCounter int32 Content []byte Quota int64 }
func (*Entry) CombineChunksGetContent ¶
func (*Entry) DecodeAttributesAndChunks ¶
func (*Entry) EncodeAttributesAndChunks ¶
func (*Entry) SplitToChunks ¶
type EtcdStore ¶
type EtcdStore struct {
// contains filtered or unexported fields
}
func NewEtcdStore ¶
func (*EtcdStore) DeleteEntry ¶
func (*EtcdStore) GetVolumesStatus ¶
func (es *EtcdStore) GetVolumesStatus() ([]*vpb.VolumeStatus, error)
func (*EtcdStore) GetVolumesStatusChan ¶
func (es *EtcdStore) GetVolumesStatusChan() chan *VolumeUpdateEvent
func (*EtcdStore) InsertEntry ¶
type MetaServer ¶
type MetaServer struct { Store *EtcdStore UniqueId int32 VolumeClients map[string]vpb.VolumeServerClient // key: volumeId }
func NewMetaServer ¶
func NewMetaServer() (*MetaServer, error)
func (*MetaServer) AppendFile ¶
func (ms *MetaServer) AppendFile(ctx context.Context, req *mpb.AppendFileRequest) (*mpb.AppendFileResponse, error)
TODO
func (*MetaServer) CreateFile ¶
func (ms *MetaServer) CreateFile(ctx context.Context, req *mpb.CreateFileRequest) (*mpb.CreateFileResponse, error)
func (*MetaServer) GetFile ¶
func (ms *MetaServer) GetFile(ctx context.Context, req *mpb.GetFileRequest) (*mpb.GetFileResponse, error)
func (*MetaServer) List ¶
func (ms *MetaServer) List(ctx context.Context, req *mpb.ListRequest) (*mpb.ListResponse, error)
func (*MetaServer) Mkdir ¶
func (ms *MetaServer) Mkdir(ctx context.Context, req *mpb.MkdirRequest) (*mpb.MkdirResponse, error)
func (*MetaServer) Move ¶
func (ms *MetaServer) Move(ctx context.Context, req *mpb.MoveRequest) (*mpb.MoveResponse, error)
func (*MetaServer) Remove ¶
func (ms *MetaServer) Remove(ctx context.Context, req *mpb.RemoveRequest) (*mpb.RemoveResponse, error)
func (*MetaServer) Stat ¶
func (ms *MetaServer) Stat(ctx context.Context, req *mpb.StatRequest) (*mpb.StatResponse, error)
type VolumeUpdateEvent ¶
type VolumeUpdateEvent struct { Type int Status *vpb.VolumeStatus VolumeId string }
Click to show internal directories.
Click to hide internal directories.