Documentation ¶
Index ¶
- type BoltManager
- func (m *BoltManager) AddFile(c *common.CartonFile) error
- func (m *BoltManager) Close() error
- func (m *BoltManager) DeleteFile(hash string) error
- func (m *BoltManager) GetAllFiles() ([]*common.CartonFile, error)
- func (m *BoltManager) GetFileByHash(hash string) (*common.CartonFile, error)
- func (m *BoltManager) GetFileByName(name string) *common.CartonFile
- func (m *BoltManager) GetPwdHash(user string) []byte
- func (m *BoltManager) IsUser(user string) bool
- func (m *BoltManager) RegisterUser(user string, hash []byte) error
- type DbManager
- type MockDbManager
- func (db *MockDbManager) AddFile(c *common.CartonFile) error
- func (db *MockDbManager) Close() error
- func (db *MockDbManager) DeleteFile(hash string) error
- func (db *MockDbManager) GetAllFiles() ([]*common.CartonFile, error)
- func (db *MockDbManager) GetFileByHash(hash string) (*common.CartonFile, error)
- func (db *MockDbManager) GetFileByName(name string) *common.CartonFile
- func (db *MockDbManager) GetPwdHash(user string) []byte
- func (db *MockDbManager) IsUser(user string) bool
- func (db *MockDbManager) RegisterUser(user string, hash []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltManager ¶
type BoltManager struct {
// contains filtered or unexported fields
}
func NewBoltManager ¶
func NewBoltManager(dbPath string) (*BoltManager, error)
func (*BoltManager) AddFile ¶
func (m *BoltManager) AddFile(c *common.CartonFile) error
func (*BoltManager) Close ¶
func (m *BoltManager) Close() error
func (*BoltManager) DeleteFile ¶
func (m *BoltManager) DeleteFile(hash string) error
func (*BoltManager) GetAllFiles ¶
func (m *BoltManager) GetAllFiles() ([]*common.CartonFile, error)
func (*BoltManager) GetFileByHash ¶
func (m *BoltManager) GetFileByHash(hash string) ( *common.CartonFile, error, )
func (*BoltManager) GetFileByName ¶
func (m *BoltManager) GetFileByName(name string) *common.CartonFile
func (*BoltManager) GetPwdHash ¶
func (m *BoltManager) GetPwdHash(user string) []byte
func (*BoltManager) IsUser ¶
func (m *BoltManager) IsUser(user string) bool
func (*BoltManager) RegisterUser ¶
func (m *BoltManager) RegisterUser(user string, hash []byte) error
type DbManager ¶
type DbManager interface { IsUser(user string) bool RegisterUser(user string, hash []byte) error GetPwdHash(user string) []byte AddFile(c *common.CartonFile) error GetAllFiles() ([]*common.CartonFile, error) GetFileByHash(name string) (*common.CartonFile, error) GetFileByName(hash string) *common.CartonFile DeleteFile(hash string) error Close() error }
type MockDbManager ¶
type MockDbManager struct {
// contains filtered or unexported fields
}
func NewMockDbManager ¶
func NewMockDbManager(registrationError bool) *MockDbManager
func (*MockDbManager) AddFile ¶
func (db *MockDbManager) AddFile(c *common.CartonFile) error
func (*MockDbManager) Close ¶
func (db *MockDbManager) Close() error
func (*MockDbManager) DeleteFile ¶
func (db *MockDbManager) DeleteFile(hash string) error
func (*MockDbManager) GetAllFiles ¶
func (db *MockDbManager) GetAllFiles() ([]*common.CartonFile, error)
func (*MockDbManager) GetFileByHash ¶
func (db *MockDbManager) GetFileByHash(hash string) ( *common.CartonFile, error, )
func (*MockDbManager) GetFileByName ¶
func (db *MockDbManager) GetFileByName(name string) *common.CartonFile
func (*MockDbManager) GetPwdHash ¶
func (db *MockDbManager) GetPwdHash(user string) []byte
func (*MockDbManager) IsUser ¶
func (db *MockDbManager) IsUser(user string) bool
func (*MockDbManager) RegisterUser ¶
func (db *MockDbManager) RegisterUser(user string, hash []byte) error
Click to show internal directories.
Click to hide internal directories.