mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 06:17:56 +08:00
properly working filer
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"github.com/chrislusf/seaweedfs/weed/security"
|
||||
"github.com/chrislusf/seaweedfs/weed/util"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type SubmitResult struct {
|
||||
@@ -16,13 +17,14 @@ type SubmitResult struct {
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
func RegisterFile(filer string, path string, fileId string, secret security.Secret) error {
|
||||
func RegisterFile(filer string, path string, fileId string, fileSize int64, secret security.Secret) error {
|
||||
// TODO: jwt need to be used
|
||||
_ = security.GenJwt(secret, fileId)
|
||||
|
||||
values := make(url.Values)
|
||||
values.Add("path", path)
|
||||
values.Add("fileId", fileId)
|
||||
values.Add("fileSize", strconv.FormatInt(fileSize, 10))
|
||||
_, err := util.Post("http://"+filer+"/admin/register", values)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Failed to register path %s on filer %s to file id %s : %v", path, filer, fileId, err)
|
||||
|
Reference in New Issue
Block a user