diff --git a/example/weather/services/forecaster/gen/forecaster/client.go b/example/weather/services/forecaster/gen/forecaster/client.go index 96018f29..8bf42e5c 100644 --- a/example/weather/services/forecaster/gen/forecaster/client.go +++ b/example/weather/services/forecaster/gen/forecaster/client.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // Forecaster client // diff --git a/example/weather/services/forecaster/gen/forecaster/endpoints.go b/example/weather/services/forecaster/gen/forecaster/endpoints.go index 95b2c2f3..5cebdc34 100644 --- a/example/weather/services/forecaster/gen/forecaster/endpoints.go +++ b/example/weather/services/forecaster/gen/forecaster/endpoints.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // Forecaster endpoints // diff --git a/example/weather/services/forecaster/gen/forecaster/service.go b/example/weather/services/forecaster/gen/forecaster/service.go index eac56181..2d878004 100644 --- a/example/weather/services/forecaster/gen/forecaster/service.go +++ b/example/weather/services/forecaster/gen/forecaster/service.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // Forecaster service // @@ -18,14 +18,17 @@ type Service interface { Forecast(context.Context, *ForecastPayload) (res *Forecast2, err error) } +// APIName is the name of the API as defined in the design. +const APIName = "Weather Service API" + +// APIVersion is the version of the API as defined in the design. +const APIVersion = "1.0.0" + // ServiceName is the name of the service as defined in the design. This is the // same value that is set in the endpoint request contexts under the ServiceKey // key. const ServiceName = "Forecaster" -// APIVersion is the version of the API as defined in the design. -const APIVersion = "1.0.0" - // MethodNames lists the service method names as defined in the design. These // are the same values that are set in the endpoint request contexts under the // MethodKey key. diff --git a/example/weather/services/forecaster/gen/grpc/cli/weather_service_api/cli.go b/example/weather/services/forecaster/gen/grpc/cli/weather_service_api/cli.go index 0cb7cbce..c39f6dd6 100644 --- a/example/weather/services/forecaster/gen/grpc/cli/weather_service_api/cli.go +++ b/example/weather/services/forecaster/gen/grpc/cli/weather_service_api/cli.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // Weather Service API gRPC client CLI support package // @@ -37,7 +37,10 @@ func UsageExamples() string { // ParseEndpoint returns the endpoint and payload as specified on the command // line. -func ParseEndpoint(cc *grpc.ClientConn, opts ...grpc.CallOption) (goa.Endpoint, any, error) { +func ParseEndpoint( + cc *grpc.ClientConn, + opts ...grpc.CallOption, +) (goa.Endpoint, any, error) { var ( forecasterFlags = flag.NewFlagSet("forecaster", flag.ContinueOnError) @@ -109,6 +112,7 @@ func ParseEndpoint(cc *grpc.ClientConn, opts ...grpc.CallOption) (goa.Endpoint, case "forecaster": c := forecasterc.NewClient(cc, opts...) switch epn { + case "forecast": endpoint = c.Forecast() data, err = forecasterc.BuildForecastPayload(*forecasterForecastMessageFlag) diff --git a/example/weather/services/forecaster/gen/grpc/forecaster/client/cli.go b/example/weather/services/forecaster/gen/grpc/forecaster/client/cli.go index 366925a4..e407885a 100644 --- a/example/weather/services/forecaster/gen/grpc/forecaster/client/cli.go +++ b/example/weather/services/forecaster/gen/grpc/forecaster/client/cli.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // Forecaster gRPC client CLI support package // diff --git a/example/weather/services/forecaster/gen/grpc/forecaster/client/client.go b/example/weather/services/forecaster/gen/grpc/forecaster/client/client.go index b65f6f9e..2a1fba88 100644 --- a/example/weather/services/forecaster/gen/grpc/forecaster/client/client.go +++ b/example/weather/services/forecaster/gen/grpc/forecaster/client/client.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // Forecaster gRPC client // @@ -21,17 +21,13 @@ import ( type Client struct { grpccli forecasterpb.ForecasterClient opts []grpc.CallOption -} - -// NewClient instantiates gRPC client for all the Forecaster service servers. +} // NewClient instantiates gRPC client for all the Forecaster service servers. func NewClient(cc *grpc.ClientConn, opts ...grpc.CallOption) *Client { return &Client{ grpccli: forecasterpb.NewForecasterClient(cc), opts: opts, } -} - -// Forecast calls the "Forecast" function in forecasterpb.ForecasterClient +} // Forecast calls the "Forecast" function in forecasterpb.ForecasterClient // interface. func (c *Client) Forecast() goa.Endpoint { return func(ctx context.Context, v any) (any, error) { @@ -41,7 +37,7 @@ func (c *Client) Forecast() goa.Endpoint { DecodeForecastResponse) res, err := inv.Invoke(ctx, v) if err != nil { - return nil, goa.Fault(err.Error()) + return nil, goa.Fault("%s", err.Error()) } return res, nil } diff --git a/example/weather/services/forecaster/gen/grpc/forecaster/client/encode_decode.go b/example/weather/services/forecaster/gen/grpc/forecaster/client/encode_decode.go index 13cc8b13..c5813ef7 100644 --- a/example/weather/services/forecaster/gen/grpc/forecaster/client/encode_decode.go +++ b/example/weather/services/forecaster/gen/grpc/forecaster/client/encode_decode.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // Forecaster gRPC client encoders and decoders // diff --git a/example/weather/services/forecaster/gen/grpc/forecaster/client/types.go b/example/weather/services/forecaster/gen/grpc/forecaster/client/types.go index 73ed15ac..6e5a8364 100644 --- a/example/weather/services/forecaster/gen/grpc/forecaster/client/types.go +++ b/example/weather/services/forecaster/gen/grpc/forecaster/client/types.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // Forecaster gRPC client types // diff --git a/example/weather/services/forecaster/gen/grpc/forecaster/pb/goagen_forecaster_forecaster.pb.go b/example/weather/services/forecaster/gen/grpc/forecaster/pb/goagen_forecaster_forecaster.pb.go index 6cac398b..10e434f9 100644 --- a/example/weather/services/forecaster/gen/grpc/forecaster/pb/goagen_forecaster_forecaster.pb.go +++ b/example/weather/services/forecaster/gen/grpc/forecaster/pb/goagen_forecaster_forecaster.pb.go @@ -1,4 +1,4 @@ -// Code generated with goa v3.14.4, DO NOT EDIT. +// Code generated with goa v3.20.0, DO NOT EDIT. // // Forecaster protocol buffer definition // @@ -8,8 +8,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v4.25.1 +// protoc-gen-go v1.36.5 +// protoc v5.29.3 // source: goagen_forecaster_forecaster.proto package forecasterpb @@ -19,6 +19,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -29,23 +30,20 @@ const ( ) type ForecastRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Latitude Lat float64 `protobuf:"fixed64,1,opt,name=lat,proto3" json:"lat,omitempty"` // Longitude - Long float64 `protobuf:"fixed64,2,opt,name=long,proto3" json:"long,omitempty"` + Long float64 `protobuf:"fixed64,2,opt,name=long,proto3" json:"long,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ForecastRequest) Reset() { *x = ForecastRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_forecaster_forecaster_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_forecaster_forecaster_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ForecastRequest) String() string { @@ -56,7 +54,7 @@ func (*ForecastRequest) ProtoMessage() {} func (x *ForecastRequest) ProtoReflect() protoreflect.Message { mi := &file_goagen_forecaster_forecaster_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -86,23 +84,20 @@ func (x *ForecastRequest) GetLong() float64 { } type ForecastResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Forecast location Location *Location `protobuf:"bytes,1,opt,name=location,proto3" json:"location,omitempty"` // Weather forecast periods - Periods []*Period `protobuf:"bytes,2,rep,name=periods,proto3" json:"periods,omitempty"` + Periods []*Period `protobuf:"bytes,2,rep,name=periods,proto3" json:"periods,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ForecastResponse) Reset() { *x = ForecastResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_forecaster_forecaster_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_forecaster_forecaster_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ForecastResponse) String() string { @@ -113,7 +108,7 @@ func (*ForecastResponse) ProtoMessage() {} func (x *ForecastResponse) ProtoReflect() protoreflect.Message { mi := &file_goagen_forecaster_forecaster_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -144,10 +139,7 @@ func (x *ForecastResponse) GetPeriods() []*Period { // Geographical location type Location struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Latitude Lat float64 `protobuf:"fixed64,1,opt,name=lat,proto3" json:"lat,omitempty"` // Longitude @@ -155,16 +147,16 @@ type Location struct { // City City string `protobuf:"bytes,3,opt,name=city,proto3" json:"city,omitempty"` // State - State string `protobuf:"bytes,4,opt,name=state,proto3" json:"state,omitempty"` + State string `protobuf:"bytes,4,opt,name=state,proto3" json:"state,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Location) Reset() { *x = Location{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_forecaster_forecaster_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_forecaster_forecaster_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Location) String() string { @@ -175,7 +167,7 @@ func (*Location) ProtoMessage() {} func (x *Location) ProtoReflect() protoreflect.Message { mi := &file_goagen_forecaster_forecaster_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -220,10 +212,7 @@ func (x *Location) GetState() string { // Weather forecast period type Period struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Period name Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Start time @@ -235,16 +224,16 @@ type Period struct { // Temperature unit TemperatureUnit string `protobuf:"bytes,5,opt,name=temperature_unit,json=temperatureUnit,proto3" json:"temperature_unit,omitempty"` // Summary - Summary string `protobuf:"bytes,6,opt,name=summary,proto3" json:"summary,omitempty"` + Summary string `protobuf:"bytes,6,opt,name=summary,proto3" json:"summary,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *Period) Reset() { *x = Period{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_forecaster_forecaster_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_forecaster_forecaster_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Period) String() string { @@ -255,7 +244,7 @@ func (*Period) ProtoMessage() {} func (x *Period) ProtoReflect() protoreflect.Message { mi := &file_goagen_forecaster_forecaster_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -314,7 +303,7 @@ func (x *Period) GetSummary() string { var File_goagen_forecaster_forecaster_proto protoreflect.FileDescriptor -var file_goagen_forecaster_forecaster_proto_rawDesc = []byte{ +var file_goagen_forecaster_forecaster_proto_rawDesc = string([]byte{ 0x0a, 0x22, 0x67, 0x6f, 0x61, 0x67, 0x65, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x65, 0x63, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x66, 0x6f, 0x72, 0x65, 0x63, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x66, 0x6f, 0x72, 0x65, 0x63, 0x61, 0x73, 0x74, 0x65, 0x72, @@ -354,22 +343,22 @@ var file_goagen_forecaster_forecaster_proto_rawDesc = []byte{ 0x72, 0x65, 0x63, 0x61, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0f, 0x5a, 0x0d, 0x2f, 0x66, 0x6f, 0x72, 0x65, 0x63, 0x61, 0x73, 0x74, 0x65, 0x72, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +}) var ( file_goagen_forecaster_forecaster_proto_rawDescOnce sync.Once - file_goagen_forecaster_forecaster_proto_rawDescData = file_goagen_forecaster_forecaster_proto_rawDesc + file_goagen_forecaster_forecaster_proto_rawDescData []byte ) func file_goagen_forecaster_forecaster_proto_rawDescGZIP() []byte { file_goagen_forecaster_forecaster_proto_rawDescOnce.Do(func() { - file_goagen_forecaster_forecaster_proto_rawDescData = protoimpl.X.CompressGZIP(file_goagen_forecaster_forecaster_proto_rawDescData) + file_goagen_forecaster_forecaster_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_goagen_forecaster_forecaster_proto_rawDesc), len(file_goagen_forecaster_forecaster_proto_rawDesc))) }) return file_goagen_forecaster_forecaster_proto_rawDescData } var file_goagen_forecaster_forecaster_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_goagen_forecaster_forecaster_proto_goTypes = []interface{}{ +var file_goagen_forecaster_forecaster_proto_goTypes = []any{ (*ForecastRequest)(nil), // 0: forecaster.ForecastRequest (*ForecastResponse)(nil), // 1: forecaster.ForecastResponse (*Location)(nil), // 2: forecaster.Location @@ -392,61 +381,11 @@ func file_goagen_forecaster_forecaster_proto_init() { if File_goagen_forecaster_forecaster_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_goagen_forecaster_forecaster_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForecastRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goagen_forecaster_forecaster_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForecastResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goagen_forecaster_forecaster_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Location); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goagen_forecaster_forecaster_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Period); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_goagen_forecaster_forecaster_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_goagen_forecaster_forecaster_proto_rawDesc), len(file_goagen_forecaster_forecaster_proto_rawDesc)), NumEnums: 0, NumMessages: 4, NumExtensions: 0, @@ -457,7 +396,6 @@ func file_goagen_forecaster_forecaster_proto_init() { MessageInfos: file_goagen_forecaster_forecaster_proto_msgTypes, }.Build() File_goagen_forecaster_forecaster_proto = out.File - file_goagen_forecaster_forecaster_proto_rawDesc = nil file_goagen_forecaster_forecaster_proto_goTypes = nil file_goagen_forecaster_forecaster_proto_depIdxs = nil } diff --git a/example/weather/services/forecaster/gen/grpc/forecaster/pb/goagen_forecaster_forecaster.proto b/example/weather/services/forecaster/gen/grpc/forecaster/pb/goagen_forecaster_forecaster.proto index 77655d94..0142b71d 100644 --- a/example/weather/services/forecaster/gen/grpc/forecaster/pb/goagen_forecaster_forecaster.proto +++ b/example/weather/services/forecaster/gen/grpc/forecaster/pb/goagen_forecaster_forecaster.proto @@ -1,4 +1,4 @@ -// Code generated with goa v3.14.4, DO NOT EDIT. +// Code generated with goa v3.20.0, DO NOT EDIT. // // Forecaster protocol buffer definition // diff --git a/example/weather/services/forecaster/gen/grpc/forecaster/pb/goagen_forecaster_forecaster_grpc.pb.go b/example/weather/services/forecaster/gen/grpc/forecaster/pb/goagen_forecaster_forecaster_grpc.pb.go index 5e4d5917..624830c3 100644 --- a/example/weather/services/forecaster/gen/grpc/forecaster/pb/goagen_forecaster_forecaster_grpc.pb.go +++ b/example/weather/services/forecaster/gen/grpc/forecaster/pb/goagen_forecaster_forecaster_grpc.pb.go @@ -1,7 +1,15 @@ +// Code generated with goa v3.20.0, DO NOT EDIT. +// +// Forecaster protocol buffer definition +// +// Command: +// $ goa gen goa.design/clue/example/weather/services/forecaster/design -o +// services/forecaster + // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v4.25.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.3 // source: goagen_forecaster_forecaster.proto package forecasterpb @@ -15,12 +23,18 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Forecaster_Forecast_FullMethodName = "/forecaster.Forecaster/Forecast" +) // ForecasterClient is the client API for Forecaster service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Service that provides weather forecasts type ForecasterClient interface { // Retrieve weather forecast for a given location Forecast(ctx context.Context, in *ForecastRequest, opts ...grpc.CallOption) (*ForecastResponse, error) @@ -35,8 +49,9 @@ func NewForecasterClient(cc grpc.ClientConnInterface) ForecasterClient { } func (c *forecasterClient) Forecast(ctx context.Context, in *ForecastRequest, opts ...grpc.CallOption) (*ForecastResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ForecastResponse) - err := c.cc.Invoke(ctx, "/forecaster.Forecaster/Forecast", in, out, opts...) + err := c.cc.Invoke(ctx, Forecaster_Forecast_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -45,21 +60,27 @@ func (c *forecasterClient) Forecast(ctx context.Context, in *ForecastRequest, op // ForecasterServer is the server API for Forecaster service. // All implementations must embed UnimplementedForecasterServer -// for forward compatibility +// for forward compatibility. +// +// Service that provides weather forecasts type ForecasterServer interface { // Retrieve weather forecast for a given location Forecast(context.Context, *ForecastRequest) (*ForecastResponse, error) mustEmbedUnimplementedForecasterServer() } -// UnimplementedForecasterServer must be embedded to have forward compatible implementations. -type UnimplementedForecasterServer struct { -} +// UnimplementedForecasterServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedForecasterServer struct{} func (UnimplementedForecasterServer) Forecast(context.Context, *ForecastRequest) (*ForecastResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Forecast not implemented") } func (UnimplementedForecasterServer) mustEmbedUnimplementedForecasterServer() {} +func (UnimplementedForecasterServer) testEmbeddedByValue() {} // UnsafeForecasterServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ForecasterServer will @@ -69,6 +90,13 @@ type UnsafeForecasterServer interface { } func RegisterForecasterServer(s grpc.ServiceRegistrar, srv ForecasterServer) { + // If the following call pancis, it indicates UnimplementedForecasterServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Forecaster_ServiceDesc, srv) } @@ -82,7 +110,7 @@ func _Forecaster_Forecast_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/forecaster.Forecaster/Forecast", + FullMethod: Forecaster_Forecast_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ForecasterServer).Forecast(ctx, req.(*ForecastRequest)) diff --git a/example/weather/services/forecaster/gen/grpc/forecaster/server/encode_decode.go b/example/weather/services/forecaster/gen/grpc/forecaster/server/encode_decode.go index fe79258f..52112ae4 100644 --- a/example/weather/services/forecaster/gen/grpc/forecaster/server/encode_decode.go +++ b/example/weather/services/forecaster/gen/grpc/forecaster/server/encode_decode.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // Forecaster gRPC server encoders and decoders // diff --git a/example/weather/services/forecaster/gen/grpc/forecaster/server/server.go b/example/weather/services/forecaster/gen/grpc/forecaster/server/server.go index 8d772baf..8359632b 100644 --- a/example/weather/services/forecaster/gen/grpc/forecaster/server/server.go +++ b/example/weather/services/forecaster/gen/grpc/forecaster/server/server.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // Forecaster gRPC server // diff --git a/example/weather/services/forecaster/gen/grpc/forecaster/server/types.go b/example/weather/services/forecaster/gen/grpc/forecaster/server/types.go index 86e88791..437395da 100644 --- a/example/weather/services/forecaster/gen/grpc/forecaster/server/types.go +++ b/example/weather/services/forecaster/gen/grpc/forecaster/server/types.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // Forecaster gRPC server types // diff --git a/example/weather/services/front/gen/front/client.go b/example/weather/services/front/gen/front/client.go index 6eec5949..9ea0f9b9 100644 --- a/example/weather/services/front/gen/front/client.go +++ b/example/weather/services/front/gen/front/client.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // front client // diff --git a/example/weather/services/front/gen/front/endpoints.go b/example/weather/services/front/gen/front/endpoints.go index 3ab0575c..48c499ad 100644 --- a/example/weather/services/front/gen/front/endpoints.go +++ b/example/weather/services/front/gen/front/endpoints.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // front endpoints // diff --git a/example/weather/services/front/gen/front/service.go b/example/weather/services/front/gen/front/service.go index 8a48299b..82d45c13 100644 --- a/example/weather/services/front/gen/front/service.go +++ b/example/weather/services/front/gen/front/service.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // front service // @@ -26,14 +26,17 @@ type Service interface { TestSmoke(context.Context) (res *TestResults, err error) } +// APIName is the name of the API as defined in the design. +const APIName = "Weather" + +// APIVersion is the version of the API as defined in the design. +const APIVersion = "1.0.0" + // ServiceName is the name of the service as defined in the design. This is the // same value that is set in the endpoint request contexts under the ServiceKey // key. const ServiceName = "front" -// APIVersion is the version of the API as defined in the design. -const APIVersion = "1.0.0" - // MethodNames lists the service method names as defined in the design. These // are the same values that are set in the endpoint request contexts under the // MethodKey key. diff --git a/example/weather/services/front/gen/http/cli/weather/cli.go b/example/weather/services/front/gen/http/cli/weather/cli.go index f27c35ce..509ac293 100644 --- a/example/weather/services/front/gen/http/cli/weather/cli.go +++ b/example/weather/services/front/gen/http/cli/weather/cli.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // Weather HTTP client CLI support package // @@ -134,7 +134,6 @@ func ParseEndpoint( data, err = frontc.BuildTestAllPayload(*frontTestAllBodyFlag) case "test-smoke": endpoint = c.TestSmoke() - data = nil } } } @@ -180,12 +179,16 @@ Endpoint for running ALL API Integration Tests for the Weather System, allowing Example: %[1]s front test-all --body '{ "exclude": [ - "Repudiandae enim molestiae.", - "Ut id iure." + "Veritatis vel inventore voluptatem ab nulla.", + "In optio sed id.", + "Tenetur repellendus commodi asperiores.", + "Quaerat omnis vel quia ab dolorem qui." ], "include": [ - "Dolor sunt maiores.", - "Asperiores omnis ducimus ad et mollitia." + "Consectetur eos nihil accusamus reiciendis eligendi.", + "Aut autem non.", + "Aperiam possimus assumenda commodi aut facilis provident.", + "Aspernatur voluptatem et placeat deserunt." ] }' `, os.Args[0]) diff --git a/example/weather/services/front/gen/http/front/client/cli.go b/example/weather/services/front/gen/http/front/client/cli.go index 39cec098..fe2164dd 100644 --- a/example/weather/services/front/gen/http/front/client/cli.go +++ b/example/weather/services/front/gen/http/front/client/cli.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // front HTTP client CLI support package // @@ -23,7 +23,7 @@ func BuildTestAllPayload(frontTestAllBody string) (*front.TestAllPayload, error) { err = json.Unmarshal([]byte(frontTestAllBody), &body) if err != nil { - return nil, fmt.Errorf("invalid JSON for body, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"exclude\": [\n \"Repudiandae enim molestiae.\",\n \"Ut id iure.\"\n ],\n \"include\": [\n \"Dolor sunt maiores.\",\n \"Asperiores omnis ducimus ad et mollitia.\"\n ]\n }'") + return nil, fmt.Errorf("invalid JSON for body, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"exclude\": [\n \"Veritatis vel inventore voluptatem ab nulla.\",\n \"In optio sed id.\",\n \"Tenetur repellendus commodi asperiores.\",\n \"Quaerat omnis vel quia ab dolorem qui.\"\n ],\n \"include\": [\n \"Consectetur eos nihil accusamus reiciendis eligendi.\",\n \"Aut autem non.\",\n \"Aperiam possimus assumenda commodi aut facilis provident.\",\n \"Aspernatur voluptatem et placeat deserunt.\"\n ]\n }'") } } v := &front.TestAllPayload{} diff --git a/example/weather/services/front/gen/http/front/client/client.go b/example/weather/services/front/gen/http/front/client/client.go index 97366a81..7ac51ce4 100644 --- a/example/weather/services/front/gen/http/front/client/client.go +++ b/example/weather/services/front/gen/http/front/client/client.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // front client HTTP transport // diff --git a/example/weather/services/front/gen/http/front/client/encode_decode.go b/example/weather/services/front/gen/http/front/client/encode_decode.go index 6f089032..ea16fe0a 100644 --- a/example/weather/services/front/gen/http/front/client/encode_decode.go +++ b/example/weather/services/front/gen/http/front/client/encode_decode.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // front HTTP client encoders and decoders // diff --git a/example/weather/services/front/gen/http/front/client/paths.go b/example/weather/services/front/gen/http/front/client/paths.go index 877ed079..e5a5226a 100644 --- a/example/weather/services/front/gen/http/front/client/paths.go +++ b/example/weather/services/front/gen/http/front/client/paths.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // HTTP request path constructors for the front service. // diff --git a/example/weather/services/front/gen/http/front/client/types.go b/example/weather/services/front/gen/http/front/client/types.go index 58f1d0cb..300e3c26 100644 --- a/example/weather/services/front/gen/http/front/client/types.go +++ b/example/weather/services/front/gen/http/front/client/types.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // front HTTP client types // diff --git a/example/weather/services/front/gen/http/front/server/encode_decode.go b/example/weather/services/front/gen/http/front/server/encode_decode.go index f39aa48f..a5c1e0a4 100644 --- a/example/weather/services/front/gen/http/front/server/encode_decode.go +++ b/example/weather/services/front/gen/http/front/server/encode_decode.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // front HTTP server encoders and decoders // @@ -106,6 +106,10 @@ func DecodeTestAllRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp if err == io.EOF { return nil, goa.MissingPayloadError() } + var gerr *goa.ServiceError + if errors.As(err, &gerr) { + return nil, gerr + } return nil, goa.DecodePayloadError(err.Error()) } payload := NewTestAllPayload(&body) diff --git a/example/weather/services/front/gen/http/front/server/paths.go b/example/weather/services/front/gen/http/front/server/paths.go index d4343b0c..d4154578 100644 --- a/example/weather/services/front/gen/http/front/server/paths.go +++ b/example/weather/services/front/gen/http/front/server/paths.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // HTTP request path constructors for the front service. // diff --git a/example/weather/services/front/gen/http/front/server/server.go b/example/weather/services/front/gen/http/front/server/server.go index 989d9f1b..0440ee15 100644 --- a/example/weather/services/front/gen/http/front/server/server.go +++ b/example/weather/services/front/gen/http/front/server/server.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // front HTTP server // @@ -12,6 +12,7 @@ import ( "context" "net/http" + otelhttp "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" front "goa.design/clue/example/weather/services/front/gen/front" goahttp "goa.design/goa/v3/http" goa "goa.design/goa/v3/pkg" @@ -96,7 +97,7 @@ func MountForecastHandler(mux goahttp.Muxer, h http.Handler) { h.ServeHTTP(w, r) } } - mux.Handle("GET", "/forecast/{ip}", f) + mux.Handle("GET", "/forecast/{ip}", otelhttp.WithRouteTag("/forecast/{ip}", f).ServeHTTP) } // NewForecastHandler creates a HTTP handler which loads the HTTP request and @@ -147,7 +148,7 @@ func MountTestAllHandler(mux goahttp.Muxer, h http.Handler) { h.ServeHTTP(w, r) } } - mux.Handle("POST", "/tester/all", f) + mux.Handle("POST", "/tester/all", otelhttp.WithRouteTag("/tester/all", f).ServeHTTP) } // NewTestAllHandler creates a HTTP handler which loads the HTTP request and @@ -198,7 +199,7 @@ func MountTestSmokeHandler(mux goahttp.Muxer, h http.Handler) { h.ServeHTTP(w, r) } } - mux.Handle("POST", "/tester/smoke", f) + mux.Handle("POST", "/tester/smoke", otelhttp.WithRouteTag("/tester/smoke", f).ServeHTTP) } // NewTestSmokeHandler creates a HTTP handler which loads the HTTP request and diff --git a/example/weather/services/front/gen/http/front/server/types.go b/example/weather/services/front/gen/http/front/server/types.go index b36353ed..d099eb94 100644 --- a/example/weather/services/front/gen/http/front/server/types.go +++ b/example/weather/services/front/gen/http/front/server/types.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // front HTTP server types // diff --git a/example/weather/services/front/gen/http/openapi.json b/example/weather/services/front/gen/http/openapi.json index 518e482e..4ce42861 100644 --- a/example/weather/services/front/gen/http/openapi.json +++ b/example/weather/services/front/gen/http/openapi.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"title":"Weather Forecast Service API","description":"The weather forecast service API produces weather forecasts from US-based IPs. It uses IP location to find the appropriate weather station.","version":"1.0.0"},"host":"localhost:80","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/forecast/{ip}":{"get":{"tags":["front"],"summary":"forecast front","description":"Retrieve weather forecast for given IP","operationId":"front#forecast","parameters":[{"name":"ip","in":"path","required":true,"type":"string","format":"ip"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/FrontForecastResponseBody","required":["location","periods"]}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/FrontForecastNotUsaResponseBody"}}},"schemes":["http"]}},"/tester/all":{"post":{"tags":["front"],"summary":"test_all front","description":"Endpoint for running ALL API Integration Tests for the Weather System, allowing for filtering on included or excluded tests","operationId":"front#test_all","parameters":[{"name":"test_all_request_body","in":"body","required":true,"schema":{"$ref":"#/definitions/FrontTestAllRequestBody"}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/FrontTestAllResponseBody","required":["collections","duration","pass_count","fail_count"]}}},"schemes":["http"]}},"/tester/smoke":{"post":{"tags":["front"],"summary":"test_smoke front","description":"Endpoint for running API Integration Tests' Smoke Tests ONLY for the Weather System","operationId":"front#test_smoke","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/FrontTestSmokeResponseBody","required":["collections","duration","pass_count","fail_count"]}}},"schemes":["http"]}}},"definitions":{"FrontForecastNotUsaResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":true}},"description":"IP address is not in the US (default view)","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"FrontForecastResponseBody":{"title":"FrontForecastResponseBody","type":"object","properties":{"location":{"$ref":"#/definitions/LocationResponseBody"},"periods":{"type":"array","items":{"$ref":"#/definitions/PeriodResponseBody"},"description":"Weather forecast periods","example":[{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"}]}},"example":{"location":{"city":"San Francisco","lat":37.8267,"long":-122.4233,"state":"CA"},"periods":[{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"}]},"required":["location","periods"]},"FrontTestAllRequestBody":{"title":"FrontTestAllRequestBody","type":"object","properties":{"exclude":{"type":"array","items":{"type":"string","example":"Eos nihil accusamus reiciendis eligendi amet aut."},"description":"Tests to exclude","example":["Hic aperiam.","Assumenda commodi aut facilis."]},"include":{"type":"array","items":{"type":"string","example":"Corrupti dignissimos id necessitatibus consequatur a laudantium."},"description":"Tests to run","example":["Nihil voluptatum dolorem nam quisquam.","Incidunt ipsa natus."]}},"example":{"exclude":["Asperiores est.","Omnis vel quia ab dolorem qui.","Dicta fuga praesentium.","Est sit quis."],"include":["Aspernatur voluptatem et placeat deserunt.","Temporibus veritatis vel.","Voluptatem ab nulla ad in optio sed.","Tempora tenetur."]}},"FrontTestAllResponseBody":{"title":"FrontTestAllResponseBody","type":"object","properties":{"collections":{"type":"array","items":{"$ref":"#/definitions/TestCollectionResponseBody"},"description":"Test collections","example":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}]},"duration":{"type":"integer","description":"Duration of the tests in ms","example":1234,"format":"int64"},"fail_count":{"type":"integer","description":"Number of tests that failed","example":1,"format":"int64"},"pass_count":{"type":"integer","description":"Number of tests that passed","example":12,"format":"int64"}},"example":{"collections":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}],"duration":1234,"fail_count":1,"pass_count":12},"required":["collections","duration","pass_count","fail_count"]},"FrontTestSmokeResponseBody":{"title":"FrontTestSmokeResponseBody","type":"object","properties":{"collections":{"type":"array","items":{"$ref":"#/definitions/TestCollectionResponseBody"},"description":"Test collections","example":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}]},"duration":{"type":"integer","description":"Duration of the tests in ms","example":1234,"format":"int64"},"fail_count":{"type":"integer","description":"Number of tests that failed","example":1,"format":"int64"},"pass_count":{"type":"integer","description":"Number of tests that passed","example":12,"format":"int64"}},"example":{"collections":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}],"duration":1234,"fail_count":1,"pass_count":12},"required":["collections","duration","pass_count","fail_count"]},"LocationResponseBody":{"title":"LocationResponseBody","type":"object","properties":{"city":{"type":"string","description":"City","example":"San Francisco"},"lat":{"type":"number","description":"Latitude","example":37.8267,"format":"double"},"long":{"type":"number","description":"Longitude","example":-122.4233,"format":"double"},"state":{"type":"string","description":"State","example":"CA"}},"description":"Geographical location","example":{"city":"San Francisco","lat":37.8267,"long":-122.4233,"state":"CA"},"required":["lat","long","city","state"]},"PeriodResponseBody":{"title":"PeriodResponseBody","type":"object","properties":{"endTime":{"type":"string","description":"End time","example":"2020-01-01T00:00:00Z","format":"date-time"},"name":{"type":"string","description":"Period name","example":"Morning"},"startTime":{"type":"string","description":"Start time","example":"2020-01-01T00:00:00Z","format":"date-time"},"summary":{"type":"string","description":"Summary","example":"Clear"},"temperature":{"type":"integer","description":"Temperature","example":70,"format":"int64"},"temperatureUnit":{"type":"string","description":"Temperature unit","example":"F"}},"description":"Weather forecast period","example":{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},"required":["name","startTime","endTime","temperature","temperatureUnit","summary"]},"TestCollectionResponseBody":{"title":"TestCollectionResponseBody","type":"object","properties":{"duration":{"type":"integer","description":"Duration of the tests in ms","example":1234,"format":"int64"},"fail_count":{"type":"integer","description":"Number of tests that failed","example":1,"format":"int64"},"name":{"type":"string","description":"Name of the test collection","example":"Locator Tests"},"pass_count":{"type":"integer","description":"Number of tests that passed","example":12,"format":"int64"},"results":{"type":"array","items":{"$ref":"#/definitions/TestResultResponseBody"},"description":"Test results","example":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}},"description":"Collection of test results for grouping by service","example":{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},"required":["name","duration","pass_count","fail_count"]},"TestResultResponseBody":{"title":"TestResultResponseBody","type":"object","properties":{"duration":{"type":"integer","description":"Duration of the test in ms","example":1234,"format":"int64"},"error":{"type":"string","description":"Error message if the test failed","example":"error getting location for valid ip: %v"},"name":{"type":"string","description":"Name of the test","example":"TestValidIP"},"passed":{"type":"boolean","description":"Status of the test","example":true}},"description":"Test result for a single test","example":{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},"required":["name","passed","duration"]}}} \ No newline at end of file +{"swagger":"2.0","info":{"title":"Weather Forecast Service API","description":"The weather forecast service API produces weather forecasts from US-based IPs. It uses IP location to find the appropriate weather station.","version":"1.0.0"},"host":"localhost:80","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/forecast/{ip}":{"get":{"tags":["front"],"summary":"forecast front","description":"Retrieve weather forecast for given IP","operationId":"front#forecast","parameters":[{"name":"ip","in":"path","required":true,"type":"string","format":"ip"}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/Forecast","required":["location","periods"]}},"400":{"description":"Bad Request response.","schema":{"$ref":"#/definitions/FrontForecastNotUsaResponseBody"}}},"schemes":["http"]}},"/tester/all":{"post":{"tags":["front"],"summary":"test_all front","description":"Endpoint for running ALL API Integration Tests for the Weather System, allowing for filtering on included or excluded tests","operationId":"front#test_all","parameters":[{"name":"test_all_request_body","in":"body","required":true,"schema":{"$ref":"#/definitions/FrontTestAllRequestBody"}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/TestResults","required":["collections","duration","pass_count","fail_count"]}}},"schemes":["http"]}},"/tester/smoke":{"post":{"tags":["front"],"summary":"test_smoke front","description":"Endpoint for running API Integration Tests' Smoke Tests ONLY for the Weather System","operationId":"front#test_smoke","responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/TestResults","required":["collections","duration","pass_count","fail_count"]}}},"schemes":["http"]}}},"definitions":{"Forecast":{"title":"Forecast","type":"object","properties":{"location":{"$ref":"#/definitions/Location"},"periods":{"type":"array","items":{"$ref":"#/definitions/Period"},"description":"Weather forecast periods","example":[{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"}]}},"example":{"location":{"city":"San Francisco","lat":37.8267,"long":-122.4233,"state":"CA"},"periods":[{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"}]},"required":["location","periods"]},"FrontForecastNotUsaResponseBody":{"title":"Mediatype identifier: application/vnd.goa.error; view=default","type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":false},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"IP address is not in the US (default view)","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"FrontTestAllRequestBody":{"title":"FrontTestAllRequestBody","type":"object","properties":{"exclude":{"type":"array","items":{"type":"string","example":"Sequi ipsum vitae ut impedit."},"description":"Tests to exclude","example":["Asperiores rem consequatur porro architecto aperiam.","Aut iste eveniet accusantium.","Architecto minima molestiae ad unde."]},"include":{"type":"array","items":{"type":"string","example":"Sint libero natus."},"description":"Tests to run","example":["Cum ducimus nostrum temporibus ex quo nihil.","Ex et.","Itaque itaque cupiditate voluptas quod."]}},"example":{"exclude":["Pariatur nam saepe autem dolorem inventore.","Velit eius iste.","Maxime quibusdam in dolor error amet ut."],"include":["Possimus iste eius.","Nesciunt sit dolores ducimus.","Eligendi sequi."]}},"Location":{"title":"Location","type":"object","properties":{"city":{"type":"string","description":"City","example":"San Francisco"},"lat":{"type":"number","description":"Latitude","example":37.8267,"format":"double"},"long":{"type":"number","description":"Longitude","example":-122.4233,"format":"double"},"state":{"type":"string","description":"State","example":"CA"}},"description":"Geographical location","example":{"city":"San Francisco","lat":37.8267,"long":-122.4233,"state":"CA"},"required":["lat","long","city","state"]},"Period":{"title":"Period","type":"object","properties":{"endTime":{"type":"string","description":"End time","example":"2020-01-01T00:00:00Z","format":"date-time"},"name":{"type":"string","description":"Period name","example":"Morning"},"startTime":{"type":"string","description":"Start time","example":"2020-01-01T00:00:00Z","format":"date-time"},"summary":{"type":"string","description":"Summary","example":"Clear"},"temperature":{"type":"integer","description":"Temperature","example":70,"format":"int64"},"temperatureUnit":{"type":"string","description":"Temperature unit","example":"F"}},"description":"Weather forecast period","example":{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},"required":["name","startTime","endTime","temperature","temperatureUnit","summary"]},"TestCollection":{"title":"TestCollection","type":"object","properties":{"duration":{"type":"integer","description":"Duration of the tests in ms","example":1234,"format":"int64"},"fail_count":{"type":"integer","description":"Number of tests that failed","example":1,"format":"int64"},"name":{"type":"string","description":"Name of the test collection","example":"Locator Tests"},"pass_count":{"type":"integer","description":"Number of tests that passed","example":12,"format":"int64"},"results":{"type":"array","items":{"$ref":"#/definitions/TestResult"},"description":"Test results","example":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}},"description":"Collection of test results for grouping by service","example":{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},"required":["name","duration","pass_count","fail_count"]},"TestResult":{"title":"TestResult","type":"object","properties":{"duration":{"type":"integer","description":"Duration of the test in ms","example":1234,"format":"int64"},"error":{"type":"string","description":"Error message if the test failed","example":"error getting location for valid ip: %v"},"name":{"type":"string","description":"Name of the test","example":"TestValidIP"},"passed":{"type":"boolean","description":"Status of the test","example":true}},"description":"Test result for a single test","example":{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},"required":["name","passed","duration"]},"TestResults":{"title":"TestResults","type":"object","properties":{"collections":{"type":"array","items":{"$ref":"#/definitions/TestCollection"},"description":"Test collections","example":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}]},"duration":{"type":"integer","description":"Duration of the tests in ms","example":1234,"format":"int64"},"fail_count":{"type":"integer","description":"Number of tests that failed","example":1,"format":"int64"},"pass_count":{"type":"integer","description":"Number of tests that passed","example":12,"format":"int64"}},"example":{"collections":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}],"duration":1234,"fail_count":1,"pass_count":12},"required":["collections","duration","pass_count","fail_count"]}}} \ No newline at end of file diff --git a/example/weather/services/front/gen/http/openapi.yaml b/example/weather/services/front/gen/http/openapi.yaml index 4b85cb24..94bc8586 100644 --- a/example/weather/services/front/gen/http/openapi.yaml +++ b/example/weather/services/front/gen/http/openapi.yaml @@ -30,7 +30,7 @@ paths: "200": description: OK response. schema: - $ref: '#/definitions/FrontForecastResponseBody' + $ref: '#/definitions/Forecast' required: - location - periods @@ -57,7 +57,7 @@ paths: "200": description: OK response. schema: - $ref: '#/definitions/FrontTestAllResponseBody' + $ref: '#/definitions/TestResults' required: - collections - duration @@ -76,7 +76,7 @@ paths: "200": description: OK response. schema: - $ref: '#/definitions/FrontTestSmokeResponseBody' + $ref: '#/definitions/TestResults' required: - collections - duration @@ -85,59 +85,16 @@ paths: schemes: - http definitions: - FrontForecastNotUsaResponseBody: - title: 'Mediatype identifier: application/vnd.goa.error; view=default' - type: object - properties: - fault: - type: boolean - description: Is the error a server-side fault? - example: true - id: - type: string - description: ID is a unique identifier for this particular occurrence of the problem. - example: 123abc - message: - type: string - description: Message is a human-readable explanation specific to this occurrence of the problem. - example: parameter 'p' must be an integer - name: - type: string - description: Name is the name of this class of errors. - example: bad_request - temporary: - type: boolean - description: Is the error temporary? - example: true - timeout: - type: boolean - description: Is the error a timeout? - example: true - description: IP address is not in the US (default view) - example: - fault: false - id: 123abc - message: parameter 'p' must be an integer - name: bad_request - temporary: true - timeout: true - required: - - name - - id - - message - - temporary - - timeout - - fault - FrontForecastResponseBody: - title: FrontForecastResponseBody + Forecast: + title: Forecast type: object properties: location: - $ref: '#/definitions/LocationResponseBody' + $ref: '#/definitions/Location' periods: type: array items: - $ref: '#/definitions/PeriodResponseBody' + $ref: '#/definitions/Period' description: Weather forecast periods example: - endTime: "2020-01-01T00:00:00Z" @@ -158,12 +115,6 @@ definitions: summary: Clear temperature: 70 temperatureUnit: F - - endTime: "2020-01-01T00:00:00Z" - name: Morning - startTime: "2020-01-01T00:00:00Z" - summary: Clear - temperature: 70 - temperatureUnit: F example: location: city: San Francisco @@ -183,21 +134,52 @@ definitions: summary: Clear temperature: 70 temperatureUnit: F - - endTime: "2020-01-01T00:00:00Z" - name: Morning - startTime: "2020-01-01T00:00:00Z" - summary: Clear - temperature: 70 - temperatureUnit: F - - endTime: "2020-01-01T00:00:00Z" - name: Morning - startTime: "2020-01-01T00:00:00Z" - summary: Clear - temperature: 70 - temperatureUnit: F required: - location - periods + FrontForecastNotUsaResponseBody: + title: 'Mediatype identifier: application/vnd.goa.error; view=default' + type: object + properties: + fault: + type: boolean + description: Is the error a server-side fault? + example: false + id: + type: string + description: ID is a unique identifier for this particular occurrence of the problem. + example: 123abc + message: + type: string + description: Message is a human-readable explanation specific to this occurrence of the problem. + example: parameter 'p' must be an integer + name: + type: string + description: Name is the name of this class of errors. + example: bad_request + temporary: + type: boolean + description: Is the error temporary? + example: true + timeout: + type: boolean + description: Is the error a timeout? + example: false + description: IP address is not in the US (default view) + example: + fault: true + id: 123abc + message: parameter 'p' must be an integer + name: bad_request + temporary: true + timeout: false + required: + - name + - id + - message + - temporary + - timeout + - fault FrontTestAllRequestBody: title: FrontTestAllRequestBody type: object @@ -206,246 +188,33 @@ definitions: type: array items: type: string - example: Eos nihil accusamus reiciendis eligendi amet aut. + example: Sequi ipsum vitae ut impedit. description: Tests to exclude example: - - Hic aperiam. - - Assumenda commodi aut facilis. + - Asperiores rem consequatur porro architecto aperiam. + - Aut iste eveniet accusantium. + - Architecto minima molestiae ad unde. include: type: array items: type: string - example: Corrupti dignissimos id necessitatibus consequatur a laudantium. + example: Sint libero natus. description: Tests to run example: - - Nihil voluptatum dolorem nam quisquam. - - Incidunt ipsa natus. + - Cum ducimus nostrum temporibus ex quo nihil. + - Ex et. + - Itaque itaque cupiditate voluptas quod. example: exclude: - - Asperiores est. - - Omnis vel quia ab dolorem qui. - - Dicta fuga praesentium. - - Est sit quis. + - Pariatur nam saepe autem dolorem inventore. + - Velit eius iste. + - Maxime quibusdam in dolor error amet ut. include: - - Aspernatur voluptatem et placeat deserunt. - - Temporibus veritatis vel. - - Voluptatem ab nulla ad in optio sed. - - Tempora tenetur. - FrontTestAllResponseBody: - title: FrontTestAllResponseBody - type: object - properties: - collections: - type: array - items: - $ref: '#/definitions/TestCollectionResponseBody' - description: Test collections - example: - - duration: 1234 - fail_count: 1 - name: Locator Tests - pass_count: 12 - results: - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - fail_count: 1 - name: Locator Tests - pass_count: 12 - results: - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - duration: - type: integer - description: Duration of the tests in ms - example: 1234 - format: int64 - fail_count: - type: integer - description: Number of tests that failed - example: 1 - format: int64 - pass_count: - type: integer - description: Number of tests that passed - example: 12 - format: int64 - example: - collections: - - duration: 1234 - fail_count: 1 - name: Locator Tests - pass_count: 12 - results: - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - fail_count: 1 - name: Locator Tests - pass_count: 12 - results: - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - fail_count: 1 - name: Locator Tests - pass_count: 12 - results: - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - duration: 1234 - fail_count: 1 - pass_count: 12 - required: - - collections - - duration - - pass_count - - fail_count - FrontTestSmokeResponseBody: - title: FrontTestSmokeResponseBody - type: object - properties: - collections: - type: array - items: - $ref: '#/definitions/TestCollectionResponseBody' - description: Test collections - example: - - duration: 1234 - fail_count: 1 - name: Locator Tests - pass_count: 12 - results: - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - fail_count: 1 - name: Locator Tests - pass_count: 12 - results: - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - duration: - type: integer - description: Duration of the tests in ms - example: 1234 - format: int64 - fail_count: - type: integer - description: Number of tests that failed - example: 1 - format: int64 - pass_count: - type: integer - description: Number of tests that passed - example: 12 - format: int64 - example: - collections: - - duration: 1234 - fail_count: 1 - name: Locator Tests - pass_count: 12 - results: - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - fail_count: 1 - name: Locator Tests - pass_count: 12 - results: - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - fail_count: 1 - name: Locator Tests - pass_count: 12 - results: - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - fail_count: 1 - name: Locator Tests - pass_count: 12 - results: - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - duration: 1234 - fail_count: 1 - pass_count: 12 - required: - - collections - - duration - - pass_count - - fail_count - LocationResponseBody: - title: LocationResponseBody + - Possimus iste eius. + - Nesciunt sit dolores ducimus. + - Eligendi sequi. + Location: + title: Location type: object properties: city: @@ -477,8 +246,8 @@ definitions: - long - city - state - PeriodResponseBody: - title: PeriodResponseBody + Period: + title: Period type: object properties: endTime: @@ -523,8 +292,8 @@ definitions: - temperature - temperatureUnit - summary - TestCollectionResponseBody: - title: TestCollectionResponseBody + TestCollection: + title: TestCollection type: object properties: duration: @@ -549,7 +318,7 @@ definitions: results: type: array items: - $ref: '#/definitions/TestResultResponseBody' + $ref: '#/definitions/TestResult' description: Test results example: - duration: 1234 @@ -560,6 +329,14 @@ definitions: error: 'error getting location for valid ip: %v' name: TestValidIP passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true description: Collection of test results for grouping by service example: duration: 1234 @@ -588,8 +365,8 @@ definitions: - duration - pass_count - fail_count - TestResultResponseBody: - title: TestResultResponseBody + TestResult: + title: TestResult type: object properties: duration: @@ -619,3 +396,140 @@ definitions: - name - passed - duration + TestResults: + title: TestResults + type: object + properties: + collections: + type: array + items: + $ref: '#/definitions/TestCollection' + description: Test collections + example: + - duration: 1234 + fail_count: 1 + name: Locator Tests + pass_count: 12 + results: + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + fail_count: 1 + name: Locator Tests + pass_count: 12 + results: + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + fail_count: 1 + name: Locator Tests + pass_count: 12 + results: + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + duration: + type: integer + description: Duration of the tests in ms + example: 1234 + format: int64 + fail_count: + type: integer + description: Number of tests that failed + example: 1 + format: int64 + pass_count: + type: integer + description: Number of tests that passed + example: 12 + format: int64 + example: + collections: + - duration: 1234 + fail_count: 1 + name: Locator Tests + pass_count: 12 + results: + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + fail_count: 1 + name: Locator Tests + pass_count: 12 + results: + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + fail_count: 1 + name: Locator Tests + pass_count: 12 + results: + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + duration: 1234 + fail_count: 1 + pass_count: 12 + required: + - collections + - duration + - pass_count + - fail_count diff --git a/example/weather/services/front/gen/http/openapi3.json b/example/weather/services/front/gen/http/openapi3.json index 27c175de..d157d275 100644 --- a/example/weather/services/front/gen/http/openapi3.json +++ b/example/weather/services/front/gen/http/openapi3.json @@ -1 +1 @@ -{"openapi":"3.0.3","info":{"title":"Weather Forecast Service API","description":"The weather forecast service API produces weather forecasts from US-based IPs. It uses IP location to find the appropriate weather station.","version":"1.0.0"},"servers":[{"url":"http://localhost:80","description":"Default server for Weather"}],"paths":{"/forecast/{ip}":{"get":{"tags":["front"],"summary":"forecast front","description":"Retrieve weather forecast for given IP","operationId":"front#forecast","parameters":[{"name":"ip","in":"path","required":true,"schema":{"type":"string","example":"137.67.93.10","format":"ip"},"example":"57.127.156.27"}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forecast"},"example":{"location":{"city":"San Francisco","lat":37.8267,"long":-122.4233,"state":"CA"},"periods":[{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"}]}}}},"400":{"description":"not_usa: IP address is not in the US","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tester/all":{"post":{"tags":["front"],"summary":"test_all front","description":"Endpoint for running ALL API Integration Tests for the Weather System, allowing for filtering on included or excluded tests","operationId":"front#test_all","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestAllRequestBody"},"example":{"exclude":["Repudiandae enim molestiae.","Ut id iure."],"include":["Dolor sunt maiores.","Asperiores omnis ducimus ad et mollitia."]}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestResults"},"example":{"collections":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}],"duration":1234,"fail_count":1,"pass_count":12}}}}}}},"/tester/smoke":{"post":{"tags":["front"],"summary":"test_smoke front","description":"Endpoint for running API Integration Tests' Smoke Tests ONLY for the Weather System","operationId":"front#test_smoke","responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestResults"},"example":{"collections":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}],"duration":1234,"fail_count":1,"pass_count":12}}}}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":true},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"IP address is not in the US","example":{"fault":false,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":true,"timeout":false},"required":["name","id","message","temporary","timeout","fault"]},"Forecast":{"type":"object","properties":{"location":{"$ref":"#/components/schemas/Location"},"periods":{"type":"array","items":{"$ref":"#/components/schemas/Period"},"description":"Weather forecast periods","example":[{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"}]}},"example":{"location":{"city":"San Francisco","lat":37.8267,"long":-122.4233,"state":"CA"},"periods":[{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"}]},"required":["location","periods"]},"Location":{"type":"object","properties":{"city":{"type":"string","description":"City","example":"San Francisco"},"lat":{"type":"number","description":"Latitude","example":37.8267,"format":"double"},"long":{"type":"number","description":"Longitude","example":-122.4233,"format":"double"},"state":{"type":"string","description":"State","example":"CA"}},"description":"Geographical location","example":{"city":"San Francisco","lat":37.8267,"long":-122.4233,"state":"CA"},"required":["lat","long","city","state"]},"Period":{"type":"object","properties":{"endTime":{"type":"string","description":"End time","example":"2020-01-01T00:00:00Z","format":"date-time"},"name":{"type":"string","description":"Period name","example":"Morning"},"startTime":{"type":"string","description":"Start time","example":"2020-01-01T00:00:00Z","format":"date-time"},"summary":{"type":"string","description":"Summary","example":"Clear"},"temperature":{"type":"integer","description":"Temperature","example":70,"format":"int64"},"temperatureUnit":{"type":"string","description":"Temperature unit","example":"F"}},"description":"Weather forecast period","example":{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},"required":["name","startTime","endTime","temperature","temperatureUnit","summary"]},"TestAllRequestBody":{"type":"object","properties":{"exclude":{"type":"array","items":{"type":"string","example":"Cupiditate voluptas quod minima."},"description":"Tests to exclude","example":["Vitae ut.","Non officiis asperiores rem."]},"include":{"type":"array","items":{"type":"string","example":"Sed officia cum."},"description":"Tests to run","example":["Temporibus ex quo nihil rem.","Et et itaque."]}},"example":{"exclude":["Architecto minima molestiae ad unde.","Porro possimus iste eius minus nesciunt.","Dolores ducimus."],"include":["Architecto aperiam odit.","Iste eveniet."]}},"TestCollection":{"type":"object","properties":{"duration":{"type":"integer","description":"Duration of the tests in ms","example":1234,"format":"int64"},"fail_count":{"type":"integer","description":"Number of tests that failed","example":1,"format":"int64"},"name":{"type":"string","description":"Name of the test collection","example":"Locator Tests"},"pass_count":{"type":"integer","description":"Number of tests that passed","example":12,"format":"int64"},"results":{"type":"array","items":{"$ref":"#/components/schemas/TestResult"},"description":"Test results","example":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}},"description":"Collection of test results for grouping by service","example":{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},"required":["name","duration","pass_count","fail_count"]},"TestResult":{"type":"object","properties":{"duration":{"type":"integer","description":"Duration of the test in ms","example":1234,"format":"int64"},"error":{"type":"string","description":"Error message if the test failed","example":"error getting location for valid ip: %v"},"name":{"type":"string","description":"Name of the test","example":"TestValidIP"},"passed":{"type":"boolean","description":"Status of the test","example":true}},"description":"Test result for a single test","example":{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},"required":["name","passed","duration"]},"TestResults":{"type":"object","properties":{"collections":{"type":"array","items":{"$ref":"#/components/schemas/TestCollection"},"description":"Test collections","example":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}]},"duration":{"type":"integer","description":"Duration of the tests in ms","example":1234,"format":"int64"},"fail_count":{"type":"integer","description":"Number of tests that failed","example":1,"format":"int64"},"pass_count":{"type":"integer","description":"Number of tests that passed","example":12,"format":"int64"}},"example":{"collections":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}],"duration":1234,"fail_count":1,"pass_count":12},"required":["collections","duration","pass_count","fail_count"]}}},"tags":[{"name":"front","description":"Public HTTP frontend"}]} \ No newline at end of file +{"openapi":"3.0.3","info":{"title":"Weather Forecast Service API","description":"The weather forecast service API produces weather forecasts from US-based IPs. It uses IP location to find the appropriate weather station.","version":"1.0.0"},"servers":[{"url":"http://localhost:80","description":"Default server for Weather"}],"paths":{"/forecast/{ip}":{"get":{"tags":["front"],"summary":"forecast front","description":"Retrieve weather forecast for given IP","operationId":"front#forecast","parameters":[{"name":"ip","in":"path","required":true,"schema":{"type":"string","example":"183.149.183.79","format":"ip"},"example":"125.235.141.72"}],"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forecast"},"example":{"location":{"city":"San Francisco","lat":37.8267,"long":-122.4233,"state":"CA"},"periods":[{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"}]}}}},"400":{"description":"not_usa: IP address is not in the US","content":{"application/vnd.goa.error":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tester/all":{"post":{"tags":["front"],"summary":"test_all front","description":"Endpoint for running ALL API Integration Tests for the Weather System, allowing for filtering on included or excluded tests","operationId":"front#test_all","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestAllRequestBody"},"example":{"exclude":["Veritatis vel inventore voluptatem ab nulla.","In optio sed id.","Tenetur repellendus commodi asperiores.","Quaerat omnis vel quia ab dolorem qui."],"include":["Consectetur eos nihil accusamus reiciendis eligendi.","Aut autem non.","Aperiam possimus assumenda commodi aut facilis provident.","Aspernatur voluptatem et placeat deserunt."]}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestResults"},"example":{"collections":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}],"duration":1234,"fail_count":1,"pass_count":12}}}}}}},"/tester/smoke":{"post":{"tags":["front"],"summary":"test_smoke front","description":"Endpoint for running API Integration Tests' Smoke Tests ONLY for the Weather System","operationId":"front#test_smoke","responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestResults"},"example":{"collections":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}],"duration":1234,"fail_count":1,"pass_count":12}}}}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"fault":{"type":"boolean","description":"Is the error a server-side fault?","example":true},"id":{"type":"string","description":"ID is a unique identifier for this particular occurrence of the problem.","example":"123abc"},"message":{"type":"string","description":"Message is a human-readable explanation specific to this occurrence of the problem.","example":"parameter 'p' must be an integer"},"name":{"type":"string","description":"Name is the name of this class of errors.","example":"bad_request"},"temporary":{"type":"boolean","description":"Is the error temporary?","example":false},"timeout":{"type":"boolean","description":"Is the error a timeout?","example":false}},"description":"IP address is not in the US","example":{"fault":true,"id":"123abc","message":"parameter 'p' must be an integer","name":"bad_request","temporary":false,"timeout":true},"required":["name","id","message","temporary","timeout","fault"]},"Forecast":{"type":"object","properties":{"location":{"$ref":"#/components/schemas/Location"},"periods":{"type":"array","items":{"$ref":"#/components/schemas/Period"},"description":"Weather forecast periods","example":[{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"}]}},"description":"Weather forecast","example":{"location":{"city":"San Francisco","lat":37.8267,"long":-122.4233,"state":"CA"},"periods":[{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"}]},"required":["location","periods"]},"Location":{"type":"object","properties":{"city":{"type":"string","description":"City","example":"San Francisco"},"lat":{"type":"number","description":"Latitude","example":37.8267,"format":"double"},"long":{"type":"number","description":"Longitude","example":-122.4233,"format":"double"},"state":{"type":"string","description":"State","example":"CA"}},"description":"Geographical location","example":{"city":"San Francisco","lat":37.8267,"long":-122.4233,"state":"CA"},"required":["lat","long","city","state"]},"Period":{"type":"object","properties":{"endTime":{"type":"string","description":"End time","example":"2020-01-01T00:00:00Z","format":"date-time"},"name":{"type":"string","description":"Period name","example":"Morning"},"startTime":{"type":"string","description":"Start time","example":"2020-01-01T00:00:00Z","format":"date-time"},"summary":{"type":"string","description":"Summary","example":"Clear"},"temperature":{"type":"integer","description":"Temperature","example":70,"format":"int64"},"temperatureUnit":{"type":"string","description":"Temperature unit","example":"F"}},"description":"Weather forecast period","example":{"endTime":"2020-01-01T00:00:00Z","name":"Morning","startTime":"2020-01-01T00:00:00Z","summary":"Clear","temperature":70,"temperatureUnit":"F"},"required":["name","startTime","endTime","temperature","temperatureUnit","summary"]},"TestAllRequestBody":{"type":"object","properties":{"exclude":{"type":"array","items":{"type":"string","example":"Praesentium et est."},"description":"Tests to exclude","example":["Sed mollitia voluptate numquam.","Omnis occaecati sint.","Est reiciendis."]},"include":{"type":"array","items":{"type":"string","example":"Et veritatis nesciunt est officia facere."},"description":"Tests to run","example":["Est et.","Recusandae qui quod pariatur fugit."]}},"example":{"exclude":["Ducimus doloremque et est.","Voluptates sint non modi omnis sed rerum."],"include":["Quibusdam libero ad sit in autem.","Et doloribus.","Et quibusdam exercitationem."]}},"TestCollection":{"type":"object","properties":{"duration":{"type":"integer","description":"Duration of the tests in ms","example":1234,"format":"int64"},"fail_count":{"type":"integer","description":"Number of tests that failed","example":1,"format":"int64"},"name":{"type":"string","description":"Name of the test collection","example":"Locator Tests"},"pass_count":{"type":"integer","description":"Number of tests that passed","example":12,"format":"int64"},"results":{"type":"array","items":{"$ref":"#/components/schemas/TestResult"},"description":"Test results","example":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}},"description":"Collection of test results for grouping by service","example":{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},"required":["name","duration","pass_count","fail_count"]},"TestResult":{"type":"object","properties":{"duration":{"type":"integer","description":"Duration of the test in ms","example":1234,"format":"int64"},"error":{"type":"string","description":"Error message if the test failed","example":"error getting location for valid ip: %v"},"name":{"type":"string","description":"Name of the test","example":"TestValidIP"},"passed":{"type":"boolean","description":"Status of the test","example":true}},"description":"Test result for a single test","example":{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},"required":["name","passed","duration"]},"TestResults":{"type":"object","properties":{"collections":{"type":"array","items":{"$ref":"#/components/schemas/TestCollection"},"description":"Test collections","example":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}]},"duration":{"type":"integer","description":"Duration of the tests in ms","example":1234,"format":"int64"},"fail_count":{"type":"integer","description":"Number of tests that failed","example":1,"format":"int64"},"pass_count":{"type":"integer","description":"Number of tests that passed","example":12,"format":"int64"}},"description":"Test results for the integration tests","example":{"collections":[{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]},{"duration":1234,"fail_count":1,"name":"Locator Tests","pass_count":12,"results":[{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true},{"duration":1234,"error":"error getting location for valid ip: %v","name":"TestValidIP","passed":true}]}],"duration":1234,"fail_count":1,"pass_count":12},"required":["collections","duration","pass_count","fail_count"]}}},"tags":[{"name":"front","description":"Public HTTP frontend"}]} \ No newline at end of file diff --git a/example/weather/services/front/gen/http/openapi3.yaml b/example/weather/services/front/gen/http/openapi3.yaml index 858866ad..9f8b0579 100644 --- a/example/weather/services/front/gen/http/openapi3.yaml +++ b/example/weather/services/front/gen/http/openapi3.yaml @@ -20,9 +20,9 @@ paths: required: true schema: type: string - example: 137.67.93.10 + example: 183.149.183.79 format: ip - example: 57.127.156.27 + example: 125.235.141.72 responses: "200": description: OK response. @@ -82,11 +82,15 @@ paths: $ref: '#/components/schemas/TestAllRequestBody' example: exclude: - - Repudiandae enim molestiae. - - Ut id iure. + - Veritatis vel inventore voluptatem ab nulla. + - In optio sed id. + - Tenetur repellendus commodi asperiores. + - Quaerat omnis vel quia ab dolorem qui. include: - - Dolor sunt maiores. - - Asperiores omnis ducimus ad et mollitia. + - Consectetur eos nihil accusamus reiciendis eligendi. + - Aut autem non. + - Aperiam possimus assumenda commodi aut facilis provident. + - Aspernatur voluptatem et placeat deserunt. responses: "200": description: OK response. @@ -109,6 +113,10 @@ paths: error: 'error getting location for valid ip: %v' name: TestValidIP passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true - duration: 1234 fail_count: 1 name: Locator Tests @@ -122,6 +130,44 @@ paths: error: 'error getting location for valid ip: %v' name: TestValidIP passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + fail_count: 1 + name: Locator Tests + pass_count: 12 + results: + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + fail_count: 1 + name: Locator Tests + pass_count: 12 + results: + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true duration: 1234 fail_count: 1 pass_count: 12 @@ -154,6 +200,44 @@ paths: error: 'error getting location for valid ip: %v' name: TestValidIP passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + fail_count: 1 + name: Locator Tests + pass_count: 12 + results: + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + fail_count: 1 + name: Locator Tests + pass_count: 12 + results: + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true - duration: 1234 fail_count: 1 name: Locator Tests @@ -167,6 +251,10 @@ paths: error: 'error getting location for valid ip: %v' name: TestValidIP passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true duration: 1234 fail_count: 1 pass_count: 12 @@ -194,19 +282,19 @@ components: temporary: type: boolean description: Is the error temporary? - example: true + example: false timeout: type: boolean description: Is the error a timeout? example: false description: IP address is not in the US example: - fault: false + fault: true id: 123abc message: parameter 'p' must be an integer name: bad_request - temporary: true - timeout: false + temporary: false + timeout: true required: - name - id @@ -237,6 +325,7 @@ components: summary: Clear temperature: 70 temperatureUnit: F + description: Weather forecast example: location: city: San Francisco @@ -262,12 +351,6 @@ components: summary: Clear temperature: 70 temperatureUnit: F - - endTime: "2020-01-01T00:00:00Z" - name: Morning - startTime: "2020-01-01T00:00:00Z" - summary: Clear - temperature: 70 - temperatureUnit: F required: - location - periods @@ -355,28 +438,29 @@ components: type: array items: type: string - example: Cupiditate voluptas quod minima. + example: Praesentium et est. description: Tests to exclude example: - - Vitae ut. - - Non officiis asperiores rem. + - Sed mollitia voluptate numquam. + - Omnis occaecati sint. + - Est reiciendis. include: type: array items: type: string - example: Sed officia cum. + example: Et veritatis nesciunt est officia facere. description: Tests to run example: - - Temporibus ex quo nihil rem. - - Et et itaque. + - Est et. + - Recusandae qui quod pariatur fugit. example: exclude: - - Architecto minima molestiae ad unde. - - Porro possimus iste eius minus nesciunt. - - Dolores ducimus. + - Ducimus doloremque et est. + - Voluptates sint non modi omnis sed rerum. include: - - Architecto aperiam odit. - - Iste eveniet. + - Quibusdam libero ad sit in autem. + - Et doloribus. + - Et quibusdam exercitationem. TestCollection: type: object properties: @@ -440,6 +524,10 @@ components: error: 'error getting location for valid ip: %v' name: TestValidIP passed: true + - duration: 1234 + error: 'error getting location for valid ip: %v' + name: TestValidIP + passed: true required: - name - duration @@ -510,19 +598,6 @@ components: error: 'error getting location for valid ip: %v' name: TestValidIP passed: true - - duration: 1234 - fail_count: 1 - name: Locator Tests - pass_count: 12 - results: - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true duration: type: integer description: Duration of the tests in ms @@ -538,6 +613,7 @@ components: description: Number of tests that passed example: 12 format: int64 + description: Test results for the integration tests example: collections: - duration: 1234 @@ -566,19 +642,6 @@ components: error: 'error getting location for valid ip: %v' name: TestValidIP passed: true - - duration: 1234 - fail_count: 1 - name: Locator Tests - pass_count: 12 - results: - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true - - duration: 1234 - error: 'error getting location for valid ip: %v' - name: TestValidIP - passed: true duration: 1234 fail_count: 1 pass_count: 12 diff --git a/example/weather/services/locator/gen/grpc/cli/ip_location_api/cli.go b/example/weather/services/locator/gen/grpc/cli/ip_location_api/cli.go index 94e3d284..9b00eece 100644 --- a/example/weather/services/locator/gen/grpc/cli/ip_location_api/cli.go +++ b/example/weather/services/locator/gen/grpc/cli/ip_location_api/cli.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // IP Location API gRPC client CLI support package // @@ -29,14 +29,17 @@ func UsageCommands() string { // UsageExamples produces an example of a valid invocation of the CLI tool. func UsageExamples() string { return os.Args[0] + ` locator get-location --message '{ - "field": "Totam delectus odio consequatur." + "field": "Perspiciatis vel blanditiis tenetur blanditiis." }'` + "\n" + "" } // ParseEndpoint returns the endpoint and payload as specified on the command // line. -func ParseEndpoint(cc *grpc.ClientConn, opts ...grpc.CallOption) (goa.Endpoint, any, error) { +func ParseEndpoint( + cc *grpc.ClientConn, + opts ...grpc.CallOption, +) (goa.Endpoint, any, error) { var ( locatorFlags = flag.NewFlagSet("locator", flag.ContinueOnError) @@ -108,6 +111,7 @@ func ParseEndpoint(cc *grpc.ClientConn, opts ...grpc.CallOption) (goa.Endpoint, case "locator": c := locatorc.NewClient(cc, opts...) switch epn { + case "get-location": endpoint = c.GetLocation() data, err = locatorc.BuildGetLocationPayload(*locatorGetLocationMessageFlag) @@ -142,7 +146,7 @@ Retrieve location information for a given IP address Example: %[1]s locator get-location --message '{ - "field": "Totam delectus odio consequatur." + "field": "Perspiciatis vel blanditiis tenetur blanditiis." }' `, os.Args[0]) } diff --git a/example/weather/services/locator/gen/grpc/locator/client/cli.go b/example/weather/services/locator/gen/grpc/locator/client/cli.go index c45b6b35..0182d24c 100644 --- a/example/weather/services/locator/gen/grpc/locator/client/cli.go +++ b/example/weather/services/locator/gen/grpc/locator/client/cli.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // locator gRPC client CLI support package // @@ -25,7 +25,7 @@ func BuildGetLocationPayload(locatorGetLocationMessage string) (string, error) { err = json.Unmarshal([]byte(locatorGetLocationMessage), &message) if err != nil { var zero string - return zero, fmt.Errorf("invalid JSON for message, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"field\": \"Totam delectus odio consequatur.\"\n }'") + return zero, fmt.Errorf("invalid JSON for message, \nerror: %s, \nexample of valid JSON:\n%s", err, "'{\n \"field\": \"Perspiciatis vel blanditiis tenetur blanditiis.\"\n }'") } } } diff --git a/example/weather/services/locator/gen/grpc/locator/client/client.go b/example/weather/services/locator/gen/grpc/locator/client/client.go index cdf030d4..85ed452e 100644 --- a/example/weather/services/locator/gen/grpc/locator/client/client.go +++ b/example/weather/services/locator/gen/grpc/locator/client/client.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // locator gRPC client // @@ -21,17 +21,13 @@ import ( type Client struct { grpccli locatorpb.LocatorClient opts []grpc.CallOption -} - -// NewClient instantiates gRPC client for all the locator service servers. +} // NewClient instantiates gRPC client for all the locator service servers. func NewClient(cc *grpc.ClientConn, opts ...grpc.CallOption) *Client { return &Client{ grpccli: locatorpb.NewLocatorClient(cc), opts: opts, } -} - -// GetLocation calls the "GetLocation" function in locatorpb.LocatorClient +} // GetLocation calls the "GetLocation" function in locatorpb.LocatorClient // interface. func (c *Client) GetLocation() goa.Endpoint { return func(ctx context.Context, v any) (any, error) { @@ -41,7 +37,7 @@ func (c *Client) GetLocation() goa.Endpoint { DecodeGetLocationResponse) res, err := inv.Invoke(ctx, v) if err != nil { - return nil, goa.Fault(err.Error()) + return nil, goa.Fault("%s", err.Error()) } return res, nil } diff --git a/example/weather/services/locator/gen/grpc/locator/client/encode_decode.go b/example/weather/services/locator/gen/grpc/locator/client/encode_decode.go index d4a26cf4..5ab6e222 100644 --- a/example/weather/services/locator/gen/grpc/locator/client/encode_decode.go +++ b/example/weather/services/locator/gen/grpc/locator/client/encode_decode.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // locator gRPC client encoders and decoders // diff --git a/example/weather/services/locator/gen/grpc/locator/client/types.go b/example/weather/services/locator/gen/grpc/locator/client/types.go index 47f78297..39dce30b 100644 --- a/example/weather/services/locator/gen/grpc/locator/client/types.go +++ b/example/weather/services/locator/gen/grpc/locator/client/types.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // locator gRPC client types // diff --git a/example/weather/services/locator/gen/grpc/locator/pb/goagen_locator_locator.pb.go b/example/weather/services/locator/gen/grpc/locator/pb/goagen_locator_locator.pb.go index 8623f900..90655b47 100644 --- a/example/weather/services/locator/gen/grpc/locator/pb/goagen_locator_locator.pb.go +++ b/example/weather/services/locator/gen/grpc/locator/pb/goagen_locator_locator.pb.go @@ -1,4 +1,4 @@ -// Code generated with goa v3.14.4, DO NOT EDIT. +// Code generated with goa v3.20.0, DO NOT EDIT. // // locator protocol buffer definition // @@ -8,8 +8,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v4.25.1 +// protoc-gen-go v1.36.5 +// protoc v5.29.3 // source: goagen_locator_locator.proto package locatorpb @@ -19,6 +19,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -29,20 +30,17 @@ const ( ) type GetLocationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` unknownFields protoimpl.UnknownFields - - Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` + sizeCache protoimpl.SizeCache } func (x *GetLocationRequest) Reset() { *x = GetLocationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_locator_locator_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_locator_locator_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetLocationRequest) String() string { @@ -53,7 +51,7 @@ func (*GetLocationRequest) ProtoMessage() {} func (x *GetLocationRequest) ProtoReflect() protoreflect.Message { mi := &file_goagen_locator_locator_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -76,10 +74,7 @@ func (x *GetLocationRequest) GetField() string { } type GetLocationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Latitude Lat float64 `protobuf:"fixed64,1,opt,name=lat,proto3" json:"lat,omitempty"` // Longitude @@ -89,16 +84,16 @@ type GetLocationResponse struct { // State, region etc. Region string `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"` // Country - Country string `protobuf:"bytes,5,opt,name=country,proto3" json:"country,omitempty"` + Country string `protobuf:"bytes,5,opt,name=country,proto3" json:"country,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *GetLocationResponse) Reset() { *x = GetLocationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_locator_locator_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_locator_locator_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *GetLocationResponse) String() string { @@ -109,7 +104,7 @@ func (*GetLocationResponse) ProtoMessage() {} func (x *GetLocationResponse) ProtoReflect() protoreflect.Message { mi := &file_goagen_locator_locator_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -161,7 +156,7 @@ func (x *GetLocationResponse) GetCountry() string { var File_goagen_locator_locator_proto protoreflect.FileDescriptor -var file_goagen_locator_locator_proto_rawDesc = []byte{ +var file_goagen_locator_locator_proto_rawDesc = string([]byte{ 0x0a, 0x1c, 0x67, 0x6f, 0x61, 0x67, 0x65, 0x6e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x2a, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4c, 0x6f, @@ -183,22 +178,22 @@ var file_goagen_locator_locator_proto_rawDesc = []byte{ 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0c, 0x5a, 0x0a, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +}) var ( file_goagen_locator_locator_proto_rawDescOnce sync.Once - file_goagen_locator_locator_proto_rawDescData = file_goagen_locator_locator_proto_rawDesc + file_goagen_locator_locator_proto_rawDescData []byte ) func file_goagen_locator_locator_proto_rawDescGZIP() []byte { file_goagen_locator_locator_proto_rawDescOnce.Do(func() { - file_goagen_locator_locator_proto_rawDescData = protoimpl.X.CompressGZIP(file_goagen_locator_locator_proto_rawDescData) + file_goagen_locator_locator_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_goagen_locator_locator_proto_rawDesc), len(file_goagen_locator_locator_proto_rawDesc))) }) return file_goagen_locator_locator_proto_rawDescData } var file_goagen_locator_locator_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_goagen_locator_locator_proto_goTypes = []interface{}{ +var file_goagen_locator_locator_proto_goTypes = []any{ (*GetLocationRequest)(nil), // 0: locator.GetLocationRequest (*GetLocationResponse)(nil), // 1: locator.GetLocationResponse } @@ -217,37 +212,11 @@ func file_goagen_locator_locator_proto_init() { if File_goagen_locator_locator_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_goagen_locator_locator_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLocationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goagen_locator_locator_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLocationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_goagen_locator_locator_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_goagen_locator_locator_proto_rawDesc), len(file_goagen_locator_locator_proto_rawDesc)), NumEnums: 0, NumMessages: 2, NumExtensions: 0, @@ -258,7 +227,6 @@ func file_goagen_locator_locator_proto_init() { MessageInfos: file_goagen_locator_locator_proto_msgTypes, }.Build() File_goagen_locator_locator_proto = out.File - file_goagen_locator_locator_proto_rawDesc = nil file_goagen_locator_locator_proto_goTypes = nil file_goagen_locator_locator_proto_depIdxs = nil } diff --git a/example/weather/services/locator/gen/grpc/locator/pb/goagen_locator_locator.proto b/example/weather/services/locator/gen/grpc/locator/pb/goagen_locator_locator.proto index a8e077a6..af1caea1 100644 --- a/example/weather/services/locator/gen/grpc/locator/pb/goagen_locator_locator.proto +++ b/example/weather/services/locator/gen/grpc/locator/pb/goagen_locator_locator.proto @@ -1,4 +1,4 @@ -// Code generated with goa v3.14.4, DO NOT EDIT. +// Code generated with goa v3.20.0, DO NOT EDIT. // // locator protocol buffer definition // diff --git a/example/weather/services/locator/gen/grpc/locator/pb/goagen_locator_locator_grpc.pb.go b/example/weather/services/locator/gen/grpc/locator/pb/goagen_locator_locator_grpc.pb.go index 0b00a2c7..34cbf6e2 100644 --- a/example/weather/services/locator/gen/grpc/locator/pb/goagen_locator_locator_grpc.pb.go +++ b/example/weather/services/locator/gen/grpc/locator/pb/goagen_locator_locator_grpc.pb.go @@ -1,7 +1,15 @@ +// Code generated with goa v3.20.0, DO NOT EDIT. +// +// locator protocol buffer definition +// +// Command: +// $ goa gen goa.design/clue/example/weather/services/locator/design -o +// services/locator + // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v4.25.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.3 // source: goagen_locator_locator.proto package locatorpb @@ -15,12 +23,18 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Locator_GetLocation_FullMethodName = "/locator.Locator/GetLocation" +) // LocatorClient is the client API for Locator service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Public HTTP frontend type LocatorClient interface { // Retrieve location information for a given IP address GetLocation(ctx context.Context, in *GetLocationRequest, opts ...grpc.CallOption) (*GetLocationResponse, error) @@ -35,8 +49,9 @@ func NewLocatorClient(cc grpc.ClientConnInterface) LocatorClient { } func (c *locatorClient) GetLocation(ctx context.Context, in *GetLocationRequest, opts ...grpc.CallOption) (*GetLocationResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetLocationResponse) - err := c.cc.Invoke(ctx, "/locator.Locator/GetLocation", in, out, opts...) + err := c.cc.Invoke(ctx, Locator_GetLocation_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -45,21 +60,27 @@ func (c *locatorClient) GetLocation(ctx context.Context, in *GetLocationRequest, // LocatorServer is the server API for Locator service. // All implementations must embed UnimplementedLocatorServer -// for forward compatibility +// for forward compatibility. +// +// Public HTTP frontend type LocatorServer interface { // Retrieve location information for a given IP address GetLocation(context.Context, *GetLocationRequest) (*GetLocationResponse, error) mustEmbedUnimplementedLocatorServer() } -// UnimplementedLocatorServer must be embedded to have forward compatible implementations. -type UnimplementedLocatorServer struct { -} +// UnimplementedLocatorServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedLocatorServer struct{} func (UnimplementedLocatorServer) GetLocation(context.Context, *GetLocationRequest) (*GetLocationResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLocation not implemented") } func (UnimplementedLocatorServer) mustEmbedUnimplementedLocatorServer() {} +func (UnimplementedLocatorServer) testEmbeddedByValue() {} // UnsafeLocatorServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to LocatorServer will @@ -69,6 +90,13 @@ type UnsafeLocatorServer interface { } func RegisterLocatorServer(s grpc.ServiceRegistrar, srv LocatorServer) { + // If the following call pancis, it indicates UnimplementedLocatorServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Locator_ServiceDesc, srv) } @@ -82,7 +110,7 @@ func _Locator_GetLocation_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/locator.Locator/GetLocation", + FullMethod: Locator_GetLocation_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(LocatorServer).GetLocation(ctx, req.(*GetLocationRequest)) diff --git a/example/weather/services/locator/gen/grpc/locator/server/encode_decode.go b/example/weather/services/locator/gen/grpc/locator/server/encode_decode.go index db207b31..791cb831 100644 --- a/example/weather/services/locator/gen/grpc/locator/server/encode_decode.go +++ b/example/weather/services/locator/gen/grpc/locator/server/encode_decode.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // locator gRPC server encoders and decoders // diff --git a/example/weather/services/locator/gen/grpc/locator/server/server.go b/example/weather/services/locator/gen/grpc/locator/server/server.go index 528000fc..39816eba 100644 --- a/example/weather/services/locator/gen/grpc/locator/server/server.go +++ b/example/weather/services/locator/gen/grpc/locator/server/server.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // locator gRPC server // diff --git a/example/weather/services/locator/gen/grpc/locator/server/types.go b/example/weather/services/locator/gen/grpc/locator/server/types.go index 87cac0a6..1c11280a 100644 --- a/example/weather/services/locator/gen/grpc/locator/server/types.go +++ b/example/weather/services/locator/gen/grpc/locator/server/types.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // locator gRPC server types // diff --git a/example/weather/services/locator/gen/locator/client.go b/example/weather/services/locator/gen/locator/client.go index f83bf480..482307b6 100644 --- a/example/weather/services/locator/gen/locator/client.go +++ b/example/weather/services/locator/gen/locator/client.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // locator client // diff --git a/example/weather/services/locator/gen/locator/endpoints.go b/example/weather/services/locator/gen/locator/endpoints.go index ccfeaf62..31c8c0d1 100644 --- a/example/weather/services/locator/gen/locator/endpoints.go +++ b/example/weather/services/locator/gen/locator/endpoints.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // locator endpoints // diff --git a/example/weather/services/locator/gen/locator/service.go b/example/weather/services/locator/gen/locator/service.go index 7721a159..2bde8484 100644 --- a/example/weather/services/locator/gen/locator/service.go +++ b/example/weather/services/locator/gen/locator/service.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // locator service // @@ -18,14 +18,17 @@ type Service interface { GetLocation(context.Context, string) (res *WorldLocation, err error) } +// APIName is the name of the API as defined in the design. +const APIName = "IP Location API" + +// APIVersion is the version of the API as defined in the design. +const APIVersion = "1.0.0" + // ServiceName is the name of the service as defined in the design. This is the // same value that is set in the endpoint request contexts under the ServiceKey // key. const ServiceName = "locator" -// APIVersion is the version of the API as defined in the design. -const APIVersion = "1.0.0" - // MethodNames lists the service method names as defined in the design. These // are the same values that are set in the endpoint request contexts under the // MethodKey key. diff --git a/example/weather/services/tester/gen/grpc/cli/tester_service_api/cli.go b/example/weather/services/tester/gen/grpc/cli/tester_service_api/cli.go index 5adc03f5..b13ca5b2 100644 --- a/example/weather/services/tester/gen/grpc/cli/tester_service_api/cli.go +++ b/example/weather/services/tester/gen/grpc/cli/tester_service_api/cli.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // Tester Service API gRPC client CLI support package // @@ -41,7 +41,10 @@ func UsageExamples() string { // ParseEndpoint returns the endpoint and payload as specified on the command // line. -func ParseEndpoint(cc *grpc.ClientConn, opts ...grpc.CallOption) (goa.Endpoint, any, error) { +func ParseEndpoint( + cc *grpc.ClientConn, + opts ...grpc.CallOption, +) (goa.Endpoint, any, error) { var ( testerFlags = flag.NewFlagSet("tester", flag.ContinueOnError) @@ -131,18 +134,16 @@ func ParseEndpoint(cc *grpc.ClientConn, opts ...grpc.CallOption) (goa.Endpoint, case "tester": c := testerc.NewClient(cc, opts...) switch epn { + case "test-all": endpoint = c.TestAll() data, err = testerc.BuildTestAllPayload(*testerTestAllMessageFlag) case "test-smoke": endpoint = c.TestSmoke() - data = nil case "test-forecaster": endpoint = c.TestForecaster() - data = nil case "test-locator": endpoint = c.TestLocator() - data = nil } } } diff --git a/example/weather/services/tester/gen/grpc/tester/client/cli.go b/example/weather/services/tester/gen/grpc/tester/client/cli.go index 89341eea..904e6574 100644 --- a/example/weather/services/tester/gen/grpc/tester/client/cli.go +++ b/example/weather/services/tester/gen/grpc/tester/client/cli.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // tester gRPC client CLI support package // diff --git a/example/weather/services/tester/gen/grpc/tester/client/client.go b/example/weather/services/tester/gen/grpc/tester/client/client.go index 67275ff9..b6e577ee 100644 --- a/example/weather/services/tester/gen/grpc/tester/client/client.go +++ b/example/weather/services/tester/gen/grpc/tester/client/client.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // tester gRPC client // @@ -22,17 +22,13 @@ import ( type Client struct { grpccli testerpb.TesterClient opts []grpc.CallOption -} - -// NewClient instantiates gRPC client for all the tester service servers. +} // NewClient instantiates gRPC client for all the tester service servers. func NewClient(cc *grpc.ClientConn, opts ...grpc.CallOption) *Client { return &Client{ grpccli: testerpb.NewTesterClient(cc), opts: opts, } -} - -// TestAll calls the "TestAll" function in testerpb.TesterClient interface. +} // TestAll calls the "TestAll" function in testerpb.TesterClient interface. func (c *Client) TestAll() goa.Endpoint { return func(ctx context.Context, v any) (any, error) { inv := goagrpc.NewInvoker( @@ -46,7 +42,7 @@ func (c *Client) TestAll() goa.Endpoint { case *goapb.ErrorResponse: return nil, goagrpc.NewServiceError(message) default: - return nil, goa.Fault(err.Error()) + return nil, goa.Fault("%s", err.Error()) } } return res, nil @@ -62,7 +58,7 @@ func (c *Client) TestSmoke() goa.Endpoint { DecodeTestSmokeResponse) res, err := inv.Invoke(ctx, v) if err != nil { - return nil, goa.Fault(err.Error()) + return nil, goa.Fault("%s", err.Error()) } return res, nil } @@ -83,7 +79,7 @@ func (c *Client) TestForecaster() goa.Endpoint { case *goapb.ErrorResponse: return nil, goagrpc.NewServiceError(message) default: - return nil, goa.Fault(err.Error()) + return nil, goa.Fault("%s", err.Error()) } } return res, nil @@ -105,7 +101,7 @@ func (c *Client) TestLocator() goa.Endpoint { case *goapb.ErrorResponse: return nil, goagrpc.NewServiceError(message) default: - return nil, goa.Fault(err.Error()) + return nil, goa.Fault("%s", err.Error()) } } return res, nil diff --git a/example/weather/services/tester/gen/grpc/tester/client/encode_decode.go b/example/weather/services/tester/gen/grpc/tester/client/encode_decode.go index c6bd20f1..58426b2a 100644 --- a/example/weather/services/tester/gen/grpc/tester/client/encode_decode.go +++ b/example/weather/services/tester/gen/grpc/tester/client/encode_decode.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // tester gRPC client encoders and decoders // @@ -52,9 +52,7 @@ func DecodeTestAllResponse(ctx context.Context, v any, hdr, trlr metadata.MD) (a } res := NewTestAllResult(message) return res, nil -} - -// BuildTestSmokeFunc builds the remote method to invoke for "tester" service +} // BuildTestSmokeFunc builds the remote method to invoke for "tester" service // "test_smoke" endpoint. func BuildTestSmokeFunc(grpccli testerpb.TesterClient, cliopts ...grpc.CallOption) goagrpc.RemoteFunc { return func(ctx context.Context, reqpb any, opts ...grpc.CallOption) (any, error) { @@ -80,9 +78,7 @@ func DecodeTestSmokeResponse(ctx context.Context, v any, hdr, trlr metadata.MD) } res := NewTestSmokeResult(message) return res, nil -} - -// BuildTestForecasterFunc builds the remote method to invoke for "tester" +} // BuildTestForecasterFunc builds the remote method to invoke for "tester" // service "test_forecaster" endpoint. func BuildTestForecasterFunc(grpccli testerpb.TesterClient, cliopts ...grpc.CallOption) goagrpc.RemoteFunc { return func(ctx context.Context, reqpb any, opts ...grpc.CallOption) (any, error) { @@ -108,9 +104,7 @@ func DecodeTestForecasterResponse(ctx context.Context, v any, hdr, trlr metadata } res := NewTestForecasterResult(message) return res, nil -} - -// BuildTestLocatorFunc builds the remote method to invoke for "tester" service +} // BuildTestLocatorFunc builds the remote method to invoke for "tester" service // "test_locator" endpoint. func BuildTestLocatorFunc(grpccli testerpb.TesterClient, cliopts ...grpc.CallOption) goagrpc.RemoteFunc { return func(ctx context.Context, reqpb any, opts ...grpc.CallOption) (any, error) { diff --git a/example/weather/services/tester/gen/grpc/tester/client/types.go b/example/weather/services/tester/gen/grpc/tester/client/types.go index c23061ad..2ee3f7dc 100644 --- a/example/weather/services/tester/gen/grpc/tester/client/types.go +++ b/example/weather/services/tester/gen/grpc/tester/client/types.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // tester gRPC client types // diff --git a/example/weather/services/tester/gen/grpc/tester/pb/goagen_tester_tester.pb.go b/example/weather/services/tester/gen/grpc/tester/pb/goagen_tester_tester.pb.go index 367f3d55..f3a17a05 100644 --- a/example/weather/services/tester/gen/grpc/tester/pb/goagen_tester_tester.pb.go +++ b/example/weather/services/tester/gen/grpc/tester/pb/goagen_tester_tester.pb.go @@ -1,4 +1,4 @@ -// Code generated with goa v3.14.4, DO NOT EDIT. +// Code generated with goa v3.20.0, DO NOT EDIT. // // tester protocol buffer definition // @@ -8,8 +8,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v4.25.1 +// protoc-gen-go v1.36.5 +// protoc v5.29.3 // source: goagen_tester_tester.proto package weather_testerpb @@ -19,6 +19,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -29,23 +30,20 @@ const ( ) type TestAllRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Tests to run. Allows wildcards. Include []string `protobuf:"bytes,1,rep,name=include,proto3" json:"include,omitempty"` // Tests to exclude. Allows wildcards. - Exclude []string `protobuf:"bytes,2,rep,name=exclude,proto3" json:"exclude,omitempty"` + Exclude []string `protobuf:"bytes,2,rep,name=exclude,proto3" json:"exclude,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TestAllRequest) Reset() { *x = TestAllRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_tester_tester_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_tester_tester_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TestAllRequest) String() string { @@ -56,7 +54,7 @@ func (*TestAllRequest) ProtoMessage() {} func (x *TestAllRequest) ProtoReflect() protoreflect.Message { mi := &file_goagen_tester_tester_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -86,10 +84,7 @@ func (x *TestAllRequest) GetExclude() []string { } type TestAllResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Test collections Collections []*TestCollection `protobuf:"bytes,1,rep,name=collections,proto3" json:"collections,omitempty"` // Duration of the tests in ms @@ -97,16 +92,16 @@ type TestAllResponse struct { // Number of tests that passed PassCount int32 `protobuf:"zigzag32,3,opt,name=pass_count,json=passCount,proto3" json:"pass_count,omitempty"` // Number of tests that failed - FailCount int32 `protobuf:"zigzag32,4,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` + FailCount int32 `protobuf:"zigzag32,4,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TestAllResponse) Reset() { *x = TestAllResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_tester_tester_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_tester_tester_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TestAllResponse) String() string { @@ -117,7 +112,7 @@ func (*TestAllResponse) ProtoMessage() {} func (x *TestAllResponse) ProtoReflect() protoreflect.Message { mi := &file_goagen_tester_tester_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -162,10 +157,7 @@ func (x *TestAllResponse) GetFailCount() int32 { // Collection of test results for grouping by service type TestCollection struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Name of the test collection Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Test results @@ -175,16 +167,16 @@ type TestCollection struct { // Number of tests that passed PassCount int32 `protobuf:"zigzag32,4,opt,name=pass_count,json=passCount,proto3" json:"pass_count,omitempty"` // Number of tests that failed - FailCount int32 `protobuf:"zigzag32,5,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` + FailCount int32 `protobuf:"zigzag32,5,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TestCollection) Reset() { *x = TestCollection{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_tester_tester_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_tester_tester_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TestCollection) String() string { @@ -195,7 +187,7 @@ func (*TestCollection) ProtoMessage() {} func (x *TestCollection) ProtoReflect() protoreflect.Message { mi := &file_goagen_tester_tester_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -247,10 +239,7 @@ func (x *TestCollection) GetFailCount() int32 { // Test result for a single test type TestResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Name of the test Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Status of the test @@ -258,16 +247,16 @@ type TestResult struct { // Error message if the test failed Error *string `protobuf:"bytes,3,opt,name=error,proto3,oneof" json:"error,omitempty"` // Duration of the test in ms - Duration int64 `protobuf:"zigzag64,4,opt,name=duration,proto3" json:"duration,omitempty"` + Duration int64 `protobuf:"zigzag64,4,opt,name=duration,proto3" json:"duration,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TestResult) Reset() { *x = TestResult{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_tester_tester_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_tester_tester_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TestResult) String() string { @@ -278,7 +267,7 @@ func (*TestResult) ProtoMessage() {} func (x *TestResult) ProtoReflect() protoreflect.Message { mi := &file_goagen_tester_tester_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -322,18 +311,16 @@ func (x *TestResult) GetDuration() int64 { } type TestSmokeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TestSmokeRequest) Reset() { *x = TestSmokeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_tester_tester_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_tester_tester_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TestSmokeRequest) String() string { @@ -344,7 +331,7 @@ func (*TestSmokeRequest) ProtoMessage() {} func (x *TestSmokeRequest) ProtoReflect() protoreflect.Message { mi := &file_goagen_tester_tester_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -360,10 +347,7 @@ func (*TestSmokeRequest) Descriptor() ([]byte, []int) { } type TestSmokeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Test collections Collections []*TestCollection `protobuf:"bytes,1,rep,name=collections,proto3" json:"collections,omitempty"` // Duration of the tests in ms @@ -371,16 +355,16 @@ type TestSmokeResponse struct { // Number of tests that passed PassCount int32 `protobuf:"zigzag32,3,opt,name=pass_count,json=passCount,proto3" json:"pass_count,omitempty"` // Number of tests that failed - FailCount int32 `protobuf:"zigzag32,4,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` + FailCount int32 `protobuf:"zigzag32,4,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TestSmokeResponse) Reset() { *x = TestSmokeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_tester_tester_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_tester_tester_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TestSmokeResponse) String() string { @@ -391,7 +375,7 @@ func (*TestSmokeResponse) ProtoMessage() {} func (x *TestSmokeResponse) ProtoReflect() protoreflect.Message { mi := &file_goagen_tester_tester_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -435,18 +419,16 @@ func (x *TestSmokeResponse) GetFailCount() int32 { } type TestForecasterRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TestForecasterRequest) Reset() { *x = TestForecasterRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_tester_tester_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_tester_tester_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TestForecasterRequest) String() string { @@ -457,7 +439,7 @@ func (*TestForecasterRequest) ProtoMessage() {} func (x *TestForecasterRequest) ProtoReflect() protoreflect.Message { mi := &file_goagen_tester_tester_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -473,10 +455,7 @@ func (*TestForecasterRequest) Descriptor() ([]byte, []int) { } type TestForecasterResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Test collections Collections []*TestCollection `protobuf:"bytes,1,rep,name=collections,proto3" json:"collections,omitempty"` // Duration of the tests in ms @@ -484,16 +463,16 @@ type TestForecasterResponse struct { // Number of tests that passed PassCount int32 `protobuf:"zigzag32,3,opt,name=pass_count,json=passCount,proto3" json:"pass_count,omitempty"` // Number of tests that failed - FailCount int32 `protobuf:"zigzag32,4,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` + FailCount int32 `protobuf:"zigzag32,4,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TestForecasterResponse) Reset() { *x = TestForecasterResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_tester_tester_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_tester_tester_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TestForecasterResponse) String() string { @@ -504,7 +483,7 @@ func (*TestForecasterResponse) ProtoMessage() {} func (x *TestForecasterResponse) ProtoReflect() protoreflect.Message { mi := &file_goagen_tester_tester_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -548,18 +527,16 @@ func (x *TestForecasterResponse) GetFailCount() int32 { } type TestLocatorRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TestLocatorRequest) Reset() { *x = TestLocatorRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_tester_tester_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_tester_tester_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TestLocatorRequest) String() string { @@ -570,7 +547,7 @@ func (*TestLocatorRequest) ProtoMessage() {} func (x *TestLocatorRequest) ProtoReflect() protoreflect.Message { mi := &file_goagen_tester_tester_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -586,10 +563,7 @@ func (*TestLocatorRequest) Descriptor() ([]byte, []int) { } type TestLocatorResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` // Test collections Collections []*TestCollection `protobuf:"bytes,1,rep,name=collections,proto3" json:"collections,omitempty"` // Duration of the tests in ms @@ -597,16 +571,16 @@ type TestLocatorResponse struct { // Number of tests that passed PassCount int32 `protobuf:"zigzag32,3,opt,name=pass_count,json=passCount,proto3" json:"pass_count,omitempty"` // Number of tests that failed - FailCount int32 `protobuf:"zigzag32,4,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` + FailCount int32 `protobuf:"zigzag32,4,opt,name=fail_count,json=failCount,proto3" json:"fail_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *TestLocatorResponse) Reset() { *x = TestLocatorResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_goagen_tester_tester_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_goagen_tester_tester_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *TestLocatorResponse) String() string { @@ -617,7 +591,7 @@ func (*TestLocatorResponse) ProtoMessage() {} func (x *TestLocatorResponse) ProtoReflect() protoreflect.Message { mi := &file_goagen_tester_tester_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -662,7 +636,7 @@ func (x *TestLocatorResponse) GetFailCount() int32 { var File_goagen_tester_tester_proto protoreflect.FileDescriptor -var file_goagen_tester_tester_proto_rawDesc = []byte{ +var file_goagen_tester_tester_proto_rawDesc = string([]byte{ 0x0a, 0x1a, 0x67, 0x6f, 0x61, 0x67, 0x65, 0x6e, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x22, 0x44, 0x0a, 0x0e, @@ -763,22 +737,22 @@ var file_goagen_tester_tester_proto_rawDesc = []byte{ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x13, 0x5a, 0x11, 0x2f, 0x77, 0x65, 0x61, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x65, 0x72, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +}) var ( file_goagen_tester_tester_proto_rawDescOnce sync.Once - file_goagen_tester_tester_proto_rawDescData = file_goagen_tester_tester_proto_rawDesc + file_goagen_tester_tester_proto_rawDescData []byte ) func file_goagen_tester_tester_proto_rawDescGZIP() []byte { file_goagen_tester_tester_proto_rawDescOnce.Do(func() { - file_goagen_tester_tester_proto_rawDescData = protoimpl.X.CompressGZIP(file_goagen_tester_tester_proto_rawDescData) + file_goagen_tester_tester_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_goagen_tester_tester_proto_rawDesc), len(file_goagen_tester_tester_proto_rawDesc))) }) return file_goagen_tester_tester_proto_rawDescData } var file_goagen_tester_tester_proto_msgTypes = make([]protoimpl.MessageInfo, 10) -var file_goagen_tester_tester_proto_goTypes = []interface{}{ +var file_goagen_tester_tester_proto_goTypes = []any{ (*TestAllRequest)(nil), // 0: weather_tester.TestAllRequest (*TestAllResponse)(nil), // 1: weather_tester.TestAllResponse (*TestCollection)(nil), // 2: weather_tester.TestCollection @@ -816,134 +790,12 @@ func file_goagen_tester_tester_proto_init() { if File_goagen_tester_tester_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_goagen_tester_tester_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestAllRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goagen_tester_tester_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestAllResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goagen_tester_tester_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestCollection); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goagen_tester_tester_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goagen_tester_tester_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestSmokeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goagen_tester_tester_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestSmokeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goagen_tester_tester_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestForecasterRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goagen_tester_tester_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestForecasterResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goagen_tester_tester_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestLocatorRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goagen_tester_tester_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TestLocatorResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_goagen_tester_tester_proto_msgTypes[3].OneofWrappers = []interface{}{} + file_goagen_tester_tester_proto_msgTypes[3].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_goagen_tester_tester_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_goagen_tester_tester_proto_rawDesc), len(file_goagen_tester_tester_proto_rawDesc)), NumEnums: 0, NumMessages: 10, NumExtensions: 0, @@ -954,7 +806,6 @@ func file_goagen_tester_tester_proto_init() { MessageInfos: file_goagen_tester_tester_proto_msgTypes, }.Build() File_goagen_tester_tester_proto = out.File - file_goagen_tester_tester_proto_rawDesc = nil file_goagen_tester_tester_proto_goTypes = nil file_goagen_tester_tester_proto_depIdxs = nil } diff --git a/example/weather/services/tester/gen/grpc/tester/pb/goagen_tester_tester.proto b/example/weather/services/tester/gen/grpc/tester/pb/goagen_tester_tester.proto index 0d48f95d..b0e94e8c 100644 --- a/example/weather/services/tester/gen/grpc/tester/pb/goagen_tester_tester.proto +++ b/example/weather/services/tester/gen/grpc/tester/pb/goagen_tester_tester.proto @@ -1,4 +1,4 @@ -// Code generated with goa v3.14.4, DO NOT EDIT. +// Code generated with goa v3.20.0, DO NOT EDIT. // // tester protocol buffer definition // diff --git a/example/weather/services/tester/gen/grpc/tester/pb/goagen_tester_tester_grpc.pb.go b/example/weather/services/tester/gen/grpc/tester/pb/goagen_tester_tester_grpc.pb.go index 41554e77..db5abb3f 100644 --- a/example/weather/services/tester/gen/grpc/tester/pb/goagen_tester_tester_grpc.pb.go +++ b/example/weather/services/tester/gen/grpc/tester/pb/goagen_tester_tester_grpc.pb.go @@ -1,7 +1,15 @@ +// Code generated with goa v3.20.0, DO NOT EDIT. +// +// tester protocol buffer definition +// +// Command: +// $ goa gen goa.design/clue/example/weather/services/tester/design -o +// services/tester + // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v4.25.1 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.3 // source: goagen_tester_tester.proto package weather_testerpb @@ -15,12 +23,22 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Tester_TestAll_FullMethodName = "/weather_tester.Tester/TestAll" + Tester_TestSmoke_FullMethodName = "/weather_tester.Tester/TestSmoke" + Tester_TestForecaster_FullMethodName = "/weather_tester.Tester/TestForecaster" + Tester_TestLocator_FullMethodName = "/weather_tester.Tester/TestLocator" +) // TesterClient is the client API for Tester service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// The Weather System Tester Service is used to manage the integration testing +// of the weater system type TesterClient interface { // Runs all tests in the iam system TestAll(ctx context.Context, in *TestAllRequest, opts ...grpc.CallOption) (*TestAllResponse, error) @@ -41,8 +59,9 @@ func NewTesterClient(cc grpc.ClientConnInterface) TesterClient { } func (c *testerClient) TestAll(ctx context.Context, in *TestAllRequest, opts ...grpc.CallOption) (*TestAllResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TestAllResponse) - err := c.cc.Invoke(ctx, "/weather_tester.Tester/TestAll", in, out, opts...) + err := c.cc.Invoke(ctx, Tester_TestAll_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -50,8 +69,9 @@ func (c *testerClient) TestAll(ctx context.Context, in *TestAllRequest, opts ... } func (c *testerClient) TestSmoke(ctx context.Context, in *TestSmokeRequest, opts ...grpc.CallOption) (*TestSmokeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TestSmokeResponse) - err := c.cc.Invoke(ctx, "/weather_tester.Tester/TestSmoke", in, out, opts...) + err := c.cc.Invoke(ctx, Tester_TestSmoke_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -59,8 +79,9 @@ func (c *testerClient) TestSmoke(ctx context.Context, in *TestSmokeRequest, opts } func (c *testerClient) TestForecaster(ctx context.Context, in *TestForecasterRequest, opts ...grpc.CallOption) (*TestForecasterResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TestForecasterResponse) - err := c.cc.Invoke(ctx, "/weather_tester.Tester/TestForecaster", in, out, opts...) + err := c.cc.Invoke(ctx, Tester_TestForecaster_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -68,8 +89,9 @@ func (c *testerClient) TestForecaster(ctx context.Context, in *TestForecasterReq } func (c *testerClient) TestLocator(ctx context.Context, in *TestLocatorRequest, opts ...grpc.CallOption) (*TestLocatorResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(TestLocatorResponse) - err := c.cc.Invoke(ctx, "/weather_tester.Tester/TestLocator", in, out, opts...) + err := c.cc.Invoke(ctx, Tester_TestLocator_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -78,7 +100,10 @@ func (c *testerClient) TestLocator(ctx context.Context, in *TestLocatorRequest, // TesterServer is the server API for Tester service. // All implementations must embed UnimplementedTesterServer -// for forward compatibility +// for forward compatibility. +// +// The Weather System Tester Service is used to manage the integration testing +// of the weater system type TesterServer interface { // Runs all tests in the iam system TestAll(context.Context, *TestAllRequest) (*TestAllResponse, error) @@ -91,9 +116,12 @@ type TesterServer interface { mustEmbedUnimplementedTesterServer() } -// UnimplementedTesterServer must be embedded to have forward compatible implementations. -type UnimplementedTesterServer struct { -} +// UnimplementedTesterServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedTesterServer struct{} func (UnimplementedTesterServer) TestAll(context.Context, *TestAllRequest) (*TestAllResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TestAll not implemented") @@ -108,6 +136,7 @@ func (UnimplementedTesterServer) TestLocator(context.Context, *TestLocatorReques return nil, status.Errorf(codes.Unimplemented, "method TestLocator not implemented") } func (UnimplementedTesterServer) mustEmbedUnimplementedTesterServer() {} +func (UnimplementedTesterServer) testEmbeddedByValue() {} // UnsafeTesterServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to TesterServer will @@ -117,6 +146,13 @@ type UnsafeTesterServer interface { } func RegisterTesterServer(s grpc.ServiceRegistrar, srv TesterServer) { + // If the following call pancis, it indicates UnimplementedTesterServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Tester_ServiceDesc, srv) } @@ -130,7 +166,7 @@ func _Tester_TestAll_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/weather_tester.Tester/TestAll", + FullMethod: Tester_TestAll_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TesterServer).TestAll(ctx, req.(*TestAllRequest)) @@ -148,7 +184,7 @@ func _Tester_TestSmoke_Handler(srv interface{}, ctx context.Context, dec func(in } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/weather_tester.Tester/TestSmoke", + FullMethod: Tester_TestSmoke_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TesterServer).TestSmoke(ctx, req.(*TestSmokeRequest)) @@ -166,7 +202,7 @@ func _Tester_TestForecaster_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/weather_tester.Tester/TestForecaster", + FullMethod: Tester_TestForecaster_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TesterServer).TestForecaster(ctx, req.(*TestForecasterRequest)) @@ -184,7 +220,7 @@ func _Tester_TestLocator_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/weather_tester.Tester/TestLocator", + FullMethod: Tester_TestLocator_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TesterServer).TestLocator(ctx, req.(*TestLocatorRequest)) diff --git a/example/weather/services/tester/gen/grpc/tester/server/encode_decode.go b/example/weather/services/tester/gen/grpc/tester/server/encode_decode.go index e62f1567..e4380002 100644 --- a/example/weather/services/tester/gen/grpc/tester/server/encode_decode.go +++ b/example/weather/services/tester/gen/grpc/tester/server/encode_decode.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // tester gRPC server encoders and decoders // diff --git a/example/weather/services/tester/gen/grpc/tester/server/server.go b/example/weather/services/tester/gen/grpc/tester/server/server.go index f389aae5..ed665c2c 100644 --- a/example/weather/services/tester/gen/grpc/tester/server/server.go +++ b/example/weather/services/tester/gen/grpc/tester/server/server.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // tester gRPC server // diff --git a/example/weather/services/tester/gen/grpc/tester/server/types.go b/example/weather/services/tester/gen/grpc/tester/server/types.go index 4649c8db..f99fe4ee 100644 --- a/example/weather/services/tester/gen/grpc/tester/server/types.go +++ b/example/weather/services/tester/gen/grpc/tester/server/types.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // tester gRPC server types // diff --git a/example/weather/services/tester/gen/tester/client.go b/example/weather/services/tester/gen/tester/client.go index 4a36c5f1..bb976be4 100644 --- a/example/weather/services/tester/gen/tester/client.go +++ b/example/weather/services/tester/gen/tester/client.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // tester client // diff --git a/example/weather/services/tester/gen/tester/endpoints.go b/example/weather/services/tester/gen/tester/endpoints.go index 80b6731c..c7391df2 100644 --- a/example/weather/services/tester/gen/tester/endpoints.go +++ b/example/weather/services/tester/gen/tester/endpoints.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // tester endpoints // diff --git a/example/weather/services/tester/gen/tester/service.go b/example/weather/services/tester/gen/tester/service.go index e6632bf2..bf1b2d6e 100644 --- a/example/weather/services/tester/gen/tester/service.go +++ b/example/weather/services/tester/gen/tester/service.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.14.4, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // tester service // @@ -27,14 +27,17 @@ type Service interface { TestLocator(context.Context) (res *TestResults, err error) } +// APIName is the name of the API as defined in the design. +const APIName = "Tester Service API" + +// APIVersion is the version of the API as defined in the design. +const APIVersion = "0.0.1" + // ServiceName is the name of the service as defined in the design. This is the // same value that is set in the endpoint request contexts under the ServiceKey // key. const ServiceName = "tester" -// APIVersion is the version of the API as defined in the design. -const APIVersion = "0.0.1" - // MethodNames lists the service method names as defined in the design. These // are the same values that are set in the endpoint request contexts under the // MethodKey key. diff --git a/go.mod b/go.mod index fb3cd0db..3d73e0a8 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module goa.design/clue -go 1.22.0 - -toolchain go1.23.2 +go 1.24.0 require ( github.com/aws/smithy-go v1.22.2 @@ -20,7 +18,7 @@ require ( go.opentelemetry.io/otel/sdk v1.34.0 go.opentelemetry.io/otel/sdk/metric v1.34.0 go.opentelemetry.io/otel/trace v1.34.0 - goa.design/goa/v3 v3.19.1 + goa.design/goa/v3 v3.20.0 golang.org/x/term v0.29.0 golang.org/x/tools v0.30.0 google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 @@ -32,8 +30,9 @@ require ( github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dimfeld/httppath v0.0.0-20170720192232-ee938bf73598 // indirect - github.com/go-chi/chi/v5 v5.1.0 // indirect + github.com/go-chi/chi/v5 v5.2.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/gohugoio/hashstructure v0.5.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.25.1 // indirect @@ -47,6 +46,6 @@ require ( golang.org/x/sys v0.30.0 // indirect golang.org/x/text v0.22.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 00a81e9d..a64aaef6 100644 --- a/go.sum +++ b/go.sum @@ -6,13 +6,15 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dimfeld/httppath v0.0.0-20170720192232-ee938bf73598 h1:MGKhKyiYrvMDZsmLR/+RGffQSXwEkXgfLSA08qDn9AI= github.com/dimfeld/httppath v0.0.0-20170720192232-ee938bf73598/go.mod h1:0FpDmbrt36utu8jEmeU05dPC9AB5tsLYVVi+ZHfyuwI= -github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= -github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8= +github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/gohugoio/hashstructure v0.5.0 h1:G2fjSBU36RdwEJBWJ+919ERvOVqAg9tfcYp47K9swqg= +github.com/gohugoio/hashstructure v0.5.0/go.mod h1:Ser0TniXuu/eauYmrwM4o64EBvySxNzITEOLlm4igec= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -67,8 +69,8 @@ go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -goa.design/goa/v3 v3.19.1 h1:jpV3LEy7YANzPMwm++Lu17RoThRJgXrPxdEM0A1nlOE= -goa.design/goa/v3 v3.19.1/go.mod h1:astNE9ube0YCxqq7DQkt1MtLxB/b3kRPEFkEZovcO2I= +goa.design/goa/v3 v3.20.0 h1:mYYNqCBg9SSxe2jxvPJFOPmJqqKkSAUSU84jpczky3s= +goa.design/goa/v3 v3.20.0/go.mod h1:g8sT4ioTaRt8BZKwZ1YOQe7UgWqkZMx+q6NWgQfzLUU= golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= @@ -87,8 +89,8 @@ google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 h1:Df6WuGvthPzc+Ji google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53/go.mod h1:fheguH3Am2dGp1LfXkrvwqC/KlFq8F0nLq3LryOMrrE= google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f h1:gap6+3Gk41EItBuyi4XX/bp4oqJ3UwuIMl25yGinuAA= google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:Ic02D47M+zbarjYYUlK57y316f2MoN0gjAwI3f2S95o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2 h1:DMTIbak9GhdaSxEjvVzAeNZvyc03I61duqNbnm3SU0M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250219182151-9fdb1cabc7b2/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ= google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw= google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM= diff --git a/go.work b/go.work index 2f019532..61a66eef 100644 --- a/go.work +++ b/go.work @@ -1,4 +1,4 @@ -go 1.22.0 +go 1.24.0 use ( . diff --git a/go.work.sum b/go.work.sum index 7e8f75d0..84110359 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,6 +1,7 @@ cel.dev/expr v0.16.0/go.mod h1:TRSuuV7DlVCE/uwv5QbAiW/v8l5O8C4eEPHeu7gf7Sg= cel.dev/expr v0.16.2 h1:RwRhoH17VhAu9U5CMvMhH1PDVgf0tuz9FT+24AfMLfU= cel.dev/expr v0.16.2/go.mod h1:gXngZQMkWJoSbE8mOzehJlXQyubn/Vg0vR9/F3W7iw8= +cel.dev/expr v0.19.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= cloud.google.com/go v0.115.1/go.mod h1:DuujITeaufu3gL68/lOFIirVNJwQeyf5UXyi+Wbgknc= cloud.google.com/go v0.116.0 h1:B3fRrSDkLRt5qSHWe40ERJvhvnQwdZiHu0bJOpldweE= cloud.google.com/go v0.116.0/go.mod h1:cEPSRWPzZEswwdr9BxE6ChEn01dWlTaF05LiC2Xs70U= @@ -251,6 +252,7 @@ cloud.google.com/go/workflows v1.13.1 h1:DkxrZ4HyXvjQLZWsYAUOV1w7d2a43XscM9dmkIG cloud.google.com/go/workflows v1.13.1/go.mod h1:xNdYtD6Sjoug+khNCAtBMK/rdh8qkjyL6aBas2XlkNc= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.2 h1:cZpsGsWTIFKymTA0je7IIvi1O7Es7apb9CF3EQlOcfE= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.2/go.mod h1:itPGVDKf9cC/ov4MdvJ2QZ0khw4bfoo9jzwTJlaxy2k= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM= github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/aws/aws-lambda-go v1.47.0 h1:0H8s0vumYx/YKs4sE7YM0ktwL2eWse+kfopsRI1sXVI= @@ -276,6 +278,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/getkin/kin-openapi v0.127.0 h1:Mghqi3Dhryf3F8vR370nN67pAERW+3a95vomb3MAREY= github.com/getkin/kin-openapi v0.127.0/go.mod h1:OZrfXzUfGrNbsKj+xmFBx6E5c6yH3At/tAKSc2UszXM= +github.com/getkin/kin-openapi v0.129.0 h1:QGYTNcmyP5X0AtFQ2Dkou9DGBJsUETeLH9rFrJXZh30= +github.com/getkin/kin-openapi v0.129.0/go.mod h1:gmWI+b/J45xqpyK5wJmRRZse5wefA5H0RDMK46kLUtI= github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= github.com/go-kit/kit v0.13.0/go.mod h1:phqEHMMUbyrCFCTgH48JueqrM3md2HcAZ8N3XE4FKDg= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= @@ -288,6 +292,7 @@ github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.3/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -313,6 +318,10 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/oasdiff/yaml v0.0.0-20241210131133-6b86fb107d80 h1:nZspmSkneBbtxU9TopEAE0CY+SBJLxO8LPUlw2vG4pU= +github.com/oasdiff/yaml v0.0.0-20241210131133-6b86fb107d80/go.mod h1:7tFDb+Y51LcDpn26GccuUgQXUk6t0CXZsivKjyimYX8= +github.com/oasdiff/yaml3 v0.0.0-20241210130736-a94c01f36349 h1:t05Ww3DxZutOqbMN+7OIuqDwXbhl32HiZGpLy26BAPc= +github.com/oasdiff/yaml3 v0.0.0-20241210130736-a94c01f36349/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= @@ -340,18 +349,31 @@ github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opentelemetry.io/contrib/detectors/gcp v1.31.0 h1:G1JQOreVrfhRkner+l4mrGxmfqYCAuy76asTDAo0xsA= go.opentelemetry.io/contrib/detectors/gcp v1.31.0/go.mod h1:tzQL6E1l+iV44YFTkcAeNQqzXUiekSYP9jjJjXwEd00= +go.opentelemetry.io/contrib/detectors/gcp v1.32.0/go.mod h1:TVqo0Sda4Cv8gCIixd7LuLwW4EylumVWfhjZJjDD4DU= +go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= +go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= +go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= +go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ= +go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= goa.design/goa/v3 v3.16.2/go.mod h1:YAY4TIUGlQH0Rj9AWtAyPktH3WLGWRaGxi3P19RvGXU= +goa.design/goa/v3 v3.19.2-rc1.0.20250204015405-712ab19bf18e h1:jxePNfrUUGjDJSCP47YKQQg6X/5f8oz+u8ZkYAFu05w= +goa.design/goa/v3 v3.19.2-rc1.0.20250204015405-712ab19bf18e/go.mod h1:39rNqYA90yz3gCBfDhAQuA93MgdbraMpoeErvzqD00Y= +goa.design/goa/v3 v3.20.0-rc1/go.mod h1:YFTHST5DUS9dPdL42h3o/Wtdb9VU6tKbytBxc5hOeLU= golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE= @@ -360,38 +382,47 @@ golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457 h1:zf5N6UOrA487eEFacMePxjXAJctxKmyjKUsjA11Uzuk= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= +golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc h1:Nf+EdcTLHR8qDNN/KfkQL0u0ssxt9OhbaWCl5C0ucEI= google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53/go.mod h1:riSXTwQ4+nqmPGtobMFyW5FqVAmIs0St6VPp4Ug7CE4= +google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY= google.golang.org/genproto/googleapis/api v0.0.0-20241219192143-6b3ec007d9bb/go.mod h1:E5//3O5ZIG2l71Xnt+P/CYUY8Bxs8E7WMoZ9tlcMbAY= google.golang.org/genproto/googleapis/api v0.0.0-20250102185135-69823020774d/go.mod h1:2v7Z7gP2ZUOGsaFyxATQSRoBnKygqVq2Cwnvom7QiqY= google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/genproto/googleapis/rpc v0.0.0-20240930140551-af27646dc61f/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= google.golang.org/genproto/googleapis/rpc v0.0.0-20241219192143-6b3ec007d9bb/go.mod h1:lcTa1sDdWEIHMWlITnIczmw5w60CF9ffkb8Z+DVmmjA= google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/grpc v1.69.2/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= +google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/internal/testsvc/gen/grpc/cli/itest/cli.go b/internal/testsvc/gen/grpc/cli/itest/cli.go index 10beff51..e8afdbcd 100644 --- a/internal/testsvc/gen/grpc/cli/itest/cli.go +++ b/internal/testsvc/gen/grpc/cli/itest/cli.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // itest gRPC client CLI support package // @@ -36,7 +36,10 @@ func UsageExamples() string { // ParseEndpoint returns the endpoint and payload as specified on the command // line. -func ParseEndpoint(cc *grpc.ClientConn, opts ...grpc.CallOption) (goa.Endpoint, interface{}, error) { +func ParseEndpoint( + cc *grpc.ClientConn, + opts ...grpc.CallOption, +) (goa.Endpoint, any, error) { var ( testFlags = flag.NewFlagSet("test", flag.ContinueOnError) @@ -105,7 +108,7 @@ func ParseEndpoint(cc *grpc.ClientConn, opts ...grpc.CallOption) (goa.Endpoint, } var ( - data interface{} + data any endpoint goa.Endpoint err error ) @@ -114,12 +117,12 @@ func ParseEndpoint(cc *grpc.ClientConn, opts ...grpc.CallOption) (goa.Endpoint, case "test": c := testc.NewClient(cc, opts...) switch epn { + case "grpc-method": endpoint = c.GrpcMethod() data, err = testc.BuildGrpcMethodPayload(*testGrpcMethodMessageFlag) case "grpc-stream": endpoint = c.GrpcStream() - data = nil } } } diff --git a/internal/testsvc/gen/grpc/test/client/cli.go b/internal/testsvc/gen/grpc/test/client/cli.go index c3c07ef2..fad25a05 100644 --- a/internal/testsvc/gen/grpc/test/client/cli.go +++ b/internal/testsvc/gen/grpc/test/client/cli.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test gRPC client CLI support package // @@ -28,13 +28,12 @@ func BuildGrpcMethodPayload(testGrpcMethodMessage string) (*test.Fields, error) } } } - v := &test.Fields{} - if message.S != "" { - v.S = &message.S + v := &test.Fields{ + S: message.S, } - if message.I != 0 { - iptr := int(message.I) - v.I = &iptr + if message.I != nil { + i := int(*message.I) + v.I = &i } return v, nil diff --git a/internal/testsvc/gen/grpc/test/client/client.go b/internal/testsvc/gen/grpc/test/client/client.go index 9508bc68..c6e95af1 100644 --- a/internal/testsvc/gen/grpc/test/client/client.go +++ b/internal/testsvc/gen/grpc/test/client/client.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test gRPC client // @@ -21,9 +21,7 @@ import ( type Client struct { grpccli testpb.TestClient opts []grpc.CallOption -} - -// GrpcStreamClientStream implements the test.GrpcStreamClientStream interface. +} // GrpcStreamClientStream implements the test.GrpcStreamClientStream interface. type GrpcStreamClientStream struct { stream testpb.Test_GrpcStreamClient } @@ -34,18 +32,16 @@ func NewClient(cc *grpc.ClientConn, opts ...grpc.CallOption) *Client { grpccli: testpb.NewTestClient(cc), opts: opts, } -} - -// GrpcMethod calls the "GrpcMethod" function in testpb.TestClient interface. +} // GrpcMethod calls the "GrpcMethod" function in testpb.TestClient interface. func (c *Client) GrpcMethod() goa.Endpoint { - return func(ctx context.Context, v interface{}) (interface{}, error) { + return func(ctx context.Context, v any) (any, error) { inv := goagrpc.NewInvoker( BuildGrpcMethodFunc(c.grpccli, c.opts...), EncodeGrpcMethodRequest, DecodeGrpcMethodResponse) res, err := inv.Invoke(ctx, v) if err != nil { - return nil, goa.Fault(err.Error()) + return nil, goa.Fault("%s", err.Error()) } return res, nil } @@ -53,14 +49,14 @@ func (c *Client) GrpcMethod() goa.Endpoint { // GrpcStream calls the "GrpcStream" function in testpb.TestClient interface. func (c *Client) GrpcStream() goa.Endpoint { - return func(ctx context.Context, v interface{}) (interface{}, error) { + return func(ctx context.Context, v any) (any, error) { inv := goagrpc.NewInvoker( BuildGrpcStreamFunc(c.grpccli, c.opts...), nil, DecodeGrpcStreamResponse) res, err := inv.Invoke(ctx, v) if err != nil { - return nil, goa.Fault(err.Error()) + return nil, goa.Fault("%s", err.Error()) } return res, nil } @@ -74,16 +70,28 @@ func (s *GrpcStreamClientStream) Recv() (*test.Fields, error) { if err != nil { return res, err } - return NewFields(v), nil + return NewGrpcStreamResponseFields(v), nil +} + +// RecvWithContext reads instances of "testpb.GrpcStreamResponse" from the +// "grpc_stream" endpoint gRPC stream with context. +func (s *GrpcStreamClientStream) RecvWithContext(ctx context.Context) (*test.Fields, error) { + return s.Recv() } // Send streams instances of "testpb.GrpcStreamStreamingRequest" to the // "grpc_stream" endpoint gRPC stream. func (s *GrpcStreamClientStream) Send(res *test.Fields) error { - v := NewProtoGrpcStreamStreamingRequest(res) + v := NewProtoFieldsGrpcStreamStreamingRequest(res) return s.stream.Send(v) } +// SendWithContext streams instances of "testpb.GrpcStreamStreamingRequest" to +// the "grpc_stream" endpoint gRPC stream with context. +func (s *GrpcStreamClientStream) SendWithContext(ctx context.Context, res *test.Fields) error { + return s.Send(res) +} + func (s *GrpcStreamClientStream) Close() error { // Close the send direction of the stream return s.stream.CloseSend() diff --git a/internal/testsvc/gen/grpc/test/client/encode_decode.go b/internal/testsvc/gen/grpc/test/client/encode_decode.go index c82fdc93..6d56c500 100644 --- a/internal/testsvc/gen/grpc/test/client/encode_decode.go +++ b/internal/testsvc/gen/grpc/test/client/encode_decode.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test gRPC client encoders and decoders // @@ -20,7 +20,7 @@ import ( // BuildGrpcMethodFunc builds the remote method to invoke for "test" service // "grpc_method" endpoint. func BuildGrpcMethodFunc(grpccli testpb.TestClient, cliopts ...grpc.CallOption) goagrpc.RemoteFunc { - return func(ctx context.Context, reqpb interface{}, opts ...grpc.CallOption) (interface{}, error) { + return func(ctx context.Context, reqpb any, opts ...grpc.CallOption) (any, error) { for _, opt := range cliopts { opts = append(opts, opt) } @@ -32,7 +32,7 @@ func BuildGrpcMethodFunc(grpccli testpb.TestClient, cliopts ...grpc.CallOption) } // EncodeGrpcMethodRequest encodes requests sent to test grpc_method endpoint. -func EncodeGrpcMethodRequest(ctx context.Context, v interface{}, md *metadata.MD) (interface{}, error) { +func EncodeGrpcMethodRequest(ctx context.Context, v any, md *metadata.MD) (any, error) { payload, ok := v.(*test.Fields) if !ok { return nil, goagrpc.ErrInvalidType("test", "grpc_method", "*test.Fields", v) @@ -42,19 +42,17 @@ func EncodeGrpcMethodRequest(ctx context.Context, v interface{}, md *metadata.MD // DecodeGrpcMethodResponse decodes responses from the test grpc_method // endpoint. -func DecodeGrpcMethodResponse(ctx context.Context, v interface{}, hdr, trlr metadata.MD) (interface{}, error) { +func DecodeGrpcMethodResponse(ctx context.Context, v any, hdr, trlr metadata.MD) (any, error) { message, ok := v.(*testpb.GrpcMethodResponse) if !ok { return nil, goagrpc.ErrInvalidType("test", "grpc_method", "*testpb.GrpcMethodResponse", v) } res := NewGrpcMethodResult(message) return res, nil -} - -// BuildGrpcStreamFunc builds the remote method to invoke for "test" service +} // BuildGrpcStreamFunc builds the remote method to invoke for "test" service // "grpc_stream" endpoint. func BuildGrpcStreamFunc(grpccli testpb.TestClient, cliopts ...grpc.CallOption) goagrpc.RemoteFunc { - return func(ctx context.Context, reqpb interface{}, opts ...grpc.CallOption) (interface{}, error) { + return func(ctx context.Context, reqpb any, opts ...grpc.CallOption) (any, error) { for _, opt := range cliopts { opts = append(opts, opt) } @@ -67,7 +65,7 @@ func BuildGrpcStreamFunc(grpccli testpb.TestClient, cliopts ...grpc.CallOption) // DecodeGrpcStreamResponse decodes responses from the test grpc_stream // endpoint. -func DecodeGrpcStreamResponse(ctx context.Context, v interface{}, hdr, trlr metadata.MD) (interface{}, error) { +func DecodeGrpcStreamResponse(ctx context.Context, v any, hdr, trlr metadata.MD) (any, error) { return &GrpcStreamClientStream{ stream: v.(testpb.Test_GrpcStreamClient), }, nil diff --git a/internal/testsvc/gen/grpc/test/client/types.go b/internal/testsvc/gen/grpc/test/client/types.go index 5971d15b..55bc54fd 100644 --- a/internal/testsvc/gen/grpc/test/client/types.go +++ b/internal/testsvc/gen/grpc/test/client/types.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test gRPC client types // @@ -15,12 +15,12 @@ import ( // NewProtoGrpcMethodRequest builds the gRPC request type from the payload of // the "grpc_method" endpoint of the "test" service. func NewProtoGrpcMethodRequest(payload *test.Fields) *testpb.GrpcMethodRequest { - message := &testpb.GrpcMethodRequest{} - if payload.S != nil { - message.S = *payload.S + message := &testpb.GrpcMethodRequest{ + S: payload.S, } if payload.I != nil { - message.I = int32(*payload.I) + i := int32(*payload.I) + message.I = &i } return message } @@ -28,36 +28,34 @@ func NewProtoGrpcMethodRequest(payload *test.Fields) *testpb.GrpcMethodRequest { // NewGrpcMethodResult builds the result type of the "grpc_method" endpoint of // the "test" service from the gRPC response type. func NewGrpcMethodResult(message *testpb.GrpcMethodResponse) *test.Fields { - result := &test.Fields{} - if message.S != "" { - result.S = &message.S + result := &test.Fields{ + S: message.S, } - if message.I != 0 { - iptr := int(message.I) - result.I = &iptr + if message.I != nil { + i := int(*message.I) + result.I = &i } return result } -func NewFields(v *testpb.GrpcStreamResponse) *test.Fields { - result := &test.Fields{} - if v.S != "" { - result.S = &v.S +func NewGrpcStreamResponseFields(v *testpb.GrpcStreamResponse) *test.Fields { + result := &test.Fields{ + S: v.S, } - if v.I != 0 { - iptr := int(v.I) - result.I = &iptr + if v.I != nil { + i := int(*v.I) + result.I = &i } return result } -func NewProtoGrpcStreamStreamingRequest(spayload *test.Fields) *testpb.GrpcStreamStreamingRequest { - v := &testpb.GrpcStreamStreamingRequest{} - if spayload.S != nil { - v.S = *spayload.S +func NewProtoFieldsGrpcStreamStreamingRequest(spayload *test.Fields) *testpb.GrpcStreamStreamingRequest { + v := &testpb.GrpcStreamStreamingRequest{ + S: spayload.S, } if spayload.I != nil { - v.I = int32(*spayload.I) + i := int32(*spayload.I) + v.I = &i } return v } diff --git a/internal/testsvc/gen/grpc/test/pb/goadesign_goagen_test.pb.go b/internal/testsvc/gen/grpc/test/pb/goadesign_goagen_test.pb.go deleted file mode 100644 index c3f720ea..00000000 --- a/internal/testsvc/gen/grpc/test/pb/goadesign_goagen_test.pb.go +++ /dev/null @@ -1,393 +0,0 @@ -// Code generated with goa v3.9.1, DO NOT EDIT. -// -// test protocol buffer definition -// -// Command: -// $ goa gen goa.design/clue/internal/testsvc/design - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.7 -// source: goadesign_goagen_test.proto - -package testpb - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GrpcMethodRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // String operand - S string `protobuf:"bytes,1,opt,name=s,proto3" json:"s,omitempty"` - // Int operand - I int32 `protobuf:"zigzag32,2,opt,name=i,proto3" json:"i,omitempty"` -} - -func (x *GrpcMethodRequest) Reset() { - *x = GrpcMethodRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_goadesign_goagen_test_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GrpcMethodRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GrpcMethodRequest) ProtoMessage() {} - -func (x *GrpcMethodRequest) ProtoReflect() protoreflect.Message { - mi := &file_goadesign_goagen_test_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GrpcMethodRequest.ProtoReflect.Descriptor instead. -func (*GrpcMethodRequest) Descriptor() ([]byte, []int) { - return file_goadesign_goagen_test_proto_rawDescGZIP(), []int{0} -} - -func (x *GrpcMethodRequest) GetS() string { - if x != nil { - return x.S - } - return "" -} - -func (x *GrpcMethodRequest) GetI() int32 { - if x != nil { - return x.I - } - return 0 -} - -type GrpcMethodResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // String operand - S string `protobuf:"bytes,1,opt,name=s,proto3" json:"s,omitempty"` - // Int operand - I int32 `protobuf:"zigzag32,2,opt,name=i,proto3" json:"i,omitempty"` -} - -func (x *GrpcMethodResponse) Reset() { - *x = GrpcMethodResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_goadesign_goagen_test_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GrpcMethodResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GrpcMethodResponse) ProtoMessage() {} - -func (x *GrpcMethodResponse) ProtoReflect() protoreflect.Message { - mi := &file_goadesign_goagen_test_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GrpcMethodResponse.ProtoReflect.Descriptor instead. -func (*GrpcMethodResponse) Descriptor() ([]byte, []int) { - return file_goadesign_goagen_test_proto_rawDescGZIP(), []int{1} -} - -func (x *GrpcMethodResponse) GetS() string { - if x != nil { - return x.S - } - return "" -} - -func (x *GrpcMethodResponse) GetI() int32 { - if x != nil { - return x.I - } - return 0 -} - -type GrpcStreamStreamingRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // String operand - S string `protobuf:"bytes,1,opt,name=s,proto3" json:"s,omitempty"` - // Int operand - I int32 `protobuf:"zigzag32,2,opt,name=i,proto3" json:"i,omitempty"` -} - -func (x *GrpcStreamStreamingRequest) Reset() { - *x = GrpcStreamStreamingRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_goadesign_goagen_test_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GrpcStreamStreamingRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GrpcStreamStreamingRequest) ProtoMessage() {} - -func (x *GrpcStreamStreamingRequest) ProtoReflect() protoreflect.Message { - mi := &file_goadesign_goagen_test_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GrpcStreamStreamingRequest.ProtoReflect.Descriptor instead. -func (*GrpcStreamStreamingRequest) Descriptor() ([]byte, []int) { - return file_goadesign_goagen_test_proto_rawDescGZIP(), []int{2} -} - -func (x *GrpcStreamStreamingRequest) GetS() string { - if x != nil { - return x.S - } - return "" -} - -func (x *GrpcStreamStreamingRequest) GetI() int32 { - if x != nil { - return x.I - } - return 0 -} - -type GrpcStreamResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // String operand - S string `protobuf:"bytes,1,opt,name=s,proto3" json:"s,omitempty"` - // Int operand - I int32 `protobuf:"zigzag32,2,opt,name=i,proto3" json:"i,omitempty"` -} - -func (x *GrpcStreamResponse) Reset() { - *x = GrpcStreamResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_goadesign_goagen_test_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GrpcStreamResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GrpcStreamResponse) ProtoMessage() {} - -func (x *GrpcStreamResponse) ProtoReflect() protoreflect.Message { - mi := &file_goadesign_goagen_test_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GrpcStreamResponse.ProtoReflect.Descriptor instead. -func (*GrpcStreamResponse) Descriptor() ([]byte, []int) { - return file_goadesign_goagen_test_proto_rawDescGZIP(), []int{3} -} - -func (x *GrpcStreamResponse) GetS() string { - if x != nil { - return x.S - } - return "" -} - -func (x *GrpcStreamResponse) GetI() int32 { - if x != nil { - return x.I - } - return 0 -} - -var File_goadesign_goagen_test_proto protoreflect.FileDescriptor - -var file_goadesign_goagen_test_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x67, 0x6f, 0x61, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x67, 0x6f, 0x61, 0x67, - 0x65, 0x6e, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x74, - 0x65, 0x73, 0x74, 0x22, 0x2f, 0x0a, 0x11, 0x47, 0x72, 0x70, 0x63, 0x4d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x01, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x11, 0x52, 0x01, 0x69, 0x22, 0x30, 0x0a, 0x12, 0x47, 0x72, 0x70, 0x63, 0x4d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x69, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x11, 0x52, 0x01, 0x69, 0x22, 0x38, 0x0a, 0x1a, 0x47, 0x72, 0x70, 0x63, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x01, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x11, 0x52, 0x01, 0x69, - 0x22, 0x30, 0x0a, 0x12, 0x47, 0x72, 0x70, 0x63, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x01, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x11, 0x52, - 0x01, 0x69, 0x32, 0x95, 0x01, 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0a, 0x47, - 0x72, 0x70, 0x63, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x17, 0x2e, 0x74, 0x65, 0x73, 0x74, - 0x2e, 0x47, 0x72, 0x70, 0x63, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x4d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0a, - 0x47, 0x72, 0x70, 0x63, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x20, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x42, 0x09, 0x5a, 0x07, 0x2f, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_goadesign_goagen_test_proto_rawDescOnce sync.Once - file_goadesign_goagen_test_proto_rawDescData = file_goadesign_goagen_test_proto_rawDesc -) - -func file_goadesign_goagen_test_proto_rawDescGZIP() []byte { - file_goadesign_goagen_test_proto_rawDescOnce.Do(func() { - file_goadesign_goagen_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_goadesign_goagen_test_proto_rawDescData) - }) - return file_goadesign_goagen_test_proto_rawDescData -} - -var file_goadesign_goagen_test_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_goadesign_goagen_test_proto_goTypes = []interface{}{ - (*GrpcMethodRequest)(nil), // 0: test.GrpcMethodRequest - (*GrpcMethodResponse)(nil), // 1: test.GrpcMethodResponse - (*GrpcStreamStreamingRequest)(nil), // 2: test.GrpcStreamStreamingRequest - (*GrpcStreamResponse)(nil), // 3: test.GrpcStreamResponse -} -var file_goadesign_goagen_test_proto_depIdxs = []int32{ - 0, // 0: test.Test.GrpcMethod:input_type -> test.GrpcMethodRequest - 2, // 1: test.Test.GrpcStream:input_type -> test.GrpcStreamStreamingRequest - 1, // 2: test.Test.GrpcMethod:output_type -> test.GrpcMethodResponse - 3, // 3: test.Test.GrpcStream:output_type -> test.GrpcStreamResponse - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_goadesign_goagen_test_proto_init() } -func file_goadesign_goagen_test_proto_init() { - if File_goadesign_goagen_test_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_goadesign_goagen_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GrpcMethodRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goadesign_goagen_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GrpcMethodResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goadesign_goagen_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GrpcStreamStreamingRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_goadesign_goagen_test_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GrpcStreamResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_goadesign_goagen_test_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_goadesign_goagen_test_proto_goTypes, - DependencyIndexes: file_goadesign_goagen_test_proto_depIdxs, - MessageInfos: file_goadesign_goagen_test_proto_msgTypes, - }.Build() - File_goadesign_goagen_test_proto = out.File - file_goadesign_goagen_test_proto_rawDesc = nil - file_goadesign_goagen_test_proto_goTypes = nil - file_goadesign_goagen_test_proto_depIdxs = nil -} diff --git a/internal/testsvc/gen/grpc/test/pb/goagen_testsvc_test.pb.go b/internal/testsvc/gen/grpc/test/pb/goagen_testsvc_test.pb.go new file mode 100644 index 00000000..06486ea2 --- /dev/null +++ b/internal/testsvc/gen/grpc/test/pb/goagen_testsvc_test.pb.go @@ -0,0 +1,341 @@ +// Code generated with goa v3.20.0, DO NOT EDIT. +// +// test protocol buffer definition +// +// Command: +// $ goa gen goa.design/clue/internal/testsvc/design + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.5 +// protoc v5.29.3 +// source: goagen_testsvc_test.proto + +package testpb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type GrpcMethodRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // String operand + S *string `protobuf:"bytes,1,opt,name=s,proto3,oneof" json:"s,omitempty"` + // Int operand + I *int32 `protobuf:"zigzag32,2,opt,name=i,proto3,oneof" json:"i,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GrpcMethodRequest) Reset() { + *x = GrpcMethodRequest{} + mi := &file_goagen_testsvc_test_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GrpcMethodRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrpcMethodRequest) ProtoMessage() {} + +func (x *GrpcMethodRequest) ProtoReflect() protoreflect.Message { + mi := &file_goagen_testsvc_test_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GrpcMethodRequest.ProtoReflect.Descriptor instead. +func (*GrpcMethodRequest) Descriptor() ([]byte, []int) { + return file_goagen_testsvc_test_proto_rawDescGZIP(), []int{0} +} + +func (x *GrpcMethodRequest) GetS() string { + if x != nil && x.S != nil { + return *x.S + } + return "" +} + +func (x *GrpcMethodRequest) GetI() int32 { + if x != nil && x.I != nil { + return *x.I + } + return 0 +} + +type GrpcMethodResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // String operand + S *string `protobuf:"bytes,1,opt,name=s,proto3,oneof" json:"s,omitempty"` + // Int operand + I *int32 `protobuf:"zigzag32,2,opt,name=i,proto3,oneof" json:"i,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GrpcMethodResponse) Reset() { + *x = GrpcMethodResponse{} + mi := &file_goagen_testsvc_test_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GrpcMethodResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrpcMethodResponse) ProtoMessage() {} + +func (x *GrpcMethodResponse) ProtoReflect() protoreflect.Message { + mi := &file_goagen_testsvc_test_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GrpcMethodResponse.ProtoReflect.Descriptor instead. +func (*GrpcMethodResponse) Descriptor() ([]byte, []int) { + return file_goagen_testsvc_test_proto_rawDescGZIP(), []int{1} +} + +func (x *GrpcMethodResponse) GetS() string { + if x != nil && x.S != nil { + return *x.S + } + return "" +} + +func (x *GrpcMethodResponse) GetI() int32 { + if x != nil && x.I != nil { + return *x.I + } + return 0 +} + +type GrpcStreamStreamingRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + // String operand + S *string `protobuf:"bytes,1,opt,name=s,proto3,oneof" json:"s,omitempty"` + // Int operand + I *int32 `protobuf:"zigzag32,2,opt,name=i,proto3,oneof" json:"i,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GrpcStreamStreamingRequest) Reset() { + *x = GrpcStreamStreamingRequest{} + mi := &file_goagen_testsvc_test_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GrpcStreamStreamingRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrpcStreamStreamingRequest) ProtoMessage() {} + +func (x *GrpcStreamStreamingRequest) ProtoReflect() protoreflect.Message { + mi := &file_goagen_testsvc_test_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GrpcStreamStreamingRequest.ProtoReflect.Descriptor instead. +func (*GrpcStreamStreamingRequest) Descriptor() ([]byte, []int) { + return file_goagen_testsvc_test_proto_rawDescGZIP(), []int{2} +} + +func (x *GrpcStreamStreamingRequest) GetS() string { + if x != nil && x.S != nil { + return *x.S + } + return "" +} + +func (x *GrpcStreamStreamingRequest) GetI() int32 { + if x != nil && x.I != nil { + return *x.I + } + return 0 +} + +type GrpcStreamResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + // String operand + S *string `protobuf:"bytes,1,opt,name=s,proto3,oneof" json:"s,omitempty"` + // Int operand + I *int32 `protobuf:"zigzag32,2,opt,name=i,proto3,oneof" json:"i,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *GrpcStreamResponse) Reset() { + *x = GrpcStreamResponse{} + mi := &file_goagen_testsvc_test_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *GrpcStreamResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GrpcStreamResponse) ProtoMessage() {} + +func (x *GrpcStreamResponse) ProtoReflect() protoreflect.Message { + mi := &file_goagen_testsvc_test_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GrpcStreamResponse.ProtoReflect.Descriptor instead. +func (*GrpcStreamResponse) Descriptor() ([]byte, []int) { + return file_goagen_testsvc_test_proto_rawDescGZIP(), []int{3} +} + +func (x *GrpcStreamResponse) GetS() string { + if x != nil && x.S != nil { + return *x.S + } + return "" +} + +func (x *GrpcStreamResponse) GetI() int32 { + if x != nil && x.I != nil { + return *x.I + } + return 0 +} + +var File_goagen_testsvc_test_proto protoreflect.FileDescriptor + +var file_goagen_testsvc_test_proto_rawDesc = string([]byte{ + 0x0a, 0x19, 0x67, 0x6f, 0x61, 0x67, 0x65, 0x6e, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x73, 0x76, 0x63, + 0x5f, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x74, 0x65, 0x73, + 0x74, 0x22, 0x45, 0x0a, 0x11, 0x47, 0x72, 0x70, 0x63, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x11, 0x0a, 0x01, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x01, 0x73, 0x88, 0x01, 0x01, 0x12, 0x11, 0x0a, 0x01, 0x69, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x11, 0x48, 0x01, 0x52, 0x01, 0x69, 0x88, 0x01, 0x01, 0x42, 0x04, 0x0a, 0x02, + 0x5f, 0x73, 0x42, 0x04, 0x0a, 0x02, 0x5f, 0x69, 0x22, 0x46, 0x0a, 0x12, 0x47, 0x72, 0x70, 0x63, + 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x11, + 0x0a, 0x01, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x01, 0x73, 0x88, 0x01, + 0x01, 0x12, 0x11, 0x0a, 0x01, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x11, 0x48, 0x01, 0x52, 0x01, + 0x69, 0x88, 0x01, 0x01, 0x42, 0x04, 0x0a, 0x02, 0x5f, 0x73, 0x42, 0x04, 0x0a, 0x02, 0x5f, 0x69, + 0x22, 0x4e, 0x0a, 0x1a, 0x47, 0x72, 0x70, 0x63, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x11, + 0x0a, 0x01, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x01, 0x73, 0x88, 0x01, + 0x01, 0x12, 0x11, 0x0a, 0x01, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, 0x11, 0x48, 0x01, 0x52, 0x01, + 0x69, 0x88, 0x01, 0x01, 0x42, 0x04, 0x0a, 0x02, 0x5f, 0x73, 0x42, 0x04, 0x0a, 0x02, 0x5f, 0x69, + 0x22, 0x46, 0x0a, 0x12, 0x47, 0x72, 0x70, 0x63, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x11, 0x0a, 0x01, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x48, 0x00, 0x52, 0x01, 0x73, 0x88, 0x01, 0x01, 0x12, 0x11, 0x0a, 0x01, 0x69, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x11, 0x48, 0x01, 0x52, 0x01, 0x69, 0x88, 0x01, 0x01, 0x42, 0x04, 0x0a, 0x02, + 0x5f, 0x73, 0x42, 0x04, 0x0a, 0x02, 0x5f, 0x69, 0x32, 0x95, 0x01, 0x0a, 0x04, 0x54, 0x65, 0x73, + 0x74, 0x12, 0x3f, 0x0a, 0x0a, 0x47, 0x72, 0x70, 0x63, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, + 0x17, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, + 0x47, 0x72, 0x70, 0x63, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x4c, 0x0a, 0x0a, 0x47, 0x72, 0x70, 0x63, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x12, 0x20, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x53, 0x74, + 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, + 0x42, 0x09, 0x5a, 0x07, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +}) + +var ( + file_goagen_testsvc_test_proto_rawDescOnce sync.Once + file_goagen_testsvc_test_proto_rawDescData []byte +) + +func file_goagen_testsvc_test_proto_rawDescGZIP() []byte { + file_goagen_testsvc_test_proto_rawDescOnce.Do(func() { + file_goagen_testsvc_test_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_goagen_testsvc_test_proto_rawDesc), len(file_goagen_testsvc_test_proto_rawDesc))) + }) + return file_goagen_testsvc_test_proto_rawDescData +} + +var file_goagen_testsvc_test_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_goagen_testsvc_test_proto_goTypes = []any{ + (*GrpcMethodRequest)(nil), // 0: test.GrpcMethodRequest + (*GrpcMethodResponse)(nil), // 1: test.GrpcMethodResponse + (*GrpcStreamStreamingRequest)(nil), // 2: test.GrpcStreamStreamingRequest + (*GrpcStreamResponse)(nil), // 3: test.GrpcStreamResponse +} +var file_goagen_testsvc_test_proto_depIdxs = []int32{ + 0, // 0: test.Test.GrpcMethod:input_type -> test.GrpcMethodRequest + 2, // 1: test.Test.GrpcStream:input_type -> test.GrpcStreamStreamingRequest + 1, // 2: test.Test.GrpcMethod:output_type -> test.GrpcMethodResponse + 3, // 3: test.Test.GrpcStream:output_type -> test.GrpcStreamResponse + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_goagen_testsvc_test_proto_init() } +func file_goagen_testsvc_test_proto_init() { + if File_goagen_testsvc_test_proto != nil { + return + } + file_goagen_testsvc_test_proto_msgTypes[0].OneofWrappers = []any{} + file_goagen_testsvc_test_proto_msgTypes[1].OneofWrappers = []any{} + file_goagen_testsvc_test_proto_msgTypes[2].OneofWrappers = []any{} + file_goagen_testsvc_test_proto_msgTypes[3].OneofWrappers = []any{} + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_goagen_testsvc_test_proto_rawDesc), len(file_goagen_testsvc_test_proto_rawDesc)), + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_goagen_testsvc_test_proto_goTypes, + DependencyIndexes: file_goagen_testsvc_test_proto_depIdxs, + MessageInfos: file_goagen_testsvc_test_proto_msgTypes, + }.Build() + File_goagen_testsvc_test_proto = out.File + file_goagen_testsvc_test_proto_goTypes = nil + file_goagen_testsvc_test_proto_depIdxs = nil +} diff --git a/internal/testsvc/gen/grpc/test/pb/goadesign_goagen_test.proto b/internal/testsvc/gen/grpc/test/pb/goagen_testsvc_test.proto similarity index 75% rename from internal/testsvc/gen/grpc/test/pb/goadesign_goagen_test.proto rename to internal/testsvc/gen/grpc/test/pb/goagen_testsvc_test.proto index 9cab8557..f348ffad 100644 --- a/internal/testsvc/gen/grpc/test/pb/goadesign_goagen_test.proto +++ b/internal/testsvc/gen/grpc/test/pb/goagen_testsvc_test.proto @@ -1,4 +1,4 @@ -// Code generated with goa v3.9.1, DO NOT EDIT. +// Code generated with goa v3.20.0, DO NOT EDIT. // // test protocol buffer definition // @@ -21,28 +21,28 @@ service Test { message GrpcMethodRequest { // String operand - string s = 1; + optional string s = 1; // Int operand - sint32 i = 2; + optional sint32 i = 2; } message GrpcMethodResponse { // String operand - string s = 1; + optional string s = 1; // Int operand - sint32 i = 2; + optional sint32 i = 2; } message GrpcStreamStreamingRequest { // String operand - string s = 1; + optional string s = 1; // Int operand - sint32 i = 2; + optional sint32 i = 2; } message GrpcStreamResponse { // String operand - string s = 1; + optional string s = 1; // Int operand - sint32 i = 2; + optional sint32 i = 2; } diff --git a/internal/testsvc/gen/grpc/test/pb/goadesign_goagen_test_grpc.pb.go b/internal/testsvc/gen/grpc/test/pb/goagen_testsvc_test_grpc.pb.go similarity index 56% rename from internal/testsvc/gen/grpc/test/pb/goadesign_goagen_test_grpc.pb.go rename to internal/testsvc/gen/grpc/test/pb/goagen_testsvc_test_grpc.pb.go index 493ed977..88689aa0 100644 --- a/internal/testsvc/gen/grpc/test/pb/goadesign_goagen_test_grpc.pb.go +++ b/internal/testsvc/gen/grpc/test/pb/goagen_testsvc_test_grpc.pb.go @@ -1,8 +1,15 @@ +// Code generated with goa v3.20.0, DO NOT EDIT. +// +// test protocol buffer definition +// +// Command: +// $ goa gen goa.design/clue/internal/testsvc/design + // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.7 -// source: goadesign_goagen_test.proto +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.29.3 +// source: goagen_testsvc_test.proto package testpb @@ -15,17 +22,24 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 + +const ( + Test_GrpcMethod_FullMethodName = "/test.Test/GrpcMethod" + Test_GrpcStream_FullMethodName = "/test.Test/GrpcStream" +) // TestClient is the client API for Test service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +// +// Service is the test service interface. type TestClient interface { // GrpcMethod implements grpc_method. GrpcMethod(ctx context.Context, in *GrpcMethodRequest, opts ...grpc.CallOption) (*GrpcMethodResponse, error) // GrpcStream implements grpc_stream. - GrpcStream(ctx context.Context, opts ...grpc.CallOption) (Test_GrpcStreamClient, error) + GrpcStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[GrpcStreamStreamingRequest, GrpcStreamResponse], error) } type testClient struct { @@ -37,67 +51,56 @@ func NewTestClient(cc grpc.ClientConnInterface) TestClient { } func (c *testClient) GrpcMethod(ctx context.Context, in *GrpcMethodRequest, opts ...grpc.CallOption) (*GrpcMethodResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GrpcMethodResponse) - err := c.cc.Invoke(ctx, "/test.Test/GrpcMethod", in, out, opts...) + err := c.cc.Invoke(ctx, Test_GrpcMethod_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *testClient) GrpcStream(ctx context.Context, opts ...grpc.CallOption) (Test_GrpcStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &Test_ServiceDesc.Streams[0], "/test.Test/GrpcStream", opts...) +func (c *testClient) GrpcStream(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[GrpcStreamStreamingRequest, GrpcStreamResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &Test_ServiceDesc.Streams[0], Test_GrpcStream_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &testGrpcStreamClient{stream} + x := &grpc.GenericClientStream[GrpcStreamStreamingRequest, GrpcStreamResponse]{ClientStream: stream} return x, nil } -type Test_GrpcStreamClient interface { - Send(*GrpcStreamStreamingRequest) error - Recv() (*GrpcStreamResponse, error) - grpc.ClientStream -} - -type testGrpcStreamClient struct { - grpc.ClientStream -} - -func (x *testGrpcStreamClient) Send(m *GrpcStreamStreamingRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *testGrpcStreamClient) Recv() (*GrpcStreamResponse, error) { - m := new(GrpcStreamResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Test_GrpcStreamClient = grpc.BidiStreamingClient[GrpcStreamStreamingRequest, GrpcStreamResponse] // TestServer is the server API for Test service. // All implementations must embed UnimplementedTestServer -// for forward compatibility +// for forward compatibility. +// +// Service is the test service interface. type TestServer interface { // GrpcMethod implements grpc_method. GrpcMethod(context.Context, *GrpcMethodRequest) (*GrpcMethodResponse, error) // GrpcStream implements grpc_stream. - GrpcStream(Test_GrpcStreamServer) error + GrpcStream(grpc.BidiStreamingServer[GrpcStreamStreamingRequest, GrpcStreamResponse]) error mustEmbedUnimplementedTestServer() } -// UnimplementedTestServer must be embedded to have forward compatible implementations. -type UnimplementedTestServer struct { -} +// UnimplementedTestServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedTestServer struct{} func (UnimplementedTestServer) GrpcMethod(context.Context, *GrpcMethodRequest) (*GrpcMethodResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GrpcMethod not implemented") } -func (UnimplementedTestServer) GrpcStream(Test_GrpcStreamServer) error { +func (UnimplementedTestServer) GrpcStream(grpc.BidiStreamingServer[GrpcStreamStreamingRequest, GrpcStreamResponse]) error { return status.Errorf(codes.Unimplemented, "method GrpcStream not implemented") } func (UnimplementedTestServer) mustEmbedUnimplementedTestServer() {} +func (UnimplementedTestServer) testEmbeddedByValue() {} // UnsafeTestServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to TestServer will @@ -107,6 +110,13 @@ type UnsafeTestServer interface { } func RegisterTestServer(s grpc.ServiceRegistrar, srv TestServer) { + // If the following call pancis, it indicates UnimplementedTestServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&Test_ServiceDesc, srv) } @@ -120,7 +130,7 @@ func _Test_GrpcMethod_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/test.Test/GrpcMethod", + FullMethod: Test_GrpcMethod_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TestServer).GrpcMethod(ctx, req.(*GrpcMethodRequest)) @@ -129,30 +139,11 @@ func _Test_GrpcMethod_Handler(srv interface{}, ctx context.Context, dec func(int } func _Test_GrpcStream_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(TestServer).GrpcStream(&testGrpcStreamServer{stream}) -} - -type Test_GrpcStreamServer interface { - Send(*GrpcStreamResponse) error - Recv() (*GrpcStreamStreamingRequest, error) - grpc.ServerStream + return srv.(TestServer).GrpcStream(&grpc.GenericServerStream[GrpcStreamStreamingRequest, GrpcStreamResponse]{ServerStream: stream}) } -type testGrpcStreamServer struct { - grpc.ServerStream -} - -func (x *testGrpcStreamServer) Send(m *GrpcStreamResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *testGrpcStreamServer) Recv() (*GrpcStreamStreamingRequest, error) { - m := new(GrpcStreamStreamingRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type Test_GrpcStreamServer = grpc.BidiStreamingServer[GrpcStreamStreamingRequest, GrpcStreamResponse] // Test_ServiceDesc is the grpc.ServiceDesc for Test service. // It's only intended for direct use with grpc.RegisterService, @@ -174,5 +165,5 @@ var Test_ServiceDesc = grpc.ServiceDesc{ ClientStreams: true, }, }, - Metadata: "goadesign_goagen_test.proto", + Metadata: "goagen_testsvc_test.proto", } diff --git a/internal/testsvc/gen/grpc/test/server/encode_decode.go b/internal/testsvc/gen/grpc/test/server/encode_decode.go index e4d432f0..92db9775 100644 --- a/internal/testsvc/gen/grpc/test/server/encode_decode.go +++ b/internal/testsvc/gen/grpc/test/server/encode_decode.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test gRPC server encoders and decoders // @@ -18,7 +18,7 @@ import ( // EncodeGrpcMethodResponse encodes responses from the "test" service // "grpc_method" endpoint. -func EncodeGrpcMethodResponse(ctx context.Context, v interface{}, hdr, trlr *metadata.MD) (interface{}, error) { +func EncodeGrpcMethodResponse(ctx context.Context, v any, hdr, trlr *metadata.MD) (any, error) { result, ok := v.(*test.Fields) if !ok { return nil, goagrpc.ErrInvalidType("test", "grpc_method", "*test.Fields", v) @@ -29,7 +29,7 @@ func EncodeGrpcMethodResponse(ctx context.Context, v interface{}, hdr, trlr *met // DecodeGrpcMethodRequest decodes requests sent to "test" service // "grpc_method" endpoint. -func DecodeGrpcMethodRequest(ctx context.Context, v interface{}, md metadata.MD) (interface{}, error) { +func DecodeGrpcMethodRequest(ctx context.Context, v any, md metadata.MD) (any, error) { var ( message *testpb.GrpcMethodRequest ok bool @@ -48,7 +48,7 @@ func DecodeGrpcMethodRequest(ctx context.Context, v interface{}, md metadata.MD) // EncodeGrpcStreamResponse encodes responses from the "test" service // "grpc_stream" endpoint. -func EncodeGrpcStreamResponse(ctx context.Context, v interface{}, hdr, trlr *metadata.MD) (interface{}, error) { +func EncodeGrpcStreamResponse(ctx context.Context, v any, hdr, trlr *metadata.MD) (any, error) { result, ok := v.(*test.Fields) if !ok { return nil, goagrpc.ErrInvalidType("test", "grpc_stream", "*test.Fields", v) diff --git a/internal/testsvc/gen/grpc/test/server/server.go b/internal/testsvc/gen/grpc/test/server/server.go index 5cb746c0..5ea3fb26 100644 --- a/internal/testsvc/gen/grpc/test/server/server.go +++ b/internal/testsvc/gen/grpc/test/server/server.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test gRPC server // @@ -87,10 +87,16 @@ func (s *Server) GrpcStream(stream testpb.Test_GrpcStreamServer) error { // Send streams instances of "testpb.GrpcStreamResponse" to the "grpc_stream" // endpoint gRPC stream. func (s *GrpcStreamServerStream) Send(res *test.Fields) error { - v := NewProtoGrpcStreamResponse(res) + v := NewProtoFieldsGrpcStreamResponse(res) return s.stream.Send(v) } +// SendWithContext streams instances of "testpb.GrpcStreamResponse" to the +// "grpc_stream" endpoint gRPC stream with context. +func (s *GrpcStreamServerStream) SendWithContext(ctx context.Context, res *test.Fields) error { + return s.Send(res) +} + // Recv reads instances of "testpb.GrpcStreamStreamingRequest" from the // "grpc_stream" endpoint gRPC stream. func (s *GrpcStreamServerStream) Recv() (*test.Fields, error) { @@ -99,7 +105,13 @@ func (s *GrpcStreamServerStream) Recv() (*test.Fields, error) { if err != nil { return res, err } - return NewFields(v), nil + return NewGrpcStreamStreamingRequestFields(v), nil +} + +// RecvWithContext reads instances of "testpb.GrpcStreamStreamingRequest" from +// the "grpc_stream" endpoint gRPC stream with context. +func (s *GrpcStreamServerStream) RecvWithContext(ctx context.Context) (*test.Fields, error) { + return s.Recv() } func (s *GrpcStreamServerStream) Close() error { diff --git a/internal/testsvc/gen/grpc/test/server/types.go b/internal/testsvc/gen/grpc/test/server/types.go index b5c6e57e..e5a32067 100644 --- a/internal/testsvc/gen/grpc/test/server/types.go +++ b/internal/testsvc/gen/grpc/test/server/types.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test gRPC server types // @@ -15,13 +15,12 @@ import ( // NewGrpcMethodPayload builds the payload of the "grpc_method" endpoint of the // "test" service from the gRPC request type. func NewGrpcMethodPayload(message *testpb.GrpcMethodRequest) *test.Fields { - v := &test.Fields{} - if message.S != "" { - v.S = &message.S + v := &test.Fields{ + S: message.S, } - if message.I != 0 { - iptr := int(message.I) - v.I = &iptr + if message.I != nil { + i := int(*message.I) + v.I = &i } return v } @@ -29,12 +28,12 @@ func NewGrpcMethodPayload(message *testpb.GrpcMethodRequest) *test.Fields { // NewProtoGrpcMethodResponse builds the gRPC response type from the result of // the "grpc_method" endpoint of the "test" service. func NewProtoGrpcMethodResponse(result *test.Fields) *testpb.GrpcMethodResponse { - message := &testpb.GrpcMethodResponse{} - if result.S != nil { - message.S = *result.S + message := &testpb.GrpcMethodResponse{ + S: result.S, } if result.I != nil { - message.I = int32(*result.I) + i := int32(*result.I) + message.I = &i } return message } @@ -42,24 +41,34 @@ func NewProtoGrpcMethodResponse(result *test.Fields) *testpb.GrpcMethodResponse // NewProtoGrpcStreamResponse builds the gRPC response type from the result of // the "grpc_stream" endpoint of the "test" service. func NewProtoGrpcStreamResponse(result *test.Fields) *testpb.GrpcStreamResponse { - message := &testpb.GrpcStreamResponse{} - if result.S != nil { - message.S = *result.S + message := &testpb.GrpcStreamResponse{ + S: result.S, } if result.I != nil { - message.I = int32(*result.I) + i := int32(*result.I) + message.I = &i } return message } -func NewFields(v *testpb.GrpcStreamStreamingRequest) *test.Fields { - spayload := &test.Fields{} - if v.S != "" { - spayload.S = &v.S +func NewProtoFieldsGrpcStreamResponse(result *test.Fields) *testpb.GrpcStreamResponse { + v := &testpb.GrpcStreamResponse{ + S: result.S, } - if v.I != 0 { - iptr := int(v.I) - spayload.I = &iptr + if result.I != nil { + i := int32(*result.I) + v.I = &i + } + return v +} + +func NewGrpcStreamStreamingRequestFields(v *testpb.GrpcStreamStreamingRequest) *test.Fields { + spayload := &test.Fields{ + S: v.S, + } + if v.I != nil { + i := int(*v.I) + spayload.I = &i } return spayload } diff --git a/internal/testsvc/gen/http/cli/itest/cli.go b/internal/testsvc/gen/http/cli/itest/cli.go index 5d2955da..f9300de2 100644 --- a/internal/testsvc/gen/http/cli/itest/cli.go +++ b/internal/testsvc/gen/http/cli/itest/cli.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // itest HTTP client CLI support package // @@ -42,7 +42,7 @@ func ParseEndpoint( enc func(*http.Request) goahttp.Encoder, dec func(*http.Response) goahttp.Decoder, restore bool, -) (goa.Endpoint, interface{}, error) { +) (goa.Endpoint, any, error) { var ( testFlags = flag.NewFlagSet("test", flag.ContinueOnError) @@ -106,7 +106,7 @@ func ParseEndpoint( } var ( - data interface{} + data any endpoint goa.Endpoint err error ) diff --git a/internal/testsvc/gen/http/openapi.json b/internal/testsvc/gen/http/openapi.json index 91f9c172..d8db8f6c 100644 --- a/internal/testsvc/gen/http/openapi.json +++ b/internal/testsvc/gen/http/openapi.json @@ -1 +1 @@ -{"swagger":"2.0","info":{"title":"","description":"metrics test service","version":""},"host":"localhost:80","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/{i}":{"post":{"tags":["test"],"summary":"http_method test","operationId":"test#http_method","parameters":[{"name":"i","in":"path","description":"Int operand","required":true,"type":"integer"},{"name":"http_method_request_body","in":"body","required":true,"schema":{"$ref":"#/definitions/TestHTTPMethodRequestBody"}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/TestHTTPMethodResponseBody"}}},"schemes":["http"]}}},"definitions":{"TestHTTPMethodRequestBody":{"title":"TestHTTPMethodRequestBody","type":"object","properties":{"s":{"type":"string","description":"String operand","example":"Eos nulla ut doloremque."}},"example":{"s":"Placeat quam dolores est corporis nulla ipsam."}},"TestHTTPMethodResponseBody":{"title":"TestHTTPMethodResponseBody","type":"object","properties":{"i":{"type":"integer","description":"Int operand","example":8526503336960817370,"format":"int64"},"s":{"type":"string","description":"String operand","example":"Esse perspiciatis officiis a reprehenderit quam consequatur."}},"example":{"i":3221232481350240723,"s":"Vel esse illo quos doloremque provident consequatur."}}}} \ No newline at end of file +{"swagger":"2.0","info":{"title":"","description":"metrics test service","version":"0.0.1"},"host":"localhost:80","consumes":["application/json","application/xml","application/gob"],"produces":["application/json","application/xml","application/gob"],"paths":{"/{i}":{"post":{"tags":["test"],"summary":"http_method test","operationId":"test#http_method","parameters":[{"name":"i","in":"path","description":"Int operand","required":true,"type":"integer"},{"name":"http_method_request_body","in":"body","required":true,"schema":{"$ref":"#/definitions/Fields"}}],"responses":{"200":{"description":"OK response.","schema":{"$ref":"#/definitions/Fields"}}},"schemes":["http"]}}},"definitions":{"Fields":{"title":"Fields","type":"object","properties":{"i":{"type":"integer","description":"Int operand","example":8526503336960817370,"format":"int64"},"s":{"type":"string","description":"String operand","example":"Esse perspiciatis officiis a reprehenderit quam consequatur."}},"example":{"i":3221232481350240723,"s":"Vel esse illo quos doloremque provident consequatur."}}}} \ No newline at end of file diff --git a/internal/testsvc/gen/http/openapi.yaml b/internal/testsvc/gen/http/openapi.yaml index 9b4a59b8..3434665f 100644 --- a/internal/testsvc/gen/http/openapi.yaml +++ b/internal/testsvc/gen/http/openapi.yaml @@ -2,7 +2,7 @@ swagger: "2.0" info: title: "" description: metrics test service - version: "" + version: 0.0.1 host: localhost:80 consumes: - application/json @@ -29,27 +29,17 @@ paths: in: body required: true schema: - $ref: '#/definitions/TestHTTPMethodRequestBody' + $ref: '#/definitions/Fields' responses: "200": description: OK response. schema: - $ref: '#/definitions/TestHTTPMethodResponseBody' + $ref: '#/definitions/Fields' schemes: - http definitions: - TestHTTPMethodRequestBody: - title: TestHTTPMethodRequestBody - type: object - properties: - s: - type: string - description: String operand - example: Eos nulla ut doloremque. - example: - s: Placeat quam dolores est corporis nulla ipsam. - TestHTTPMethodResponseBody: - title: TestHTTPMethodResponseBody + Fields: + title: Fields type: object properties: i: diff --git a/internal/testsvc/gen/http/openapi3.json b/internal/testsvc/gen/http/openapi3.json index 23d29d74..15cd7783 100644 --- a/internal/testsvc/gen/http/openapi3.json +++ b/internal/testsvc/gen/http/openapi3.json @@ -1 +1 @@ -{"openapi":"3.0.3","info":{"title":"Goa API","description":"metrics test service","version":"1.0"},"servers":[{"url":"http://localhost:80","description":"Default server for itest"}],"paths":{"/{i}":{"post":{"tags":["test"],"summary":"http_method test","operationId":"test#http_method","parameters":[{"name":"i","in":"path","description":"Int operand","required":true,"schema":{"type":"integer","description":"Int operand","example":3649691564958456519,"format":"int64"},"example":1375309373032297875}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPMethodRequestBody"},"example":{"s":"Voluptas exercitationem vitae."}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Fields"},"example":{"i":4403340894134448357,"s":"In modi et."}}}}}}}},"components":{"schemas":{"Fields":{"type":"object","properties":{"i":{"type":"integer","description":"Int operand","example":6616172494300219579,"format":"int64"},"s":{"type":"string","description":"String operand","example":"Recusandae quis est illum voluptatem."}},"example":{"i":2844263105501442990,"s":"Aliquam facere officia."}},"HTTPMethodRequestBody":{"type":"object","properties":{"s":{"type":"string","description":"String operand","example":"Voluptatem dolor inventore possimus delectus minima ipsa."}},"example":{"s":"Quia laborum et distinctio dolores."}}}},"tags":[{"name":"test"}]} \ No newline at end of file +{"openapi":"3.0.3","info":{"title":"Goa API","description":"metrics test service","version":"0.0.1"},"servers":[{"url":"http://localhost:80","description":"Default server for itest"}],"paths":{"/{i}":{"post":{"tags":["test"],"summary":"http_method test","operationId":"test#http_method","parameters":[{"name":"i","in":"path","description":"Int operand","required":true,"schema":{"type":"integer","description":"Int operand","example":5686343733477757409,"format":"int64"},"example":5571735705013562983}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Fields2"},"example":{"s":"Voluptas exercitationem vitae."}}}},"responses":{"200":{"description":"OK response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Fields"},"example":{"i":4403340894134448357,"s":"In modi et."}}}}}}}},"components":{"schemas":{"Fields":{"type":"object","properties":{"i":{"type":"integer","description":"Int operand","example":506856245359991540,"format":"int64"},"s":{"type":"string","description":"String operand","example":"Eos nulla ut doloremque."}},"example":{"i":8161197411161146199,"s":"Quam dolores est corporis nulla."}},"Fields2":{"type":"object","properties":{"s":{"type":"string","description":"String operand","example":"Voluptatem dolor inventore possimus delectus minima ipsa."}},"example":{"s":"Quia laborum et distinctio dolores."}}}},"tags":[{"name":"test"}]} \ No newline at end of file diff --git a/internal/testsvc/gen/http/openapi3.yaml b/internal/testsvc/gen/http/openapi3.yaml index 4c8bb924..bdc13b01 100644 --- a/internal/testsvc/gen/http/openapi3.yaml +++ b/internal/testsvc/gen/http/openapi3.yaml @@ -2,7 +2,7 @@ openapi: 3.0.3 info: title: Goa API description: metrics test service - version: "1.0" + version: 0.0.1 servers: - url: http://localhost:80 description: Default server for itest @@ -21,15 +21,15 @@ paths: schema: type: integer description: Int operand - example: 3649691564958456519 + example: 5686343733477757409 format: int64 - example: 1375309373032297875 + example: 5571735705013562983 requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/HTTPMethodRequestBody' + $ref: '#/components/schemas/Fields2' example: s: Voluptas exercitationem vitae. responses: @@ -50,16 +50,16 @@ components: i: type: integer description: Int operand - example: 6616172494300219579 + example: 506856245359991540 format: int64 s: type: string description: String operand - example: Recusandae quis est illum voluptatem. + example: Eos nulla ut doloremque. example: - i: 2844263105501442990 - s: Aliquam facere officia. - HTTPMethodRequestBody: + i: 8161197411161146199 + s: Quam dolores est corporis nulla. + Fields2: type: object properties: s: diff --git a/internal/testsvc/gen/http/test/client/cli.go b/internal/testsvc/gen/http/test/client/cli.go index 45725c5e..a3b6a908 100644 --- a/internal/testsvc/gen/http/test/client/cli.go +++ b/internal/testsvc/gen/http/test/client/cli.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test HTTP client CLI support package // diff --git a/internal/testsvc/gen/http/test/client/client.go b/internal/testsvc/gen/http/test/client/client.go index 9d70b6de..f964d765 100644 --- a/internal/testsvc/gen/http/test/client/client.go +++ b/internal/testsvc/gen/http/test/client/client.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test client HTTP transport // @@ -57,7 +57,7 @@ func (c *Client) HTTPMethod() goa.Endpoint { encodeRequest = EncodeHTTPMethodRequest(c.encoder) decodeResponse = DecodeHTTPMethodResponse(c.decoder, c.RestoreResponseBody) ) - return func(ctx context.Context, v interface{}) (interface{}, error) { + return func(ctx context.Context, v any) (any, error) { req, err := c.BuildHTTPMethodRequest(ctx, v) if err != nil { return nil, err diff --git a/internal/testsvc/gen/http/test/client/encode_decode.go b/internal/testsvc/gen/http/test/client/encode_decode.go index b4e27e84..fbd00d01 100644 --- a/internal/testsvc/gen/http/test/client/encode_decode.go +++ b/internal/testsvc/gen/http/test/client/encode_decode.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test HTTP client encoders and decoders // @@ -20,7 +20,7 @@ import ( // BuildHTTPMethodRequest instantiates a HTTP request object with method and // path set to call the "test" service "http_method" endpoint -func (c *Client) BuildHTTPMethodRequest(ctx context.Context, v interface{}) (*http.Request, error) { +func (c *Client) BuildHTTPMethodRequest(ctx context.Context, v any) (*http.Request, error) { var ( i int ) @@ -47,8 +47,8 @@ func (c *Client) BuildHTTPMethodRequest(ctx context.Context, v interface{}) (*ht // EncodeHTTPMethodRequest returns an encoder for requests sent to the test // http_method server. -func EncodeHTTPMethodRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, interface{}) error { - return func(req *http.Request, v interface{}) error { +func EncodeHTTPMethodRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, any) error { + return func(req *http.Request, v any) error { p, ok := v.(*test.Fields) if !ok { return goahttp.ErrInvalidType("test", "http_method", "*test.Fields", v) @@ -64,8 +64,8 @@ func EncodeHTTPMethodRequest(encoder func(*http.Request) goahttp.Encoder) func(* // DecodeHTTPMethodResponse returns a decoder for responses returned by the // test http_method endpoint. restoreBody controls whether the response body // should be restored after having been read. -func DecodeHTTPMethodResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (interface{}, error) { - return func(resp *http.Response) (interface{}, error) { +func DecodeHTTPMethodResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error) { + return func(resp *http.Response) (any, error) { if restoreBody { b, err := io.ReadAll(resp.Body) if err != nil { diff --git a/internal/testsvc/gen/http/test/client/paths.go b/internal/testsvc/gen/http/test/client/paths.go index 51a366b8..ba841eff 100644 --- a/internal/testsvc/gen/http/test/client/paths.go +++ b/internal/testsvc/gen/http/test/client/paths.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // HTTP request path constructors for the test service. // diff --git a/internal/testsvc/gen/http/test/client/types.go b/internal/testsvc/gen/http/test/client/types.go index 6fbed129..1cdda435 100644 --- a/internal/testsvc/gen/http/test/client/types.go +++ b/internal/testsvc/gen/http/test/client/types.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test HTTP client types // diff --git a/internal/testsvc/gen/http/test/server/encode_decode.go b/internal/testsvc/gen/http/test/server/encode_decode.go index b14531fe..2285aab6 100644 --- a/internal/testsvc/gen/http/test/server/encode_decode.go +++ b/internal/testsvc/gen/http/test/server/encode_decode.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test HTTP server encoders and decoders // @@ -9,6 +9,7 @@ package server import ( "context" + "errors" "io" "net/http" "strconv" @@ -20,8 +21,8 @@ import ( // EncodeHTTPMethodResponse returns an encoder for responses returned by the // test http_method endpoint. -func EncodeHTTPMethodResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error { - return func(ctx context.Context, w http.ResponseWriter, v interface{}) error { +func EncodeHTTPMethodResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error { + return func(ctx context.Context, w http.ResponseWriter, v any) error { res, _ := v.(*test.Fields) enc := encoder(ctx, w) body := NewHTTPMethodResponseBody(res) @@ -32,8 +33,8 @@ func EncodeHTTPMethodResponse(encoder func(context.Context, http.ResponseWriter) // DecodeHTTPMethodRequest returns a decoder for requests sent to the test // http_method endpoint. -func DecodeHTTPMethodRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error) { - return func(r *http.Request) (interface{}, error) { +func DecodeHTTPMethodRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (any, error) { + return func(r *http.Request) (any, error) { var ( body HTTPMethodRequestBody err error @@ -43,6 +44,10 @@ func DecodeHTTPMethodRequest(mux goahttp.Muxer, decoder func(*http.Request) goah if err == io.EOF { return nil, goa.MissingPayloadError() } + var gerr *goa.ServiceError + if errors.As(err, &gerr) { + return nil, gerr + } return nil, goa.DecodePayloadError(err.Error()) } diff --git a/internal/testsvc/gen/http/test/server/paths.go b/internal/testsvc/gen/http/test/server/paths.go index 4dfa6faa..8e6170be 100644 --- a/internal/testsvc/gen/http/test/server/paths.go +++ b/internal/testsvc/gen/http/test/server/paths.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // HTTP request path constructors for the test service. // diff --git a/internal/testsvc/gen/http/test/server/server.go b/internal/testsvc/gen/http/test/server/server.go index 793115ba..77a1a80b 100644 --- a/internal/testsvc/gen/http/test/server/server.go +++ b/internal/testsvc/gen/http/test/server/server.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test HTTP server // diff --git a/internal/testsvc/gen/http/test/server/types.go b/internal/testsvc/gen/http/test/server/types.go index 1a15a633..2b7ea5e3 100644 --- a/internal/testsvc/gen/http/test/server/types.go +++ b/internal/testsvc/gen/http/test/server/types.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test HTTP server types // diff --git a/internal/testsvc/gen/test/client.go b/internal/testsvc/gen/test/client.go index 183112b0..bce72df2 100644 --- a/internal/testsvc/gen/test/client.go +++ b/internal/testsvc/gen/test/client.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test client // @@ -31,7 +31,7 @@ func NewClient(hTTPMethod, grpcMethod, grpcStream goa.Endpoint) *Client { // HTTPMethod calls the "http_method" endpoint of the "test" service. func (c *Client) HTTPMethod(ctx context.Context, p *Fields) (res *Fields, err error) { - var ires interface{} + var ires any ires, err = c.HTTPMethodEndpoint(ctx, p) if err != nil { return @@ -41,7 +41,7 @@ func (c *Client) HTTPMethod(ctx context.Context, p *Fields) (res *Fields, err er // GrpcMethod calls the "grpc_method" endpoint of the "test" service. func (c *Client) GrpcMethod(ctx context.Context, p *Fields) (res *Fields, err error) { - var ires interface{} + var ires any ires, err = c.GrpcMethodEndpoint(ctx, p) if err != nil { return @@ -51,7 +51,7 @@ func (c *Client) GrpcMethod(ctx context.Context, p *Fields) (res *Fields, err er // GrpcStream calls the "grpc_stream" endpoint of the "test" service. func (c *Client) GrpcStream(ctx context.Context) (res GrpcStreamClientStream, err error) { - var ires interface{} + var ires any ires, err = c.GrpcStreamEndpoint(ctx, nil) if err != nil { return diff --git a/internal/testsvc/gen/test/endpoints.go b/internal/testsvc/gen/test/endpoints.go index 4c092026..a67401bf 100644 --- a/internal/testsvc/gen/test/endpoints.go +++ b/internal/testsvc/gen/test/endpoints.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test endpoints // @@ -46,7 +46,7 @@ func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint) { // NewHTTPMethodEndpoint returns an endpoint function that calls the method // "http_method" of service "test". func NewHTTPMethodEndpoint(s Service) goa.Endpoint { - return func(ctx context.Context, req interface{}) (interface{}, error) { + return func(ctx context.Context, req any) (any, error) { p := req.(*Fields) return s.HTTPMethod(ctx, p) } @@ -55,7 +55,7 @@ func NewHTTPMethodEndpoint(s Service) goa.Endpoint { // NewGrpcMethodEndpoint returns an endpoint function that calls the method // "grpc_method" of service "test". func NewGrpcMethodEndpoint(s Service) goa.Endpoint { - return func(ctx context.Context, req interface{}) (interface{}, error) { + return func(ctx context.Context, req any) (any, error) { p := req.(*Fields) return s.GrpcMethod(ctx, p) } @@ -64,7 +64,7 @@ func NewGrpcMethodEndpoint(s Service) goa.Endpoint { // NewGrpcStreamEndpoint returns an endpoint function that calls the method // "grpc_stream" of service "test". func NewGrpcStreamEndpoint(s Service) goa.Endpoint { - return func(ctx context.Context, req interface{}) (interface{}, error) { + return func(ctx context.Context, req any) (any, error) { ep := req.(*GrpcStreamEndpointInput) return nil, s.GrpcStream(ctx, ep.Stream) } diff --git a/internal/testsvc/gen/test/service.go b/internal/testsvc/gen/test/service.go index 4d3b3592..c977cea4 100644 --- a/internal/testsvc/gen/test/service.go +++ b/internal/testsvc/gen/test/service.go @@ -1,4 +1,4 @@ -// Code generated by goa v3.9.1, DO NOT EDIT. +// Code generated by goa v3.20.0, DO NOT EDIT. // // test service // @@ -21,6 +21,12 @@ type Service interface { GrpcStream(context.Context, GrpcStreamServerStream) (err error) } +// APIName is the name of the API as defined in the design. +const APIName = "itest" + +// APIVersion is the version of the API as defined in the design. +const APIVersion = "0.0.1" + // ServiceName is the name of the service as defined in the design. This is the // same value that is set in the endpoint request contexts under the ServiceKey // key. @@ -36,8 +42,12 @@ var MethodNames = [3]string{"http_method", "grpc_method", "grpc_stream"} type GrpcStreamServerStream interface { // Send streams instances of "Fields". Send(*Fields) error + // SendWithContext streams instances of "Fields" with context. + SendWithContext(context.Context, *Fields) error // Recv reads instances of "Fields" from the stream. Recv() (*Fields, error) + // RecvWithContext reads instances of "Fields" from the stream with context. + RecvWithContext(context.Context) (*Fields, error) // Close closes the stream. Close() error } @@ -47,8 +57,12 @@ type GrpcStreamServerStream interface { type GrpcStreamClientStream interface { // Send streams instances of "Fields". Send(*Fields) error + // SendWithContext streams instances of "Fields" with context. + SendWithContext(context.Context, *Fields) error // Recv reads instances of "Fields" from the stream. Recv() (*Fields, error) + // RecvWithContext reads instances of "Fields" from the stream with context. + RecvWithContext(context.Context) (*Fields, error) // Close closes the stream. Close() error } diff --git a/mock/cmd/cmg/pkg/generate/_tests/extensive/extensive.go b/mock/cmd/cmg/pkg/generate/_tests/extensive/extensive.go index b233efad..fb37e06f 100644 --- a/mock/cmd/cmg/pkg/generate/_tests/extensive/extensive.go +++ b/mock/cmd/cmg/pkg/generate/_tests/extensive/extensive.go @@ -49,9 +49,10 @@ type ( Generic[K comparable, V ~int | bool | string, X, Y any] interface { Simple(k K, v V, x X, y Y) (K, V, X, Y) - Complex(map[K]V, []X, *Y) (map[K]V, []X, *Y) + Complex(map[K]V, []X, *Y, Set[K]) (map[K]V, []X, *Y, Set[K]) } - Struct struct{} - Array [5]Struct + Struct struct{} + Array [5]Struct + Set[K comparable] map[K]Struct ) diff --git a/mock/cmd/cmg/pkg/generate/_tests/extensive/mocks/extensive.go b/mock/cmd/cmg/pkg/generate/_tests/extensive/mocks/extensive.go index f7e8a76a..6d48f7fa 100644 --- a/mock/cmd/cmg/pkg/generate/_tests/extensive/mocks/extensive.go +++ b/mock/cmd/cmg/pkg/generate/_tests/extensive/mocks/extensive.go @@ -50,7 +50,7 @@ type ( } GenericSimpleFunc[K comparable, V ~int | bool | string, X, Y any] func(k K, v V, x X, y Y) (K, V, X, Y) - GenericComplexFunc[K comparable, V ~int | bool | string, X, Y any] func(p0 map[K]V, p1 []X, p2 *Y) (map[K]V, []X, *Y) + GenericComplexFunc[K comparable, V ~int | bool | string, X, Y any] func(p0 map[K]V, p1 []X, p2 *Y, p3 extensive.Set[K]) (map[K]V, []X, *Y, extensive.Set[K]) ) func NewExtensive(t *testing.T) *Extensive { @@ -348,13 +348,13 @@ func (m *Generic[K, V, X, Y]) SetComplex(f GenericComplexFunc[K, V, X, Y]) { m.m.Set("Complex", f) } -func (m *Generic[K, V, X, Y]) Complex(p0 map[K]V, p1 []X, p2 *Y) (map[K]V, []X, *Y) { +func (m *Generic[K, V, X, Y]) Complex(p0 map[K]V, p1 []X, p2 *Y, p3 extensive.Set[K]) (map[K]V, []X, *Y, extensive.Set[K]) { if f := m.m.Next("Complex"); f != nil { - return f.(GenericComplexFunc[K, V, X, Y])(p0, p1, p2) + return f.(GenericComplexFunc[K, V, X, Y])(p0, p1, p2, p3) } m.t.Helper() m.t.Error("unexpected Complex call") - return nil, nil, nil + return nil, nil, nil, nil } func (m *Generic[K, V, X, Y]) HasMore() bool { diff --git a/mock/cmd/cmg/pkg/generate/type.go b/mock/cmd/cmg/pkg/generate/type.go index 91af76eb..2c4955d3 100644 --- a/mock/cmd/cmg/pkg/generate/type.go +++ b/mock/cmd/cmg/pkg/generate/type.go @@ -28,6 +28,8 @@ func (ta *typeAdder) name(tt types.Type) (name string) { name, ok := ta.names[tt] if !ok { switch t := tt.(type) { + case *types.Alias: + name = ta.name(t.Underlying()) case *types.Array: name = fmt.Sprintf("[%v]%v", t.Len(), ta.name(t.Elem())) case *types.Basic: @@ -134,6 +136,8 @@ func (ta *typeAdder) zero(tt types.Type) (zero string) { zero, ok := ta.zeros[tt] if !ok { switch t := tt.(type) { + case *types.Alias: + zero = ta.zero(t.Underlying()) case *types.Array, *types.Struct: zero = ta.name(t) + "{}" case *types.Basic: diff --git a/mock/cmd/cmg/pkg/version.go b/mock/cmd/cmg/pkg/version.go index e3354aa4..796d4dc7 100644 --- a/mock/cmd/cmg/pkg/version.go +++ b/mock/cmd/cmg/pkg/version.go @@ -6,11 +6,11 @@ import ( const ( // Major version number - Major = 0 + Major = 1 // Minor version number - Minor = 18 + Minor = 1 // Build number - Build = 2 + Build = 0 // Suffix - set to empty string in release tag commits. Suffix = "" )