serverpb

package
v0.0.0-...-cafa37b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Http_HelloWorld_FullMethodName = "/http.Http/HelloWorld"
)

Variables

View Source
var File_github_com_lastbackend_toolkit_examples_http_apis_server_proto protoreflect.FileDescriptor
View Source
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 NewHttpService(name string, opts ...runtime.Option) (_ toolkit.Service, err error)

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

Cause function returns cause value.

func (HelloRequestValidationError) Error

Error satisfies the builtin error interface

func (HelloRequestValidationError) ErrorName

func (e HelloRequestValidationError) ErrorName() string

ErrorName returns error name.

func (HelloRequestValidationError) Field

Field function returns field value.

func (HelloRequestValidationError) Key

Key function returns key value.

func (HelloRequestValidationError) Reason

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

Cause function returns cause value.

func (HelloResponseValidationError) Error

Error satisfies the builtin error interface

func (HelloResponseValidationError) ErrorName

func (e HelloResponseValidationError) ErrorName() string

ErrorName returns error name.

func (HelloResponseValidationError) Field

Field function returns field value.

func (HelloResponseValidationError) Key

Key function returns key value.

func (HelloResponseValidationError) Reason

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

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL