example

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

Package example is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	ExampleService_List_FullMethodName           = "/flamefatex.grpc_gateway_example.api.v1.example.ExampleService/List"
	ExampleService_Get_FullMethodName            = "/flamefatex.grpc_gateway_example.api.v1.example.ExampleService/Get"
	ExampleService_Create_FullMethodName         = "/flamefatex.grpc_gateway_example.api.v1.example.ExampleService/Create"
	ExampleService_Update_FullMethodName         = "/flamefatex.grpc_gateway_example.api.v1.example.ExampleService/Update"
	ExampleService_Delete_FullMethodName         = "/flamefatex.grpc_gateway_example.api.v1.example.ExampleService/Delete"
	ExampleService_TestCustomHttp_FullMethodName = "/flamefatex.grpc_gateway_example.api.v1.example.ExampleService/TestCustomHttp"
	ExampleService_TestError_FullMethodName      = "/flamefatex.grpc_gateway_example.api.v1.example.ExampleService/TestError"
)

Variables

View Source
var ExampleService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "flamefatex.grpc_gateway_example.api.v1.example.ExampleService",
	HandlerType: (*ExampleServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _ExampleService_List_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _ExampleService_Get_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _ExampleService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _ExampleService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _ExampleService_Delete_Handler,
		},
		{
			MethodName: "TestCustomHttp",
			Handler:    _ExampleService_TestCustomHttp_Handler,
		},
		{
			MethodName: "TestError",
			Handler:    _ExampleService_TestError_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/v1/example/example.proto",
}

ExampleService_ServiceDesc is the grpc.ServiceDesc for ExampleService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_api_v1_example_example_proto protoreflect.FileDescriptor

Functions

func RegisterExampleServiceHandler

func RegisterExampleServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterExampleServiceHandler registers the http handlers for service ExampleService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterExampleServiceHandlerClient

func RegisterExampleServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ExampleServiceClient) error

RegisterExampleServiceHandlerClient registers the http handlers for service ExampleService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ExampleServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ExampleServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ExampleServiceClient" to call the correct interceptors.

func RegisterExampleServiceHandlerFromEndpoint

func RegisterExampleServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterExampleServiceHandlerFromEndpoint is same as RegisterExampleServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterExampleServiceHandlerServer

func RegisterExampleServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ExampleServiceServer) error

RegisterExampleServiceHandlerServer registers the http handlers for service ExampleService to "mux". UnaryRPC :call ExampleServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterExampleServiceHandlerFromEndpoint instead.

func RegisterExampleServiceServer

func RegisterExampleServiceServer(s grpc.ServiceRegistrar, srv ExampleServiceServer)

Types

type CreateRequest

type CreateRequest struct {

	// 示例
	Example *Example `protobuf:"bytes,1,opt,name=example,proto3" json:"example,omitempty"`
	// contains filtered or unexported fields
}

CreateRequest 创建示例请求

func (*CreateRequest) Descriptor deprecated

func (*CreateRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetExample

func (x *CreateRequest) GetExample() *Example

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect

func (x *CreateRequest) ProtoReflect() protoreflect.Message

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) String

func (x *CreateRequest) String() string

func (*CreateRequest) Validate

func (m *CreateRequest) Validate() error

Validate checks the field values on CreateRequest 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 (*CreateRequest) ValidateAll

func (m *CreateRequest) ValidateAll() error

ValidateAll checks the field values on CreateRequest 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 CreateRequestMultiError, or nil if none found.

type CreateRequestMultiError

type CreateRequestMultiError []error

CreateRequestMultiError is an error wrapping multiple validation errors returned by CreateRequest.ValidateAll() if the designated constraints aren't met.

func (CreateRequestMultiError) AllErrors

func (m CreateRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CreateRequestMultiError) Error

func (m CreateRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type CreateRequestValidationError

type CreateRequestValidationError struct {
	// contains filtered or unexported fields
}

CreateRequestValidationError is the validation error returned by CreateRequest.Validate if the designated constraints aren't met.

func (CreateRequestValidationError) Cause

Cause function returns cause value.

func (CreateRequestValidationError) Error

Error satisfies the builtin error interface

func (CreateRequestValidationError) ErrorName

func (e CreateRequestValidationError) ErrorName() string

ErrorName returns error name.

func (CreateRequestValidationError) Field

Field function returns field value.

func (CreateRequestValidationError) Key

Key function returns key value.

func (CreateRequestValidationError) Reason

Reason function returns reason value.

type CreateResponse

type CreateResponse struct {

	// 请求id
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// 请求状态
	Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

CreateResponse 创建示例响应

func (*CreateResponse) Descriptor deprecated

func (*CreateResponse) Descriptor() ([]byte, []int)

Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.

func (*CreateResponse) GetRequestId

func (x *CreateResponse) GetRequestId() string

func (*CreateResponse) GetStatus

func (x *CreateResponse) GetStatus() *status.Status

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) ProtoReflect

func (x *CreateResponse) ProtoReflect() protoreflect.Message

func (*CreateResponse) Reset

func (x *CreateResponse) Reset()

func (*CreateResponse) String

func (x *CreateResponse) String() string

func (*CreateResponse) Validate

func (m *CreateResponse) Validate() error

Validate checks the field values on CreateResponse 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 (*CreateResponse) ValidateAll

func (m *CreateResponse) ValidateAll() error

ValidateAll checks the field values on CreateResponse 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 CreateResponseMultiError, or nil if none found.

type CreateResponseMultiError

type CreateResponseMultiError []error

CreateResponseMultiError is an error wrapping multiple validation errors returned by CreateResponse.ValidateAll() if the designated constraints aren't met.

func (CreateResponseMultiError) AllErrors

func (m CreateResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CreateResponseMultiError) Error

func (m CreateResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type CreateResponseValidationError

type CreateResponseValidationError struct {
	// contains filtered or unexported fields
}

CreateResponseValidationError is the validation error returned by CreateResponse.Validate if the designated constraints aren't met.

func (CreateResponseValidationError) Cause

Cause function returns cause value.

func (CreateResponseValidationError) Error

Error satisfies the builtin error interface

func (CreateResponseValidationError) ErrorName

func (e CreateResponseValidationError) ErrorName() string

ErrorName returns error name.

func (CreateResponseValidationError) Field

Field function returns field value.

func (CreateResponseValidationError) Key

Key function returns key value.

func (CreateResponseValidationError) Reason

Reason function returns reason value.

type DeleteRequest

type DeleteRequest struct {

	// id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

DeleteRequest 删除示例请求

func (*DeleteRequest) Descriptor deprecated

func (*DeleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetId

func (x *DeleteRequest) GetId() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

func (x *DeleteRequest) ProtoReflect() protoreflect.Message

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

func (*DeleteRequest) Validate

func (m *DeleteRequest) Validate() error

Validate checks the field values on DeleteRequest 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 (*DeleteRequest) ValidateAll

func (m *DeleteRequest) ValidateAll() error

ValidateAll checks the field values on DeleteRequest 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 DeleteRequestMultiError, or nil if none found.

type DeleteRequestMultiError

type DeleteRequestMultiError []error

DeleteRequestMultiError is an error wrapping multiple validation errors returned by DeleteRequest.ValidateAll() if the designated constraints aren't met.

func (DeleteRequestMultiError) AllErrors

func (m DeleteRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeleteRequestMultiError) Error

func (m DeleteRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type DeleteRequestValidationError

type DeleteRequestValidationError struct {
	// contains filtered or unexported fields
}

DeleteRequestValidationError is the validation error returned by DeleteRequest.Validate if the designated constraints aren't met.

func (DeleteRequestValidationError) Cause

Cause function returns cause value.

func (DeleteRequestValidationError) Error

Error satisfies the builtin error interface

func (DeleteRequestValidationError) ErrorName

func (e DeleteRequestValidationError) ErrorName() string

ErrorName returns error name.

func (DeleteRequestValidationError) Field

Field function returns field value.

func (DeleteRequestValidationError) Key

Key function returns key value.

func (DeleteRequestValidationError) Reason

Reason function returns reason value.

type DeleteResponse

type DeleteResponse struct {

	// 请求id
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// 请求状态
	Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

DeleteResponse 删除示例响应

func (*DeleteResponse) Descriptor deprecated

func (*DeleteResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) GetRequestId

func (x *DeleteResponse) GetRequestId() string

func (*DeleteResponse) GetStatus

func (x *DeleteResponse) GetStatus() *status.Status

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

func (x *DeleteResponse) ProtoReflect() protoreflect.Message

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

func (*DeleteResponse) Validate

func (m *DeleteResponse) Validate() error

Validate checks the field values on DeleteResponse 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 (*DeleteResponse) ValidateAll

func (m *DeleteResponse) ValidateAll() error

ValidateAll checks the field values on DeleteResponse 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 DeleteResponseMultiError, or nil if none found.

type DeleteResponseMultiError

type DeleteResponseMultiError []error

DeleteResponseMultiError is an error wrapping multiple validation errors returned by DeleteResponse.ValidateAll() if the designated constraints aren't met.

func (DeleteResponseMultiError) AllErrors

func (m DeleteResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DeleteResponseMultiError) Error

func (m DeleteResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type DeleteResponseValidationError

type DeleteResponseValidationError struct {
	// contains filtered or unexported fields
}

DeleteResponseValidationError is the validation error returned by DeleteResponse.Validate if the designated constraints aren't met.

func (DeleteResponseValidationError) Cause

Cause function returns cause value.

func (DeleteResponseValidationError) Error

Error satisfies the builtin error interface

func (DeleteResponseValidationError) ErrorName

func (e DeleteResponseValidationError) ErrorName() string

ErrorName returns error name.

func (DeleteResponseValidationError) Field

Field function returns field value.

func (DeleteResponseValidationError) Key

Key function returns key value.

func (DeleteResponseValidationError) Reason

Reason function returns reason value.

type Example

type Example struct {

	// id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// 名称
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// 类型
	Type enumeration.ExampleType `protobuf:"varint,3,opt,name=type,proto3,enum=flamefatex.grpc_gateway_example.enumeration.ExampleType" json:"type,omitempty"`
	// 描述
	Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
	// 创建时间
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// 更新时间
	UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

Example 示例

func (*Example) Descriptor deprecated

func (*Example) Descriptor() ([]byte, []int)

Deprecated: Use Example.ProtoReflect.Descriptor instead.

func (*Example) GetCreatedAt

func (x *Example) GetCreatedAt() *timestamppb.Timestamp

func (*Example) GetDescription

func (x *Example) GetDescription() string

func (*Example) GetId

func (x *Example) GetId() string

func (*Example) GetName

func (x *Example) GetName() string

func (*Example) GetType

func (x *Example) GetType() enumeration.ExampleType

func (*Example) GetUpdatedAt

func (x *Example) GetUpdatedAt() *timestamppb.Timestamp

func (*Example) ProtoMessage

func (*Example) ProtoMessage()

func (*Example) ProtoReflect

func (x *Example) ProtoReflect() protoreflect.Message

func (*Example) Reset

func (x *Example) Reset()

func (*Example) String

func (x *Example) String() string

func (*Example) Validate

func (m *Example) Validate() error

Validate checks the field values on Example 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 (*Example) ValidateAll

func (m *Example) ValidateAll() error

ValidateAll checks the field values on Example 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 ExampleMultiError, or nil if none found.

type ExampleMultiError

type ExampleMultiError []error

ExampleMultiError is an error wrapping multiple validation errors returned by Example.ValidateAll() if the designated constraints aren't met.

func (ExampleMultiError) AllErrors

func (m ExampleMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ExampleMultiError) Error

func (m ExampleMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ExampleServiceClient

type ExampleServiceClient interface {
	// List 查询示例列表
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	// Get 查询单个示例
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	// Create 创建示例
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
	// Update 更新示例
	Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
	// Delete 删除示例
	Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
	// TestCustomHttp 测试自定义http
	TestCustomHttp(ctx context.Context, in *TestCustomHttpRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// TestError 测试错误
	TestError(ctx context.Context, in *TestErrorRequest, opts ...grpc.CallOption) (*TestErrorResponse, error)
}

ExampleServiceClient is the client API for ExampleService 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.

type ExampleServiceServer

type ExampleServiceServer interface {
	// List 查询示例列表
	List(context.Context, *ListRequest) (*ListResponse, error)
	// Get 查询单个示例
	Get(context.Context, *GetRequest) (*GetResponse, error)
	// Create 创建示例
	Create(context.Context, *CreateRequest) (*CreateResponse, error)
	// Update 更新示例
	Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
	// Delete 删除示例
	Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
	// TestCustomHttp 测试自定义http
	TestCustomHttp(context.Context, *TestCustomHttpRequest) (*emptypb.Empty, error)
	// TestError 测试错误
	TestError(context.Context, *TestErrorRequest) (*TestErrorResponse, error)
	// contains filtered or unexported methods
}

ExampleServiceServer is the server API for ExampleService service. All implementations must embed UnimplementedExampleServiceServer for forward compatibility

type ExampleValidationError

type ExampleValidationError struct {
	// contains filtered or unexported fields
}

ExampleValidationError is the validation error returned by Example.Validate if the designated constraints aren't met.

func (ExampleValidationError) Cause

func (e ExampleValidationError) Cause() error

Cause function returns cause value.

func (ExampleValidationError) Error

func (e ExampleValidationError) Error() string

Error satisfies the builtin error interface

func (ExampleValidationError) ErrorName

func (e ExampleValidationError) ErrorName() string

ErrorName returns error name.

func (ExampleValidationError) Field

func (e ExampleValidationError) Field() string

Field function returns field value.

func (ExampleValidationError) Key

func (e ExampleValidationError) Key() bool

Key function returns key value.

func (ExampleValidationError) Reason

func (e ExampleValidationError) Reason() string

Reason function returns reason value.

type GetRequest

type GetRequest struct {

	// id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

GetRequest 查询单个示例请求

func (*GetRequest) Descriptor deprecated

func (*GetRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetId

func (x *GetRequest) GetId() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

func (x *GetRequest) ProtoReflect() protoreflect.Message

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

func (*GetRequest) Validate

func (m *GetRequest) Validate() error

Validate checks the field values on GetRequest 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 (*GetRequest) ValidateAll

func (m *GetRequest) ValidateAll() error

ValidateAll checks the field values on GetRequest 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 GetRequestMultiError, or nil if none found.

type GetRequestMultiError

type GetRequestMultiError []error

GetRequestMultiError is an error wrapping multiple validation errors returned by GetRequest.ValidateAll() if the designated constraints aren't met.

func (GetRequestMultiError) AllErrors

func (m GetRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetRequestMultiError) Error

func (m GetRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type GetRequestValidationError

type GetRequestValidationError struct {
	// contains filtered or unexported fields
}

GetRequestValidationError is the validation error returned by GetRequest.Validate if the designated constraints aren't met.

func (GetRequestValidationError) Cause

func (e GetRequestValidationError) Cause() error

Cause function returns cause value.

func (GetRequestValidationError) Error

Error satisfies the builtin error interface

func (GetRequestValidationError) ErrorName

func (e GetRequestValidationError) ErrorName() string

ErrorName returns error name.

func (GetRequestValidationError) Field

Field function returns field value.

func (GetRequestValidationError) Key

Key function returns key value.

func (GetRequestValidationError) Reason

func (e GetRequestValidationError) Reason() string

Reason function returns reason value.

type GetResponse

type GetResponse struct {

	// 请求id
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// 请求状态
	Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// 示例
	Example *Example `protobuf:"bytes,3,opt,name=example,proto3" json:"example,omitempty"`
	// contains filtered or unexported fields
}

GetResponse 查询单个示例响应

func (*GetResponse) Descriptor deprecated

func (*GetResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetExample

func (x *GetResponse) GetExample() *Example

func (*GetResponse) GetRequestId

func (x *GetResponse) GetRequestId() string

func (*GetResponse) GetStatus

func (x *GetResponse) GetStatus() *status.Status

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

func (x *GetResponse) ProtoReflect() protoreflect.Message

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

func (*GetResponse) Validate

func (m *GetResponse) Validate() error

Validate checks the field values on GetResponse 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 (*GetResponse) ValidateAll

func (m *GetResponse) ValidateAll() error

ValidateAll checks the field values on GetResponse 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 GetResponseMultiError, or nil if none found.

type GetResponseMultiError

type GetResponseMultiError []error

GetResponseMultiError is an error wrapping multiple validation errors returned by GetResponse.ValidateAll() if the designated constraints aren't met.

func (GetResponseMultiError) AllErrors

func (m GetResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (GetResponseMultiError) Error

func (m GetResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type GetResponseValidationError

type GetResponseValidationError struct {
	// contains filtered or unexported fields
}

GetResponseValidationError is the validation error returned by GetResponse.Validate if the designated constraints aren't met.

func (GetResponseValidationError) Cause

Cause function returns cause value.

func (GetResponseValidationError) Error

Error satisfies the builtin error interface

func (GetResponseValidationError) ErrorName

func (e GetResponseValidationError) ErrorName() string

ErrorName returns error name.

func (GetResponseValidationError) Field

Field function returns field value.

func (GetResponseValidationError) Key

Key function returns key value.

func (GetResponseValidationError) Reason

Reason function returns reason value.

type ListRequest

type ListRequest struct {

	// 分页
	Paging *paging.Paging `protobuf:"bytes,1,opt,name=paging,proto3" json:"paging,omitempty"`
	// id
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// 名称
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

ListRequest 查询示例列表请求

func (*ListRequest) Descriptor deprecated

func (*ListRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetId

func (x *ListRequest) GetId() string

func (*ListRequest) GetName

func (x *ListRequest) GetName() string

func (*ListRequest) GetPaging

func (x *ListRequest) GetPaging() *paging.Paging

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

func (x *ListRequest) ProtoReflect() protoreflect.Message

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

func (*ListRequest) Validate

func (m *ListRequest) Validate() error

Validate checks the field values on ListRequest 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 (*ListRequest) ValidateAll

func (m *ListRequest) ValidateAll() error

ValidateAll checks the field values on ListRequest 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 ListRequestMultiError, or nil if none found.

type ListRequestMultiError

type ListRequestMultiError []error

ListRequestMultiError is an error wrapping multiple validation errors returned by ListRequest.ValidateAll() if the designated constraints aren't met.

func (ListRequestMultiError) AllErrors

func (m ListRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListRequestMultiError) Error

func (m ListRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ListRequestValidationError

type ListRequestValidationError struct {
	// contains filtered or unexported fields
}

ListRequestValidationError is the validation error returned by ListRequest.Validate if the designated constraints aren't met.

func (ListRequestValidationError) Cause

Cause function returns cause value.

func (ListRequestValidationError) Error

Error satisfies the builtin error interface

func (ListRequestValidationError) ErrorName

func (e ListRequestValidationError) ErrorName() string

ErrorName returns error name.

func (ListRequestValidationError) Field

Field function returns field value.

func (ListRequestValidationError) Key

Key function returns key value.

func (ListRequestValidationError) Reason

Reason function returns reason value.

type ListResponse

type ListResponse struct {

	// 请求id
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// 请求状态
	Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// 分页
	Paging *paging.Paging `protobuf:"bytes,3,opt,name=paging,proto3" json:"paging,omitempty"`
	// 示例列表
	Examples []*Example `protobuf:"bytes,4,rep,name=examples,proto3" json:"examples,omitempty"`
	// contains filtered or unexported fields
}

ListResponse 查询示例列表响应

func (*ListResponse) Descriptor deprecated

func (*ListResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetExamples

func (x *ListResponse) GetExamples() []*Example

func (*ListResponse) GetPaging

func (x *ListResponse) GetPaging() *paging.Paging

func (*ListResponse) GetRequestId

func (x *ListResponse) GetRequestId() string

func (*ListResponse) GetStatus

func (x *ListResponse) GetStatus() *status.Status

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

func (x *ListResponse) ProtoReflect() protoreflect.Message

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

func (*ListResponse) Validate

func (m *ListResponse) Validate() error

Validate checks the field values on ListResponse 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 (*ListResponse) ValidateAll

func (m *ListResponse) ValidateAll() error

ValidateAll checks the field values on ListResponse 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 ListResponseMultiError, or nil if none found.

type ListResponseMultiError

type ListResponseMultiError []error

ListResponseMultiError is an error wrapping multiple validation errors returned by ListResponse.ValidateAll() if the designated constraints aren't met.

func (ListResponseMultiError) AllErrors

func (m ListResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListResponseMultiError) Error

func (m ListResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type ListResponseValidationError

type ListResponseValidationError struct {
	// contains filtered or unexported fields
}

ListResponseValidationError is the validation error returned by ListResponse.Validate if the designated constraints aren't met.

func (ListResponseValidationError) Cause

Cause function returns cause value.

func (ListResponseValidationError) Error

Error satisfies the builtin error interface

func (ListResponseValidationError) ErrorName

func (e ListResponseValidationError) ErrorName() string

ErrorName returns error name.

func (ListResponseValidationError) Field

Field function returns field value.

func (ListResponseValidationError) Key

Key function returns key value.

func (ListResponseValidationError) Reason

Reason function returns reason value.

type TestCustomHttpRequest

type TestCustomHttpRequest struct {

	// http status code
	Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

TestCustomHttpRequest 测试自定义http

func (*TestCustomHttpRequest) Descriptor deprecated

func (*TestCustomHttpRequest) Descriptor() ([]byte, []int)

Deprecated: Use TestCustomHttpRequest.ProtoReflect.Descriptor instead.

func (*TestCustomHttpRequest) GetCode

func (x *TestCustomHttpRequest) GetCode() string

func (*TestCustomHttpRequest) ProtoMessage

func (*TestCustomHttpRequest) ProtoMessage()

func (*TestCustomHttpRequest) ProtoReflect

func (x *TestCustomHttpRequest) ProtoReflect() protoreflect.Message

func (*TestCustomHttpRequest) Reset

func (x *TestCustomHttpRequest) Reset()

func (*TestCustomHttpRequest) String

func (x *TestCustomHttpRequest) String() string

func (*TestCustomHttpRequest) Validate

func (m *TestCustomHttpRequest) Validate() error

Validate checks the field values on TestCustomHttpRequest 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 (*TestCustomHttpRequest) ValidateAll

func (m *TestCustomHttpRequest) ValidateAll() error

ValidateAll checks the field values on TestCustomHttpRequest 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 TestCustomHttpRequestMultiError, or nil if none found.

type TestCustomHttpRequestMultiError

type TestCustomHttpRequestMultiError []error

TestCustomHttpRequestMultiError is an error wrapping multiple validation errors returned by TestCustomHttpRequest.ValidateAll() if the designated constraints aren't met.

func (TestCustomHttpRequestMultiError) AllErrors

func (m TestCustomHttpRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TestCustomHttpRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type TestCustomHttpRequestValidationError

type TestCustomHttpRequestValidationError struct {
	// contains filtered or unexported fields
}

TestCustomHttpRequestValidationError is the validation error returned by TestCustomHttpRequest.Validate if the designated constraints aren't met.

func (TestCustomHttpRequestValidationError) Cause

Cause function returns cause value.

func (TestCustomHttpRequestValidationError) Error

Error satisfies the builtin error interface

func (TestCustomHttpRequestValidationError) ErrorName

ErrorName returns error name.

func (TestCustomHttpRequestValidationError) Field

Field function returns field value.

func (TestCustomHttpRequestValidationError) Key

Key function returns key value.

func (TestCustomHttpRequestValidationError) Reason

Reason function returns reason value.

type TestErrorRequest

type TestErrorRequest struct {
	// contains filtered or unexported fields
}

TestErrorRequest 测试错误单个示例请求

func (*TestErrorRequest) Descriptor deprecated

func (*TestErrorRequest) Descriptor() ([]byte, []int)

Deprecated: Use TestErrorRequest.ProtoReflect.Descriptor instead.

func (*TestErrorRequest) ProtoMessage

func (*TestErrorRequest) ProtoMessage()

func (*TestErrorRequest) ProtoReflect

func (x *TestErrorRequest) ProtoReflect() protoreflect.Message

func (*TestErrorRequest) Reset

func (x *TestErrorRequest) Reset()

func (*TestErrorRequest) String

func (x *TestErrorRequest) String() string

func (*TestErrorRequest) Validate

func (m *TestErrorRequest) Validate() error

Validate checks the field values on TestErrorRequest 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 (*TestErrorRequest) ValidateAll

func (m *TestErrorRequest) ValidateAll() error

ValidateAll checks the field values on TestErrorRequest 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 TestErrorRequestMultiError, or nil if none found.

type TestErrorRequestMultiError

type TestErrorRequestMultiError []error

TestErrorRequestMultiError is an error wrapping multiple validation errors returned by TestErrorRequest.ValidateAll() if the designated constraints aren't met.

func (TestErrorRequestMultiError) AllErrors

func (m TestErrorRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TestErrorRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type TestErrorRequestValidationError

type TestErrorRequestValidationError struct {
	// contains filtered or unexported fields
}

TestErrorRequestValidationError is the validation error returned by TestErrorRequest.Validate if the designated constraints aren't met.

func (TestErrorRequestValidationError) Cause

Cause function returns cause value.

func (TestErrorRequestValidationError) Error

Error satisfies the builtin error interface

func (TestErrorRequestValidationError) ErrorName

ErrorName returns error name.

func (TestErrorRequestValidationError) Field

Field function returns field value.

func (TestErrorRequestValidationError) Key

Key function returns key value.

func (TestErrorRequestValidationError) Reason

Reason function returns reason value.

type TestErrorResponse

type TestErrorResponse struct {

	// 请求id
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// 请求状态
	Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// 示例
	Example *Example `protobuf:"bytes,3,opt,name=example,proto3" json:"example,omitempty"`
	// contains filtered or unexported fields
}

TestErrorResponse 测试错误单个示例响应

func (*TestErrorResponse) Descriptor deprecated

func (*TestErrorResponse) Descriptor() ([]byte, []int)

Deprecated: Use TestErrorResponse.ProtoReflect.Descriptor instead.

func (*TestErrorResponse) GetExample

func (x *TestErrorResponse) GetExample() *Example

func (*TestErrorResponse) GetRequestId

func (x *TestErrorResponse) GetRequestId() string

func (*TestErrorResponse) GetStatus

func (x *TestErrorResponse) GetStatus() *status.Status

func (*TestErrorResponse) ProtoMessage

func (*TestErrorResponse) ProtoMessage()

func (*TestErrorResponse) ProtoReflect

func (x *TestErrorResponse) ProtoReflect() protoreflect.Message

func (*TestErrorResponse) Reset

func (x *TestErrorResponse) Reset()

func (*TestErrorResponse) String

func (x *TestErrorResponse) String() string

func (*TestErrorResponse) Validate

func (m *TestErrorResponse) Validate() error

Validate checks the field values on TestErrorResponse 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 (*TestErrorResponse) ValidateAll

func (m *TestErrorResponse) ValidateAll() error

ValidateAll checks the field values on TestErrorResponse 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 TestErrorResponseMultiError, or nil if none found.

type TestErrorResponseMultiError

type TestErrorResponseMultiError []error

TestErrorResponseMultiError is an error wrapping multiple validation errors returned by TestErrorResponse.ValidateAll() if the designated constraints aren't met.

func (TestErrorResponseMultiError) AllErrors

func (m TestErrorResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TestErrorResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type TestErrorResponseValidationError

type TestErrorResponseValidationError struct {
	// contains filtered or unexported fields
}

TestErrorResponseValidationError is the validation error returned by TestErrorResponse.Validate if the designated constraints aren't met.

func (TestErrorResponseValidationError) Cause

Cause function returns cause value.

func (TestErrorResponseValidationError) Error

Error satisfies the builtin error interface

func (TestErrorResponseValidationError) ErrorName

ErrorName returns error name.

func (TestErrorResponseValidationError) Field

Field function returns field value.

func (TestErrorResponseValidationError) Key

Key function returns key value.

func (TestErrorResponseValidationError) Reason

Reason function returns reason value.

type UnimplementedExampleServiceServer

type UnimplementedExampleServiceServer struct {
}

UnimplementedExampleServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedExampleServiceServer) Create

func (UnimplementedExampleServiceServer) Delete

func (UnimplementedExampleServiceServer) Get

func (UnimplementedExampleServiceServer) List

func (UnimplementedExampleServiceServer) TestCustomHttp

func (UnimplementedExampleServiceServer) TestError

func (UnimplementedExampleServiceServer) Update

type UnsafeExampleServiceServer

type UnsafeExampleServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeExampleServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ExampleServiceServer will result in compilation errors.

type UpdateRequest

type UpdateRequest struct {

	// 示例
	Example *Example `protobuf:"bytes,1,opt,name=example,proto3" json:"example,omitempty"`
	// contains filtered or unexported fields
}

UpdateRequest 更新示例请求

func (*UpdateRequest) Descriptor deprecated

func (*UpdateRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.

func (*UpdateRequest) GetExample

func (x *UpdateRequest) GetExample() *Example

func (*UpdateRequest) ProtoMessage

func (*UpdateRequest) ProtoMessage()

func (*UpdateRequest) ProtoReflect

func (x *UpdateRequest) ProtoReflect() protoreflect.Message

func (*UpdateRequest) Reset

func (x *UpdateRequest) Reset()

func (*UpdateRequest) String

func (x *UpdateRequest) String() string

func (*UpdateRequest) Validate

func (m *UpdateRequest) Validate() error

Validate checks the field values on UpdateRequest 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 (*UpdateRequest) ValidateAll

func (m *UpdateRequest) ValidateAll() error

ValidateAll checks the field values on UpdateRequest 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 UpdateRequestMultiError, or nil if none found.

type UpdateRequestMultiError

type UpdateRequestMultiError []error

UpdateRequestMultiError is an error wrapping multiple validation errors returned by UpdateRequest.ValidateAll() if the designated constraints aren't met.

func (UpdateRequestMultiError) AllErrors

func (m UpdateRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UpdateRequestMultiError) Error

func (m UpdateRequestMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type UpdateRequestValidationError

type UpdateRequestValidationError struct {
	// contains filtered or unexported fields
}

UpdateRequestValidationError is the validation error returned by UpdateRequest.Validate if the designated constraints aren't met.

func (UpdateRequestValidationError) Cause

Cause function returns cause value.

func (UpdateRequestValidationError) Error

Error satisfies the builtin error interface

func (UpdateRequestValidationError) ErrorName

func (e UpdateRequestValidationError) ErrorName() string

ErrorName returns error name.

func (UpdateRequestValidationError) Field

Field function returns field value.

func (UpdateRequestValidationError) Key

Key function returns key value.

func (UpdateRequestValidationError) Reason

Reason function returns reason value.

type UpdateResponse

type UpdateResponse struct {

	// 请求id
	RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	// 请求状态
	Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

UpdateResponse 更新示例响应

func (*UpdateResponse) Descriptor deprecated

func (*UpdateResponse) Descriptor() ([]byte, []int)

Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.

func (*UpdateResponse) GetRequestId

func (x *UpdateResponse) GetRequestId() string

func (*UpdateResponse) GetStatus

func (x *UpdateResponse) GetStatus() *status.Status

func (*UpdateResponse) ProtoMessage

func (*UpdateResponse) ProtoMessage()

func (*UpdateResponse) ProtoReflect

func (x *UpdateResponse) ProtoReflect() protoreflect.Message

func (*UpdateResponse) Reset

func (x *UpdateResponse) Reset()

func (*UpdateResponse) String

func (x *UpdateResponse) String() string

func (*UpdateResponse) Validate

func (m *UpdateResponse) Validate() error

Validate checks the field values on UpdateResponse 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 (*UpdateResponse) ValidateAll

func (m *UpdateResponse) ValidateAll() error

ValidateAll checks the field values on UpdateResponse 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 UpdateResponseMultiError, or nil if none found.

type UpdateResponseMultiError

type UpdateResponseMultiError []error

UpdateResponseMultiError is an error wrapping multiple validation errors returned by UpdateResponse.ValidateAll() if the designated constraints aren't met.

func (UpdateResponseMultiError) AllErrors

func (m UpdateResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UpdateResponseMultiError) Error

func (m UpdateResponseMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type UpdateResponseValidationError

type UpdateResponseValidationError struct {
	// contains filtered or unexported fields
}

UpdateResponseValidationError is the validation error returned by UpdateResponse.Validate if the designated constraints aren't met.

func (UpdateResponseValidationError) Cause

Cause function returns cause value.

func (UpdateResponseValidationError) Error

Error satisfies the builtin error interface

func (UpdateResponseValidationError) ErrorName

func (e UpdateResponseValidationError) ErrorName() string

ErrorName returns error name.

func (UpdateResponseValidationError) Field

Field function returns field value.

func (UpdateResponseValidationError) Key

Key function returns key value.

func (UpdateResponseValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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