mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-17 02:47:51 +01:00
New endpoints: /warehouse/create Create a file in the warehouse /warehouse/create/path Create a file in the warehouse via copy /warehouse/read Read a file in the warehouse /warehouse/delete Delete a file in the warehouse
27 lines
597 B
Go
27 lines
597 B
Go
/*
|
|
File Name: Warehouse.go
|
|
Copyright: 2021 Peernet s.r.o.
|
|
Author: Peter Kleissner
|
|
*/
|
|
|
|
package core
|
|
|
|
import (
|
|
"github.com/PeernetOfficial/core/warehouse"
|
|
)
|
|
|
|
// UserWarehouse is the user's warehouse for storing files that are shared
|
|
var UserWarehouse *warehouse.Warehouse
|
|
|
|
// folderUserWarehouse is the folder of the user's warehouse
|
|
const folderUserWarehouse = "warehouse"
|
|
|
|
func initUserWarehouse() {
|
|
var err error
|
|
UserWarehouse, err = warehouse.Init(folderUserWarehouse)
|
|
|
|
if err != nil {
|
|
Filters.LogError("initUserWarehouse", "error: %s\n", err.Error())
|
|
}
|
|
}
|