version 0.9.0 and fix stdout hex encoding
This commit is contained in:
parent
c310d993bb
commit
f749941ca0
@ -56,7 +56,7 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
zap.L().Info("magneticod v0.8.2 has been started.")
|
||||
zap.L().Info("magneticod v0.9.0 has been started.")
|
||||
zap.L().Info("Copyright (C) 2017-2019 Mert Bora ALPER <bora@boramalper.org>.")
|
||||
zap.L().Info("Dedicated to Cemile Binay, in whose hands I thrived.")
|
||||
zap.S().Infof("Compiled on %s", compiledOn)
|
||||
|
@ -61,7 +61,7 @@ func main() {
|
||||
defer logger.Sync()
|
||||
zap.ReplaceGlobals(logger)
|
||||
|
||||
zap.L().Info("magneticow v0.8.2 has been started.")
|
||||
zap.L().Info("magneticow v0.9.0 has been started.")
|
||||
zap.L().Info("Copyright (C) 2017-2019 Mert Bora ALPER <bora@boramalper.org>.")
|
||||
zap.L().Info("Dedicated to Cemile Binay, in whose hands I thrived.")
|
||||
zap.S().Infof("Compiled on %s", compiledOn)
|
||||
|
@ -5,3 +5,15 @@
|
||||
magnetico databases with different engines (currently, only SQLite).
|
||||
|
||||
**For REST-ful magneticow API, see [https://app.swaggerhub.com/apis/boramalper/magneticow-api/](https://app.swaggerhub.com/apis/boramalper/magneticow-api/).**
|
||||
|
||||
## Stdout Dummy Database Engine for magneticod
|
||||
|
||||
Stdout dummy database engine for **magneticod** prints a new [JSON Line](http://jsonlines.org/)
|
||||
for each discovered torrent so that you can pipe the stdout of **magneticod** into some other
|
||||
program to build your own pipelines on the fly!
|
||||
|
||||
**Example Output**
|
||||
|
||||
```json
|
||||
|
||||
```
|
||||
|
@ -1,6 +1,7 @@
|
||||
package persistence
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"net/url"
|
||||
"os"
|
||||
@ -9,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
type out struct {
|
||||
InfoHash []byte `json:"infoHash"`
|
||||
InfoHash string `json:"infoHash"`
|
||||
Name string `json:"name"`
|
||||
Files []File `json:"files"`
|
||||
}
|
||||
@ -41,7 +42,7 @@ func (s *stdout) DoesTorrentExist(infoHash []byte) (bool, error) {
|
||||
|
||||
func (s *stdout) AddNewTorrent(infoHash []byte, name string, files []File) error {
|
||||
err := s.encoder.Encode(out{
|
||||
InfoHash: infoHash,
|
||||
InfoHash: hex.EncodeToString(infoHash),
|
||||
Name: name,
|
||||
Files: files,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user