[#60] object/put: Provide network State interface to formatter
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
b627814dd8
commit
16a5107ef1
2 changed files with 9 additions and 0 deletions
|
@ -40,6 +40,8 @@ type cfg struct {
|
|||
fmtValidator *object.FormatValidator
|
||||
|
||||
fmtValidatorOpts []object.FormatValidatorOption
|
||||
|
||||
networkState netmap.State
|
||||
}
|
||||
|
||||
func defaultCfg() *cfg {
|
||||
|
@ -116,3 +118,9 @@ func WithFormatValidatorOpts(v ...object.FormatValidatorOption) Option {
|
|||
c.fmtValidatorOpts = v
|
||||
}
|
||||
}
|
||||
|
||||
func WithNetworkState(v netmap.State) Option {
|
||||
return func(c *cfg) {
|
||||
c.networkState = v
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,6 +73,7 @@ func (p *Streamer) initTarget(prm *PutInitPrm) error {
|
|||
Key: sessionKey,
|
||||
NextTarget: p.newCommonTarget(prm),
|
||||
SessionToken: sToken,
|
||||
NetworkState: p.networkState,
|
||||
})
|
||||
},
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue