frostfs-api-go/status/test/generate.go
Airat Arifullin bc16a32c24
All checks were successful
Tests and linters / Tests (1.19) (pull_request) Successful in 45s
Tests and linters / Lint (pull_request) Successful in 56s
Tests and linters / Tests (1.20) (pull_request) Successful in 2m3s
Tests and linters / Tests with -race (pull_request) Successful in 2m13s
[#40] types: Generate StableMarshaler/StableSize methods for protobufs
* 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
2023-07-10 12:08:48 +03:00

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
}