Documentation
¶
Index ¶
- Constants
- Variables
- func ChunkDir(dirpath string) func(func(ChunkHash, ErrorBytes) bool)
- func ChunkFile(path string) func(func(ChunkHash, ErrorBytes) bool)
- func IsValidHash(hashstring string) bool
- func NewChunker(rd io.Reader) *chunker.Chunker
- func RegisterDAOBackupServer(s grpc.ServiceRegistrar, srv DAOBackupServer)
- type BackupClient
- type BackupRoot
- func (*BackupRoot) Descriptor() ([]byte, []int)deprecated
- func (x *BackupRoot) GetPath() string
- func (x *BackupRoot) GetPrevious() []byte
- func (x *BackupRoot) GetRootDirectory() []byte
- func (x *BackupRoot) GetTimestamp() *timestamppb.Timestamp
- func (*BackupRoot) ProtoMessage()
- func (x *BackupRoot) ProtoReflect() protoreflect.Message
- func (x *BackupRoot) Reset()
- func (x *BackupRoot) String() string
- type BasicFilesystemServer
- func (server *BasicFilesystemServer) CheckBlob(c context.Context, chunkhash *Hash) (*RPCStatus, error)
- func (server *BasicFilesystemServer) GetBlob(c context.Context, chunkhash *Hash) (*HashedBlob, error)
- func (server *BasicFilesystemServer) PutBlob(c context.Context, hashedblob *HashedBlob) (*RPCStatus, error)
- type ChunkHash
- type ChunkMeta
- func (*ChunkMeta) Descriptor() ([]byte, []int)deprecated
- func (x *ChunkMeta) GetHash() []byte
- func (x *ChunkMeta) GetOffset() uint64
- func (x *ChunkMeta) GetSize() uint64
- func (*ChunkMeta) ProtoMessage()
- func (x *ChunkMeta) ProtoReflect() protoreflect.Message
- func (x *ChunkMeta) Reset()
- func (x *ChunkMeta) String() string
- type DAOBackupClient
- type DAOBackupServer
- type ErrorBytes
- type FileMeta
- func (*FileMeta) Descriptor() ([]byte, []int)deprecated
- func (x *FileMeta) GetChunks() []*ChunkMeta
- func (x *FileMeta) GetCreationTime() *timestamppb.Timestamp
- func (x *FileMeta) GetDirectoryEntries() map[string][]byte
- func (x *FileMeta) GetGroup() string
- func (x *FileMeta) GetHash() []byte
- func (x *FileMeta) GetMode() uint32
- func (x *FileMeta) GetModificationTime() *timestamppb.Timestamp
- func (x *FileMeta) GetName() string
- func (x *FileMeta) GetOwner() string
- func (x *FileMeta) GetSize() uint64
- func (x *FileMeta) GetType() FileType
- func (*FileMeta) ProtoMessage()
- func (x *FileMeta) ProtoReflect() protoreflect.Message
- func (x *FileMeta) Reset()
- func (x *FileMeta) String() string
- type FileType
- type Hash
- type HashedBlob
- type RPCStatus
- type UnimplementedDAOBackupServer
- type UnsafeDAOBackupServer
Constants ¶
const ( DAOBackup_PutBlob_FullMethodName = "/daobackup.DAOBackup/PutBlob" DAOBackup_CheckBlob_FullMethodName = "/daobackup.DAOBackup/CheckBlob" DAOBackup_GetBlob_FullMethodName = "/daobackup.DAOBackup/GetBlob" )
const ( MinChunkSize = 512 * 1024 // 512 KB MaxChunkSize = 8 * 1024 * 1024 // 8 MB )
Variables ¶
var ( FileType_name = map[int32]string{ 0: "NormalFile", 1: "Directory", 2: "SymbolicLink", 3: "HardLink", } FileType_value = map[string]int32{ "NormalFile": 0, "Directory": 1, "SymbolicLink": 2, "HardLink": 3, } )
Enum value maps for FileType.
var DAOBackup_ServiceDesc = grpc.ServiceDesc{ ServiceName: "daobackup.DAOBackup", HandlerType: (*DAOBackupServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "PutBlob", Handler: _DAOBackup_PutBlob_Handler, }, { MethodName: "CheckBlob", Handler: _DAOBackup_CheckBlob_Handler, }, { MethodName: "GetBlob", Handler: _DAOBackup_GetBlob_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "services.proto", }
DAOBackup_ServiceDesc is the grpc.ServiceDesc for DAOBackup service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_services_proto protoreflect.FileDescriptor
Functions ¶
func IsValidHash ¶
func RegisterDAOBackupServer ¶
func RegisterDAOBackupServer(s grpc.ServiceRegistrar, srv DAOBackupServer)
Types ¶
type BackupClient ¶
type BackupClient struct {
}
func (BackupClient) Backup ¶
func (b BackupClient) Backup(root string) (err error)
type BackupRoot ¶
type BackupRoot struct {
Previous []byte `protobuf:"bytes,1,opt,name=previous,proto3" json:"previous,omitempty"`
Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
RootDirectory []byte `protobuf:"bytes,4,opt,name=root_directory,json=rootDirectory,proto3" json:"root_directory,omitempty"`
// contains filtered or unexported fields
}
func (*BackupRoot) Descriptor
deprecated
func (*BackupRoot) Descriptor() ([]byte, []int)
Deprecated: Use BackupRoot.ProtoReflect.Descriptor instead.
func (*BackupRoot) GetPath ¶
func (x *BackupRoot) GetPath() string
func (*BackupRoot) GetPrevious ¶
func (x *BackupRoot) GetPrevious() []byte
func (*BackupRoot) GetRootDirectory ¶
func (x *BackupRoot) GetRootDirectory() []byte
func (*BackupRoot) GetTimestamp ¶
func (x *BackupRoot) GetTimestamp() *timestamppb.Timestamp
func (*BackupRoot) ProtoMessage ¶
func (*BackupRoot) ProtoMessage()
func (*BackupRoot) ProtoReflect ¶
func (x *BackupRoot) ProtoReflect() protoreflect.Message
func (*BackupRoot) Reset ¶
func (x *BackupRoot) Reset()
func (*BackupRoot) String ¶
func (x *BackupRoot) String() string
type BasicFilesystemServer ¶
func (*BasicFilesystemServer) GetBlob ¶
func (server *BasicFilesystemServer) GetBlob(c context.Context, chunkhash *Hash) (*HashedBlob, error)
func (*BasicFilesystemServer) PutBlob ¶
func (server *BasicFilesystemServer) PutBlob(c context.Context, hashedblob *HashedBlob) (*RPCStatus, error)
type ChunkMeta ¶
type ChunkMeta struct {
Offset uint64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"`
Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
Hash []byte `protobuf:"bytes,3,opt,name=hash,proto3" json:"hash,omitempty"`
// contains filtered or unexported fields
}
func (*ChunkMeta) Descriptor
deprecated
func (*ChunkMeta) ProtoMessage ¶
func (*ChunkMeta) ProtoMessage()
func (*ChunkMeta) ProtoReflect ¶
func (x *ChunkMeta) ProtoReflect() protoreflect.Message
type DAOBackupClient ¶
type DAOBackupClient interface {
PutBlob(ctx context.Context, in *HashedBlob, opts ...grpc.CallOption) (*RPCStatus, error)
CheckBlob(ctx context.Context, in *Hash, opts ...grpc.CallOption) (*RPCStatus, error)
GetBlob(ctx context.Context, in *Hash, opts ...grpc.CallOption) (*HashedBlob, error)
}
DAOBackupClient is the client API for DAOBackup service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewDAOBackupClient ¶
func NewDAOBackupClient(cc grpc.ClientConnInterface) DAOBackupClient
type DAOBackupServer ¶
type DAOBackupServer interface {
PutBlob(context.Context, *HashedBlob) (*RPCStatus, error)
CheckBlob(context.Context, *Hash) (*RPCStatus, error)
GetBlob(context.Context, *Hash) (*HashedBlob, error)
// contains filtered or unexported methods
}
DAOBackupServer is the server API for DAOBackup service. All implementations must embed UnimplementedDAOBackupServer for forward compatibility.
type ErrorBytes ¶
type FileMeta ¶
type FileMeta struct {
Type FileType `protobuf:"varint,1,opt,name=type,proto3,enum=daobackup.FileType" json:"type,omitempty"`
Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
Size uint64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
Owner string `protobuf:"bytes,5,opt,name=owner,proto3" json:"owner,omitempty"`
Group string `protobuf:"bytes,6,opt,name=group,proto3" json:"group,omitempty"`
Mode uint32 `protobuf:"varint,7,opt,name=mode,proto3" json:"mode,omitempty"`
ModificationTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=modification_time,json=modificationTime,proto3" json:"modification_time,omitempty"`
CreationTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"`
Chunks []*ChunkMeta `protobuf:"bytes,10,rep,name=chunks,proto3" json:"chunks,omitempty"`
DirectoryEntries map[string][]byte `` /* 184-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*FileMeta) Descriptor
deprecated
func (*FileMeta) GetCreationTime ¶
func (x *FileMeta) GetCreationTime() *timestamppb.Timestamp
func (*FileMeta) GetDirectoryEntries ¶
func (*FileMeta) GetModificationTime ¶
func (x *FileMeta) GetModificationTime() *timestamppb.Timestamp
func (*FileMeta) ProtoMessage ¶
func (*FileMeta) ProtoMessage()
func (*FileMeta) ProtoReflect ¶
func (x *FileMeta) ProtoReflect() protoreflect.Message
type FileType ¶
type FileType int32
func (FileType) Descriptor ¶
func (FileType) Descriptor() protoreflect.EnumDescriptor
func (FileType) EnumDescriptor
deprecated
func (FileType) Number ¶
func (x FileType) Number() protoreflect.EnumNumber
func (FileType) Type ¶
func (FileType) Type() protoreflect.EnumType
type Hash ¶
type Hash struct {
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
// contains filtered or unexported fields
}
func (*Hash) Descriptor
deprecated
func (*Hash) ProtoMessage ¶
func (*Hash) ProtoMessage()
func (*Hash) ProtoReflect ¶
func (x *Hash) ProtoReflect() protoreflect.Message
type HashedBlob ¶
type HashedBlob struct {
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
Blob []byte `protobuf:"bytes,2,opt,name=blob,proto3" json:"blob,omitempty"`
// contains filtered or unexported fields
}
func (*HashedBlob) Descriptor
deprecated
func (*HashedBlob) Descriptor() ([]byte, []int)
Deprecated: Use HashedBlob.ProtoReflect.Descriptor instead.
func (*HashedBlob) GetBlob ¶
func (x *HashedBlob) GetBlob() []byte
func (*HashedBlob) GetHash ¶
func (x *HashedBlob) GetHash() []byte
func (*HashedBlob) ProtoMessage ¶
func (*HashedBlob) ProtoMessage()
func (*HashedBlob) ProtoReflect ¶
func (x *HashedBlob) ProtoReflect() protoreflect.Message
func (*HashedBlob) Reset ¶
func (x *HashedBlob) Reset()
func (*HashedBlob) String ¶
func (x *HashedBlob) String() string
type RPCStatus ¶
type RPCStatus struct {
Succes bool `protobuf:"varint,1,opt,name=succes,proto3" json:"succes,omitempty"`
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
// contains filtered or unexported fields
}
func (*RPCStatus) Descriptor
deprecated
func (*RPCStatus) GetMessage ¶
func (*RPCStatus) ProtoMessage ¶
func (*RPCStatus) ProtoMessage()
func (*RPCStatus) ProtoReflect ¶
func (x *RPCStatus) ProtoReflect() protoreflect.Message
type UnimplementedDAOBackupServer ¶
type UnimplementedDAOBackupServer struct{}
UnimplementedDAOBackupServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedDAOBackupServer) GetBlob ¶
func (UnimplementedDAOBackupServer) GetBlob(context.Context, *Hash) (*HashedBlob, error)
func (UnimplementedDAOBackupServer) PutBlob ¶
func (UnimplementedDAOBackupServer) PutBlob(context.Context, *HashedBlob) (*RPCStatus, error)
type UnsafeDAOBackupServer ¶
type UnsafeDAOBackupServer interface {
// contains filtered or unexported methods
}
UnsafeDAOBackupServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DAOBackupServer will result in compilation errors.