forked from TrueCloudLab/frostfs-node
[#60] morph/netmap: Implement Epoch method on Client
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
a8481223d6
commit
20fb8547b6
2 changed files with 67 additions and 1 deletions
|
@ -36,7 +36,8 @@ type cfg struct {
|
|||
netMapMethod, // get network map method name
|
||||
snapshotMethod, // get network map snapshot method name
|
||||
updateStateMethod, // update state method name for invocation
|
||||
innerRingListMethod string // IR list method name for invocation
|
||||
innerRingListMethod, // IR list method name for invocation
|
||||
epochMethod string // get epoch number method name
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -46,6 +47,7 @@ const (
|
|||
defaultSnapshotMethod = "snapshot" // default get network map snapshot method name
|
||||
defaultUpdateStateMethod = "updateState" // default update state method name
|
||||
defaultInnerRIngListMethod = "innerRingList" // default IR list method name
|
||||
defaultEpochMethod = "epoch" // default get epoch number method name
|
||||
)
|
||||
|
||||
func defaultConfig() *cfg {
|
||||
|
@ -56,6 +58,7 @@ func defaultConfig() *cfg {
|
|||
snapshotMethod: defaultSnapshotMethod,
|
||||
updateStateMethod: defaultUpdateStateMethod,
|
||||
innerRingListMethod: defaultInnerRIngListMethod,
|
||||
epochMethod: defaultEpochMethod,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,3 +163,17 @@ func WithInnerRingListMethod(n string) Option {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WithEpochMethod returns a client constructor option that
|
||||
// specifies the method name of epoch number receiving operation.
|
||||
//
|
||||
// Ignores empty value.
|
||||
//
|
||||
// If option not provided, "epoch" is used.
|
||||
func WithEpochMethod(n string) Option {
|
||||
return func(c *cfg) {
|
||||
if n != "" {
|
||||
c.epochMethod = n
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue