Api/v1/statuses (#11)

This PR adds:
Statuses

    New status creation.
    View existing status
    Delete a status
    Fave a status
    Unfave a status
    See who's faved a status

Media

    Upload media attachment and store/retrieve it
    Upload custom emoji and store/retrieve it

Fileserver

    Serve files from storage

Testing

    Test models, testrig -- run a GTS test instance and play around with it.
This commit is contained in:
Tobi Smethurst
2021-04-19 19:42:19 +02:00
committed by GitHub
parent 71a49e2b43
commit 32c5fd987a
150 changed files with 9023 additions and 788 deletions

View File

@ -83,7 +83,17 @@ func (r *router) AttachMiddleware(middleware gin.HandlerFunc) {
// New returns a new Router with the specified configuration, using the given logrus logger.
func New(config *config.Config, logger *logrus.Logger) (Router, error) {
engine := gin.New()
lvl, err := logrus.ParseLevel(config.LogLevel)
if err != nil {
return nil, fmt.Errorf("couldn't parse log level %s to set router level: %s", config.LogLevel, err)
}
switch lvl {
case logrus.TraceLevel, logrus.DebugLevel:
gin.SetMode(gin.DebugMode)
default:
gin.SetMode(gin.ReleaseMode)
}
engine := gin.Default()
// create a new session store middleware
store, err := sessionStore()