Documentation ¶
Index ¶
- Constants
- Variables
- func NewHttpService(name string, opts ...runtime.Option) (_ toolkit.Service, err error)
- func RegisterHttpServer(s grpc.ServiceRegistrar, srv HttpServer)
- type HelloRequest
- func (*HelloRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HelloRequest) GetName() string
- func (*HelloRequest) ProtoMessage()
- func (x *HelloRequest) ProtoReflect() protoreflect.Message
- func (x *HelloRequest) Reset()
- func (x *HelloRequest) String() string
- func (m *HelloRequest) Validate() error
- func (m *HelloRequest) ValidateAll() error
- type HelloRequestMultiError
- type HelloRequestValidationError
- func (e HelloRequestValidationError) Cause() error
- func (e HelloRequestValidationError) Error() string
- func (e HelloRequestValidationError) ErrorName() string
- func (e HelloRequestValidationError) Field() string
- func (e HelloRequestValidationError) Key() bool
- func (e HelloRequestValidationError) Reason() string
- type HelloResponse
- func (*HelloResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HelloResponse) GetMessage() string
- func (*HelloResponse) ProtoMessage()
- func (x *HelloResponse) ProtoReflect() protoreflect.Message
- func (x *HelloResponse) Reset()
- func (x *HelloResponse) String() string
- func (m *HelloResponse) Validate() error
- func (m *HelloResponse) ValidateAll() error
- type HelloResponseMultiError
- type HelloResponseValidationError
- func (e HelloResponseValidationError) Cause() error
- func (e HelloResponseValidationError) Error() string
- func (e HelloResponseValidationError) ErrorName() string
- func (e HelloResponseValidationError) Field() string
- func (e HelloResponseValidationError) Key() bool
- func (e HelloResponseValidationError) Reason() string
- type HttpClient
- type HttpHTTPService
- type HttpServer
- type UnimplementedHttpServer
- type UnsafeHttpServer
Constants ¶
const (
Http_HelloWorld_FullMethodName = "/http.Http/HelloWorld"
)
Variables ¶
var File_github_com_lastbackend_toolkit_examples_http_apis_server_proto protoreflect.FileDescriptor
var Http_ServiceDesc = grpc.ServiceDesc{ ServiceName: "http.Http", HandlerType: (*HttpServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "HelloWorld", Handler: _Http_HelloWorld_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "github.com/lastbackend/toolkit/examples/http/apis/server.proto", }
Http_ServiceDesc is the grpc.ServiceDesc for Http service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func NewHttpService ¶
func RegisterHttpServer ¶
func RegisterHttpServer(s grpc.ServiceRegistrar, srv HttpServer)
Types ¶
type HelloRequest ¶
type HelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
The request message containing the user's name.
func (*HelloRequest) Descriptor
deprecated
func (*HelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.
func (*HelloRequest) GetName ¶
func (x *HelloRequest) GetName() string
func (*HelloRequest) ProtoMessage ¶
func (*HelloRequest) ProtoMessage()
func (*HelloRequest) ProtoReflect ¶
func (x *HelloRequest) ProtoReflect() protoreflect.Message
func (*HelloRequest) Reset ¶
func (x *HelloRequest) Reset()
func (*HelloRequest) String ¶
func (x *HelloRequest) String() string
func (*HelloRequest) Validate ¶
func (m *HelloRequest) Validate() error
Validate checks the field values on HelloRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*HelloRequest) ValidateAll ¶
func (m *HelloRequest) ValidateAll() error
ValidateAll checks the field values on HelloRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in HelloRequestMultiError, or nil if none found.
type HelloRequestMultiError ¶
type HelloRequestMultiError []error
HelloRequestMultiError is an error wrapping multiple validation errors returned by HelloRequest.ValidateAll() if the designated constraints aren't met.
func (HelloRequestMultiError) AllErrors ¶
func (m HelloRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (HelloRequestMultiError) Error ¶
func (m HelloRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type HelloRequestValidationError ¶
type HelloRequestValidationError struct {
// contains filtered or unexported fields
}
HelloRequestValidationError is the validation error returned by HelloRequest.Validate if the designated constraints aren't met.
func (HelloRequestValidationError) Cause ¶
func (e HelloRequestValidationError) Cause() error
Cause function returns cause value.
func (HelloRequestValidationError) Error ¶
func (e HelloRequestValidationError) Error() string
Error satisfies the builtin error interface
func (HelloRequestValidationError) ErrorName ¶
func (e HelloRequestValidationError) ErrorName() string
ErrorName returns error name.
func (HelloRequestValidationError) Field ¶
func (e HelloRequestValidationError) Field() string
Field function returns field value.
func (HelloRequestValidationError) Key ¶
func (e HelloRequestValidationError) Key() bool
Key function returns key value.
func (HelloRequestValidationError) Reason ¶
func (e HelloRequestValidationError) Reason() string
Reason function returns reason value.
type HelloResponse ¶
type HelloResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
The response message containing the greetings
func (*HelloResponse) Descriptor
deprecated
func (*HelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.
func (*HelloResponse) GetMessage ¶
func (x *HelloResponse) GetMessage() string
func (*HelloResponse) ProtoMessage ¶
func (*HelloResponse) ProtoMessage()
func (*HelloResponse) ProtoReflect ¶
func (x *HelloResponse) ProtoReflect() protoreflect.Message
func (*HelloResponse) Reset ¶
func (x *HelloResponse) Reset()
func (*HelloResponse) String ¶
func (x *HelloResponse) String() string
func (*HelloResponse) Validate ¶
func (m *HelloResponse) Validate() error
Validate checks the field values on HelloResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*HelloResponse) ValidateAll ¶
func (m *HelloResponse) ValidateAll() error
ValidateAll checks the field values on HelloResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in HelloResponseMultiError, or nil if none found.
type HelloResponseMultiError ¶
type HelloResponseMultiError []error
HelloResponseMultiError is an error wrapping multiple validation errors returned by HelloResponse.ValidateAll() if the designated constraints aren't met.
func (HelloResponseMultiError) AllErrors ¶
func (m HelloResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (HelloResponseMultiError) Error ¶
func (m HelloResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type HelloResponseValidationError ¶
type HelloResponseValidationError struct {
// contains filtered or unexported fields
}
HelloResponseValidationError is the validation error returned by HelloResponse.Validate if the designated constraints aren't met.
func (HelloResponseValidationError) Cause ¶
func (e HelloResponseValidationError) Cause() error
Cause function returns cause value.
func (HelloResponseValidationError) Error ¶
func (e HelloResponseValidationError) Error() string
Error satisfies the builtin error interface
func (HelloResponseValidationError) ErrorName ¶
func (e HelloResponseValidationError) ErrorName() string
ErrorName returns error name.
func (HelloResponseValidationError) Field ¶
func (e HelloResponseValidationError) Field() string
Field function returns field value.
func (HelloResponseValidationError) Key ¶
func (e HelloResponseValidationError) Key() bool
Key function returns key value.
func (HelloResponseValidationError) Reason ¶
func (e HelloResponseValidationError) Reason() string
Reason function returns reason value.
type HttpClient ¶
type HttpClient interface {
HelloWorld(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
}
HttpClient is the client API for Http 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.
func NewHttpClient ¶
func NewHttpClient(cc grpc.ClientConnInterface) HttpClient
type HttpHTTPService ¶
type HttpHTTPService interface {
HelloWorld(ctx context.Context, req *HelloRequest) (*HelloResponse, error)
}
type HttpServer ¶
type HttpServer interface {
HelloWorld(context.Context, *HelloRequest) (*HelloResponse, error)
}
HttpServer is the server API for Http service. All implementations should embed UnimplementedHttpServer for forward compatibility
type UnimplementedHttpServer ¶
type UnimplementedHttpServer struct { }
UnimplementedHttpServer should be embedded to have forward compatible implementations.
func (UnimplementedHttpServer) HelloWorld ¶
func (UnimplementedHttpServer) HelloWorld(context.Context, *HelloRequest) (*HelloResponse, error)
type UnsafeHttpServer ¶
type UnsafeHttpServer interface {
// contains filtered or unexported methods
}
UnsafeHttpServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HttpServer will result in compilation errors.