All checks were successful
* Add plugin option for protogen in Makefile * Fix the generator for the plugin in util/protogen * Erase convertable types, move helpful methods to gRPC protobufs * Erase helpers for convertations * Generate StableMarshlal/StableSize for protobufs by the protoc plugin Signed-off-by: Airat Arifullin a.arifullin@yadro.com
44 lines
848 B
Go
44 lines
848 B
Go
package statustest
|
|
|
|
import (
|
|
status "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/status/grpc"
|
|
)
|
|
|
|
// Detail returns status.Detail filled with static random values.
|
|
func Detail(empty bool) *status.Status_Detail {
|
|
m := new(status.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.Status_Detail {
|
|
var res []*status.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")
|
|
status.SetStatusDetails(m, Details(false))
|
|
}
|
|
|
|
return m
|
|
}
|