This commit is contained in:
Maurizio Porrato 2021-05-16 20:11:45 +01:00
parent 62cc02cffe
commit 552bde1787
Signed by: guru
GPG Key ID: C622977DF024AC24
2 changed files with 5 additions and 7 deletions

View File

@ -45,12 +45,10 @@ There are a few command line flags that can be used to change the behaviour of t
interface
- `-store $driver_name:$driver_args`: changes the datastore driver and its configuration. `$driver_name` is the name of
the store driver while `$driver_args` contains driver-specific settings. Currently, only two drivers are implemented:
- `mem`: a volatile RAM-backed datastore only useful for testing and debugging. It does not take any arguments
(i.e.: it can be only used by specifying `-store mem`).
- `fs`: the default driver: it stores sync data in json files in the directory specified as the argument (default is
`data`)
- `-maxsize $size`: changes the maximum size of a sync (in bytes) that can be accepted by the API. The default is set
to 512000.

View File

@ -20,7 +20,7 @@ const defaultMaxSyncSize = 512000
type serviceInfoResp struct {
Version string `json:"version"`
Message string `json:"message"`
MaxSyncSize int `json:"maxSyncSize"`
MaxSyncSize int `json:"maxSyncSize"`
Status int `json:"status"`
}
@ -88,9 +88,9 @@ func info(w http.ResponseWriter, req *http.Request) {
} else {
log.Println("info()")
serviceInfo := serviceInfoResp{
Version: apiVersion,
Message: infoMessage,
Status: serviceStatus,
Version: apiVersion,
Message: infoMessage,
Status: serviceStatus,
MaxSyncSize: maxSyncSize}
sendJSONOk(w, serviceInfo)
}
@ -240,7 +240,7 @@ func init() {
case "mem":
storeDrv, err = syncstore.NewMemStore()
default:
err = fmt.Errorf("Invalid store driver: "+ storeFlagTokens[0])
err = fmt.Errorf("Invalid store driver: " + storeFlagTokens[0])
}
if err != nil {
log.Fatalf("store initialization failed: %v", err)