2021-11-06 10:38:52 +00:00
|
|
|
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.
|
2022-03-02 08:43:54 +00:00
|
|
|
func Details(empty bool) []status.Detail {
|
|
|
|
var res []status.Detail
|
2021-11-06 10:38:52 +00:00
|
|
|
|
|
|
|
if !empty {
|
|
|
|
res = append(res,
|
2022-03-02 08:43:54 +00:00
|
|
|
*Detail(false),
|
|
|
|
*Detail(false),
|
2021-11-06 10:38:52 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
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")
|
2022-01-25 12:11:32 +00:00
|
|
|
status.SetStatusDetails(m, Details(false))
|
2021-11-06 10:38:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return m
|
|
|
|
}
|