Documentation ¶
Overview ¶
Package media is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterGreeterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGreeterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreeterServiceClient) error
- func RegisterGreeterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGreeterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreeterServiceServer) error
- func RegisterGreeterServiceServer(s grpc.ServiceRegistrar, srv GreeterServiceServer)
- type GreeterServiceClient
- type GreeterServiceServer
- type SayHelloRequest
- func (*SayHelloRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SayHelloRequest) GetBoolVal() *wrapperspb.BoolValue
- func (x *SayHelloRequest) GetBytesVal() *wrapperspb.BytesValue
- func (x *SayHelloRequest) GetDoubleVal() *wrapperspb.DoubleValue
- func (x *SayHelloRequest) GetFloatVal() *wrapperspb.FloatValue
- func (x *SayHelloRequest) GetInt32Val() *wrapperspb.Int32Value
- func (x *SayHelloRequest) GetInt64Val() *wrapperspb.Int64Value
- func (x *SayHelloRequest) GetName() string
- func (x *SayHelloRequest) GetStrVal() *wrapperspb.StringValue
- func (x *SayHelloRequest) GetUint32Val() *wrapperspb.UInt32Value
- func (x *SayHelloRequest) GetUint64Val() *wrapperspb.UInt64Value
- func (*SayHelloRequest) ProtoMessage()
- func (x *SayHelloRequest) ProtoReflect() protoreflect.Message
- func (x *SayHelloRequest) Reset()
- func (x *SayHelloRequest) String() string
- func (m *SayHelloRequest) Validate() error
- type SayHelloRequestValidationError
- func (e SayHelloRequestValidationError) Cause() error
- func (e SayHelloRequestValidationError) Error() string
- func (e SayHelloRequestValidationError) ErrorName() string
- func (e SayHelloRequestValidationError) Field() string
- func (e SayHelloRequestValidationError) Key() bool
- func (e SayHelloRequestValidationError) Reason() string
- type SayHelloResponse
- func (*SayHelloResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SayHelloResponse) GetMessage() string
- func (*SayHelloResponse) ProtoMessage()
- func (x *SayHelloResponse) ProtoReflect() protoreflect.Message
- func (x *SayHelloResponse) Reset()
- func (x *SayHelloResponse) String() string
- func (m *SayHelloResponse) Validate() error
- type SayHelloResponseValidationError
- func (e SayHelloResponseValidationError) Cause() error
- func (e SayHelloResponseValidationError) Error() string
- func (e SayHelloResponseValidationError) ErrorName() string
- func (e SayHelloResponseValidationError) Field() string
- func (e SayHelloResponseValidationError) Key() bool
- func (e SayHelloResponseValidationError) Reason() string
- type UnimplementedGreeterServiceServer
- type UnsafeGreeterServiceServer
Constants ¶
const (
GreeterService_SayHello_FullMethodName = "/convers.media.v1.GreeterService/SayHello"
)
Variables ¶
var File_media_proto protoreflect.FileDescriptor
var GreeterService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "convers.media.v1.GreeterService", HandlerType: (*GreeterServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SayHello", Handler: _GreeterService_SayHello_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "media.proto", }
GreeterService_ServiceDesc is the grpc.ServiceDesc for GreeterService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGreeterServiceHandler ¶
func RegisterGreeterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterGreeterServiceHandler registers the http handlers for service GreeterService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterGreeterServiceHandlerClient ¶
func RegisterGreeterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreeterServiceClient) error
RegisterGreeterServiceHandlerClient registers the http handlers for service GreeterService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GreeterServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GreeterServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GreeterServiceClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterGreeterServiceHandlerFromEndpoint ¶
func RegisterGreeterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterGreeterServiceHandlerFromEndpoint is same as RegisterGreeterServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterGreeterServiceHandlerServer ¶
func RegisterGreeterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreeterServiceServer) error
RegisterGreeterServiceHandlerServer registers the http handlers for service GreeterService to "mux". UnaryRPC :call GreeterServiceServer 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 RegisterGreeterServiceHandlerFromEndpoint instead. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterGreeterServiceServer ¶
func RegisterGreeterServiceServer(s grpc.ServiceRegistrar, srv GreeterServiceServer)
Types ¶
type GreeterServiceClient ¶
type GreeterServiceClient interface {
SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error)
}
GreeterServiceClient is the client API for GreeterService 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 NewGreeterServiceClient ¶
func NewGreeterServiceClient(cc grpc.ClientConnInterface) GreeterServiceClient
type GreeterServiceServer ¶
type GreeterServiceServer interface { SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) // contains filtered or unexported methods }
GreeterServiceServer is the server API for GreeterService service. All implementations must embed UnimplementedGreeterServiceServer for forward compatibility.
type SayHelloRequest ¶
type SayHelloRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` StrVal *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=str_val,json=strVal,proto3" json:"str_val,omitempty"` FloatVal *wrapperspb.FloatValue `protobuf:"bytes,3,opt,name=float_val,json=floatVal,proto3" json:"float_val,omitempty"` DoubleVal *wrapperspb.DoubleValue `protobuf:"bytes,4,opt,name=double_val,json=doubleVal,proto3" json:"double_val,omitempty"` BoolVal *wrapperspb.BoolValue `protobuf:"bytes,5,opt,name=bool_val,json=boolVal,proto3" json:"bool_val,omitempty"` BytesVal *wrapperspb.BytesValue `protobuf:"bytes,6,opt,name=bytes_val,json=bytesVal,proto3" json:"bytes_val,omitempty"` Int32Val *wrapperspb.Int32Value `protobuf:"bytes,7,opt,name=int32_val,json=int32Val,proto3" json:"int32_val,omitempty"` Uint32Val *wrapperspb.UInt32Value `protobuf:"bytes,8,opt,name=uint32_val,json=uint32Val,proto3" json:"uint32_val,omitempty"` Int64Val *wrapperspb.Int64Value `protobuf:"bytes,9,opt,name=int64_val,json=int64Val,proto3" json:"int64_val,omitempty"` Uint64Val *wrapperspb.UInt64Value `protobuf:"bytes,10,opt,name=uint64_val,json=uint64Val,proto3" json:"uint64_val,omitempty"` // contains filtered or unexported fields }
func (*SayHelloRequest) Descriptor
deprecated
func (*SayHelloRequest) Descriptor() ([]byte, []int)
Deprecated: Use SayHelloRequest.ProtoReflect.Descriptor instead.
func (*SayHelloRequest) GetBoolVal ¶
func (x *SayHelloRequest) GetBoolVal() *wrapperspb.BoolValue
func (*SayHelloRequest) GetBytesVal ¶
func (x *SayHelloRequest) GetBytesVal() *wrapperspb.BytesValue
func (*SayHelloRequest) GetDoubleVal ¶
func (x *SayHelloRequest) GetDoubleVal() *wrapperspb.DoubleValue
func (*SayHelloRequest) GetFloatVal ¶
func (x *SayHelloRequest) GetFloatVal() *wrapperspb.FloatValue
func (*SayHelloRequest) GetInt32Val ¶
func (x *SayHelloRequest) GetInt32Val() *wrapperspb.Int32Value
func (*SayHelloRequest) GetInt64Val ¶
func (x *SayHelloRequest) GetInt64Val() *wrapperspb.Int64Value
func (*SayHelloRequest) GetName ¶
func (x *SayHelloRequest) GetName() string
func (*SayHelloRequest) GetStrVal ¶
func (x *SayHelloRequest) GetStrVal() *wrapperspb.StringValue
func (*SayHelloRequest) GetUint32Val ¶
func (x *SayHelloRequest) GetUint32Val() *wrapperspb.UInt32Value
func (*SayHelloRequest) GetUint64Val ¶
func (x *SayHelloRequest) GetUint64Val() *wrapperspb.UInt64Value
func (*SayHelloRequest) ProtoMessage ¶
func (*SayHelloRequest) ProtoMessage()
func (*SayHelloRequest) ProtoReflect ¶
func (x *SayHelloRequest) ProtoReflect() protoreflect.Message
func (*SayHelloRequest) Reset ¶
func (x *SayHelloRequest) Reset()
func (*SayHelloRequest) String ¶
func (x *SayHelloRequest) String() string
func (*SayHelloRequest) Validate ¶
func (m *SayHelloRequest) Validate() error
Validate checks the field values on SayHelloRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type SayHelloRequestValidationError ¶
type SayHelloRequestValidationError struct {
// contains filtered or unexported fields
}
SayHelloRequestValidationError is the validation error returned by SayHelloRequest.Validate if the designated constraints aren't met.
func (SayHelloRequestValidationError) Cause ¶
func (e SayHelloRequestValidationError) Cause() error
Cause function returns cause value.
func (SayHelloRequestValidationError) Error ¶
func (e SayHelloRequestValidationError) Error() string
Error satisfies the builtin error interface
func (SayHelloRequestValidationError) ErrorName ¶
func (e SayHelloRequestValidationError) ErrorName() string
ErrorName returns error name.
func (SayHelloRequestValidationError) Field ¶
func (e SayHelloRequestValidationError) Field() string
Field function returns field value.
func (SayHelloRequestValidationError) Key ¶
func (e SayHelloRequestValidationError) Key() bool
Key function returns key value.
func (SayHelloRequestValidationError) Reason ¶
func (e SayHelloRequestValidationError) Reason() string
Reason function returns reason value.
type SayHelloResponse ¶
type SayHelloResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*SayHelloResponse) Descriptor
deprecated
func (*SayHelloResponse) Descriptor() ([]byte, []int)
Deprecated: Use SayHelloResponse.ProtoReflect.Descriptor instead.
func (*SayHelloResponse) GetMessage ¶
func (x *SayHelloResponse) GetMessage() string
func (*SayHelloResponse) ProtoMessage ¶
func (*SayHelloResponse) ProtoMessage()
func (*SayHelloResponse) ProtoReflect ¶
func (x *SayHelloResponse) ProtoReflect() protoreflect.Message
func (*SayHelloResponse) Reset ¶
func (x *SayHelloResponse) Reset()
func (*SayHelloResponse) String ¶
func (x *SayHelloResponse) String() string
func (*SayHelloResponse) Validate ¶
func (m *SayHelloResponse) Validate() error
Validate checks the field values on SayHelloResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type SayHelloResponseValidationError ¶
type SayHelloResponseValidationError struct {
// contains filtered or unexported fields
}
SayHelloResponseValidationError is the validation error returned by SayHelloResponse.Validate if the designated constraints aren't met.
func (SayHelloResponseValidationError) Cause ¶
func (e SayHelloResponseValidationError) Cause() error
Cause function returns cause value.
func (SayHelloResponseValidationError) Error ¶
func (e SayHelloResponseValidationError) Error() string
Error satisfies the builtin error interface
func (SayHelloResponseValidationError) ErrorName ¶
func (e SayHelloResponseValidationError) ErrorName() string
ErrorName returns error name.
func (SayHelloResponseValidationError) Field ¶
func (e SayHelloResponseValidationError) Field() string
Field function returns field value.
func (SayHelloResponseValidationError) Key ¶
func (e SayHelloResponseValidationError) Key() bool
Key function returns key value.
func (SayHelloResponseValidationError) Reason ¶
func (e SayHelloResponseValidationError) Reason() string
Reason function returns reason value.
type UnimplementedGreeterServiceServer ¶
type UnimplementedGreeterServiceServer struct{}
UnimplementedGreeterServiceServer 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.
func (UnimplementedGreeterServiceServer) SayHello ¶
func (UnimplementedGreeterServiceServer) SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error)
type UnsafeGreeterServiceServer ¶
type UnsafeGreeterServiceServer interface {
// contains filtered or unexported methods
}
UnsafeGreeterServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GreeterServiceServer will result in compilation errors.