Added POST method to upload files into NeoFS through HTTP Gate
- Updated README - Added method to upload files into NeoFS - HTTP Upload Header Filter loaded from settings - Added `HeaderFilter` that filters headers (object attributes) Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
This commit is contained in:
parent
67684c5d8a
commit
462de45e12
5 changed files with 257 additions and 3 deletions
15
settings.go
15
settings.go
|
@ -16,8 +16,7 @@ import (
|
|||
type empty int
|
||||
|
||||
const (
|
||||
devNull = empty(0)
|
||||
generated = "generated"
|
||||
devNull = empty(0)
|
||||
|
||||
defaultRebalanceTimer = 15 * time.Second
|
||||
defaultRequestTimeout = 15 * time.Second
|
||||
|
@ -54,6 +53,11 @@ const (
|
|||
cfgLoggerSamplingInitial = "logger.sampling.initial"
|
||||
cfgLoggerSamplingThereafter = "logger.sampling.thereafter"
|
||||
|
||||
// Uploader Header
|
||||
cfgUploaderHeader = "uploader_header"
|
||||
cfgUploaderHeaderKey = "key"
|
||||
cfgUploaderHeaderVal = "val"
|
||||
|
||||
// Peers
|
||||
cfgPeers = "peers"
|
||||
|
||||
|
@ -179,6 +183,13 @@ func settings() *viper.Viper {
|
|||
fmt.Printf("%s_%s_[N]_ADDRESS = string\n", Prefix, strings.ToUpper(cfgPeers))
|
||||
fmt.Printf("%s_%s_[N]_WEIGHT = 0..1 (float)\n", Prefix, strings.ToUpper(cfgPeers))
|
||||
|
||||
fmt.Println()
|
||||
fmt.Println("Upload Header Table:")
|
||||
fmt.Println()
|
||||
|
||||
fmt.Printf("%s_%s_[N]_%s = string\n", Prefix, strings.ToUpper(cfgUploaderHeader), strings.ToUpper(cfgUploaderHeaderKey))
|
||||
fmt.Printf("%s_%s_[N]_%s = string\n", Prefix, strings.ToUpper(cfgUploaderHeader), strings.ToUpper(cfgUploaderHeaderVal))
|
||||
|
||||
os.Exit(0)
|
||||
case version != nil && *version:
|
||||
fmt.Printf("NeoFS HTTP Gateway %s (%s)\n", Version, Build)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue