forked from TrueCloudLab/frostfs-api-go
Re-compile NeoFS API proto files using updated script
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
180da74e5c
commit
0f09f0dfc6
33 changed files with 2694 additions and 2707 deletions
44
status/test/generate.go
Normal file
44
status/test/generate.go
Normal file
|
@ -0,0 +1,44 @@
|
|||
package statustest
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/status"
|
||||
)
|
||||
|
||||
// Detail returns status.Detail filled with static random values.
|
||||
func Detail(empty bool) *status.Detail {
|
||||
m := new(status.Detail)
|
||||
|
||||
if !empty {
|
||||
m.SetID(345)
|
||||
m.SetValue([]byte("value"))
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
// Details returns several status.Detail messages filled with static random values.
|
||||
func Details(empty bool) []*status.Detail {
|
||||
var res []*status.Detail
|
||||
|
||||
if !empty {
|
||||
res = append(res,
|
||||
Detail(false),
|
||||
Detail(false),
|
||||
)
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
// Status returns status.Status messages filled with static random values.
|
||||
func Status(empty bool) *status.Status {
|
||||
m := new(status.Status)
|
||||
|
||||
if !empty {
|
||||
m.SetCode(765)
|
||||
m.SetMessage("some string")
|
||||
m.SetDetails(Details(false))
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue