Documentation ¶
Index ¶
- func CloseConnection(repo *MongoRepository) error
- type MongoRepository
- func (repo *MongoRepository) CreateFile(file dataclasses.Textfile) (int, error)
- func (repo *MongoRepository) DeleteFile(id int) (bool, error)
- func (repo *MongoRepository) GetCollection(database string) ([]string, error)
- func (repo *MongoRepository) GetDataBaseList() ([]string, error)
- func (repo *MongoRepository) GetFile(id int) (dataclasses.Textfile, error)
- func (repo *MongoRepository) SetDatabase(databasedata dataclasses.Connection) error
- func (repo *MongoRepository) UpdateFile(file dataclasses.Textfile) (dataclasses.Textfile, error)
- type Repository
- type SQLLiteRepository
- func (repo *SQLLiteRepository) CloseConnection() error
- func (repo *SQLLiteRepository) CreateFile(file dataclasses.Textfile) (int, error)
- func (repo *SQLLiteRepository) DeleteFile(id int) (bool, error)
- func (repo *SQLLiteRepository) GetCollection(database string) ([]string, error)
- func (repo *SQLLiteRepository) GetDataBaseList() ([]string, error)
- func (repo *SQLLiteRepository) GetFile(id int) (dataclasses.Textfile, error)
- func (repo *SQLLiteRepository) SetDatabase(databasedata dataclasses.Connection) error
- func (repo *SQLLiteRepository) UpdateFile(file dataclasses.Textfile) (dataclasses.Textfile, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseConnection ¶
func CloseConnection(repo *MongoRepository) error
CloseConnection shut down the connection
Types ¶
type MongoRepository ¶
type MongoRepository struct {
// contains filtered or unexported fields
}
MongoRepository inherited from Repository
func NewMongoRepository ¶
func NewMongoRepository() MongoRepository
NewMongoRepository Create a new Repository for MongoDB
func (*MongoRepository) CreateFile ¶
func (repo *MongoRepository) CreateFile(file dataclasses.Textfile) (int, error)
CreateFile create a new document on the database
func (*MongoRepository) DeleteFile ¶
func (repo *MongoRepository) DeleteFile(id int) (bool, error)
DeleteFile remove a textfile from the database
func (*MongoRepository) GetCollection ¶
func (repo *MongoRepository) GetCollection(database string) ([]string, error)
GetCollection return all collections of a Database
func (*MongoRepository) GetDataBaseList ¶
func (repo *MongoRepository) GetDataBaseList() ([]string, error)
GetDataBaseList returns a List of Databases
func (*MongoRepository) GetFile ¶
func (repo *MongoRepository) GetFile(id int) (dataclasses.Textfile, error)
GetFile return a textfile from the database specified by the documentid
func (*MongoRepository) SetDatabase ¶
func (repo *MongoRepository) SetDatabase(databasedata dataclasses.Connection) error
SetDatabase set the connections values for operation on the mongodb
func (*MongoRepository) UpdateFile ¶
func (repo *MongoRepository) UpdateFile(file dataclasses.Textfile) (dataclasses.Textfile, error)
UpdateFile update a recent file on the database
type Repository ¶
type Repository interface { CreateFile(dataclasses.Textfile) (int, error) GetDataBaseList() ([]string, error) GetCollection(string) ([]string, error) SetDatabase(dataclasses.Connection) error GetFile(int) (dataclasses.Textfile, error) UpdateFile(dataclasses.Textfile) (dataclasses.Textfile, error) DeleteFile(int) (bool, error) }
Repository Abstract Interface
type SQLLiteRepository ¶
type SQLLiteRepository struct {
// contains filtered or unexported fields
}
SQLLiteRepository inherited from Repository
func ConnectSQLLite ¶
func ConnectSQLLite() (SQLLiteRepository, error)
ConnectSQLLite handles connect to database
func NewSQLLiteRepository ¶
func NewSQLLiteRepository() SQLLiteRepository
NewSQLLiteRepository create new repository
func (*SQLLiteRepository) CloseConnection ¶
func (repo *SQLLiteRepository) CloseConnection() error
CloseConnection shut down the connection
func (*SQLLiteRepository) CreateFile ¶
func (repo *SQLLiteRepository) CreateFile(file dataclasses.Textfile) (int, error)
CreateFile create a new document on the database
func (*SQLLiteRepository) DeleteFile ¶
func (repo *SQLLiteRepository) DeleteFile(id int) (bool, error)
DeleteFile remove a textfile from the database
func (*SQLLiteRepository) GetCollection ¶
func (repo *SQLLiteRepository) GetCollection(database string) ([]string, error)
GetCollection return all collections of a Database
func (*SQLLiteRepository) GetDataBaseList ¶
func (repo *SQLLiteRepository) GetDataBaseList() ([]string, error)
GetDataBaseList returns a List of Databases
func (*SQLLiteRepository) GetFile ¶
func (repo *SQLLiteRepository) GetFile(id int) (dataclasses.Textfile, error)
GetFile return a textfile from the database specified by the documentid
func (*SQLLiteRepository) SetDatabase ¶
func (repo *SQLLiteRepository) SetDatabase(databasedata dataclasses.Connection) error
SetDatabase set the connections values for operation on the mongodb
func (*SQLLiteRepository) UpdateFile ¶
func (repo *SQLLiteRepository) UpdateFile(file dataclasses.Textfile) (dataclasses.Textfile, error)
UpdateFile update a recent file on the database