50 lines
1.3 KiB
Go
50 lines
1.3 KiB
Go
package objectconfig
|
|
|
|
import (
|
|
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-node/config"
|
|
)
|
|
|
|
// PutConfig is a wrapper over "put" config section which provides access
|
|
// to object put pipeline configuration of object service.
|
|
type PutConfig struct {
|
|
cfg *config.Config
|
|
}
|
|
|
|
// GetConfig is a wrapper over "get" config section which provides access
|
|
// to object get pipeline configuration of object service.
|
|
type GetConfig struct {
|
|
cfg *config.Config
|
|
}
|
|
|
|
const (
|
|
subsection = "object"
|
|
|
|
putSubsection = "put"
|
|
getSubsection = "get"
|
|
)
|
|
|
|
// Put returns structure that provides access to "put" subsection of
|
|
// "object" section.
|
|
func Put(c *config.Config) PutConfig {
|
|
return PutConfig{
|
|
c.Sub(subsection).Sub(putSubsection),
|
|
}
|
|
}
|
|
|
|
// SkipSessionTokenIssuerVerification returns the value of "skip_session_token_issuer_verification" config parameter or `false“ if is not defined.
|
|
func (g PutConfig) SkipSessionTokenIssuerVerification() bool {
|
|
return config.BoolSafe(g.cfg, "skip_session_token_issuer_verification")
|
|
}
|
|
|
|
// Get returns structure that provides access to "get" subsection of
|
|
// "object" section.
|
|
func Get(c *config.Config) GetConfig {
|
|
return GetConfig{
|
|
c.Sub(subsection).Sub(getSubsection),
|
|
}
|
|
}
|
|
|
|
// Priority returns the value of "priority" config parameter.
|
|
func (g GetConfig) Priority() []string {
|
|
return config.StringSliceSafe(g.cfg, "priority")
|
|
}
|