package files import ( "time" "git.aiterp.net/rpdata/api/models" ) // Insert manually inserts file information into the database. This should never, ever be HTTP API accessible func Insert(name, kind, mimeType, author string, time time.Time, size int64, url string) (models.File, error) { file := models.File{ ID: makeID(), Kind: kind, Time: time, Public: false, Author: author, Name: name, MimeType: mimeType, Size: size, URL: url, } err := collection.Insert(file) if err != nil { return models.File{}, err } return file, nil }