示例#1
0
//GetInstance returns repository for databases
func GetInstance() RepositoryDB {
	once.Do(func() {
		instance = &sQLiteRepository{}
		instance.DBContext = dbcontextsqlite.GetInstance()
	})
	return instance
}
示例#2
0
//GetInstance create repository of parameters
func GetInstance() RepositoryParams {
	once.Do(func() {
		instance = &sqliteRepositoryParams{}
		instance.DBContext = dbcontextsqlite.GetInstance()

		//Create prdefined params
		if instance.DBContext.IsCreated() {
			if err := instance.setPreDefinedParams(); err != nil {
				panic(err)
			}
		}
	})
	return instance
}