Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Graphe des révisions

17 commits

Auteur SHA1 Message Date
akuma06 2646bc2db8 This is a prelimenary work
Showing how we can remove services, preventing cyclic imports and lessing the number of imports.
Now db is in models. Db and models are highly tightened, according to go standards, you should put them in the same package.
In models, there are folders separating the different methods used to modify the models. For example, if you want to create a user, you have to use /models (for the user struct) and /models/user (for creating a user.
However, if you want to delete a torrent, you just have to import /models and do torrent.Delete(definitely bool).

By the way packages in models are the plural name of a model. For example, you have torrent.go for a torrent model and its package torrents for db stuff related functions (Find, Create, Some helpers)
2017-06-29 00:44:07 +02:00
akuma06 5376b9e271 New config files (#854)
* New config files

As decided, config files are parsed at runtime.
I decided to go for YAML config files because there can be comments in
it.
There are 2 files:
* config/default_config.yml <= which shouldn't be edited unless we add a
config parameter
* config/config.yml <= which is the user-defined config. This file
shouldn't be commited

Changed every call to config.XXX to config.Conf.XXX (look to the new
stucture of config in config/types.go)

Of course, putting config parameters in config.yml overrides config in
config_default.yml. You don't have to put everything in it, just add
what you want to override.

* Fixing test

Replacing conf.New by config.Conf

* Fixing call to config.Conf to config.Config{} in test files

* Might have fixed testing with this

Printf instead of Fatalf

* Renaming config.yml in example file

* Forbid commiting config.yml

* Should be now fixed

* Do not need this file anymore
2017-05-30 21:21:57 -05:00
akuma06 6481e90a0c Golint friendly next (#756)
* Gofmt friendly

Keeping Go source code in line with what they preconize

* Golint Friendly Next

So I have made some variables unexported
Added comments in every function that I know what it does
Removed some deprecated stuff that I was sure of
Added a comment on possible deprecated methods "Is it deprecated?"
Changed some variable/method name according to golint recommendations

* Update filelist.go
2017-05-26 12:12:52 +02:00
Eliot Whalan b4b1b1c26a
go fmt all the code 2017-05-24 17:11:13 +10:00
akuma06 07c120407e Finished 2017-05-22 00:22:42 +02:00
PantsuDev 70f87e7aac finish repo transfer 2017-05-17 15:58:40 +10:00
Eliot Whalan cec71bd759 Add in support for commenting on sukebei 2017-05-16 12:53:02 +10:00
akuma06 44508c9f82 Fix comment model 2017-05-12 01:40:02 +02:00
bakape 8b56f2e76e Merge branch 'master' of https://github.com/ewhal/nyaa into search-caching 2017-05-10 11:47:06 +03:00
bakape 7ff8e97c9d Framework for caching []model.Torrents 2017-05-10 11:27:17 +03:00
Your Name 8d9605def3 delete shit 2017-05-10 07:10:23 +00:00
Chris MacLeod c9b72206a5 Consistency, formatting, error checking, cleanup, and a couple bug fixes (#245)
* Checkpoint: it builds

The config, db, model, network, os, and public packages have had some
fixes to glaringly obvious flaws, dead code removed, and stylistic
changes.

* Style changes and old code removal in router

Router needs a lot of work done to its (lack of) error handling.

* Dead code removal and style changes

Now up to util/email/email.go. After I'm finished with the initial sweep
I'll go back and fix error handling and security issues. Then I'll fix
the broken API. Then I'll go through to add documentation and fix code
visibility.

* Finish dead code removal and style changes

Vendored libraries not touched. Everything still needs security fixes
and documentation. There's also one case of broken functionality.

* Fix accidental find-and-replace

* Style, error checking, saftey, bug fix changes

* Redo error checking erased during merge

* Re-add merge-erased fix. Make Safe safe.
2017-05-09 21:34:40 -05:00
sfan5 5d36bba34d Make comments work 2017-05-08 22:50:56 +02:00
sfan5 a3d13f768a Switch to new schema: make it compile 2017-05-08 22:50:56 +02:00
Andrew Zhao b232018e6b initial implementation of making comments 2017-05-07 20:34:12 -07:00
Andrew Zhao 2e3c45cbc7 implemented comments and display 2017-05-07 19:06:11 -07:00
akuma06 148f70b53f Models for User, Role and Comment
modelHelper for getting value from request and apply it to a Form
Getting value from a Form and apply to a Model
2017-05-06 17:55:02 +02:00