Documentation
¶
Overview ¶
Package subworkshop is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterSubWorkshopHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSubWorkshopHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SubWorkshopClient) error
- func RegisterSubWorkshopHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSubWorkshopHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SubWorkshopServer) error
- func RegisterSubWorkshopServer(s *grpc.Server, srv SubWorkshopServer)
- type Car
- func (*Car) Descriptor() ([]byte, []int)deprecated
- func (x *Car) GetBodyStyle() CarBody
- func (x *Car) GetColor() string
- func (x *Car) GetNumber() string
- func (x *Car) GetOwner() string
- func (*Car) ProtoMessage()
- func (x *Car) ProtoReflect() protoreflect.Message
- func (x *Car) Reset()
- func (x *Car) String() string
- type CarBody
- type SubPaintCarRequest
- func (*SubPaintCarRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SubPaintCarRequest) GetCallbackServiceAddress() string
- func (x *SubPaintCarRequest) GetCar() *Car
- func (x *SubPaintCarRequest) GetDesiredColor() string
- func (*SubPaintCarRequest) ProtoMessage()
- func (x *SubPaintCarRequest) ProtoReflect() protoreflect.Message
- func (x *SubPaintCarRequest) Reset()
- func (x *SubPaintCarRequest) String() string
- type SubWorkshopClient
- type SubWorkshopServer
- type UnimplementedSubWorkshopServer
- type UnsafeSubWorkshopServer
Constants ¶
This section is empty.
Variables ¶
var ( CarBody_name = map[int32]string{ 0: "SEDAN", 1: "PHAETON", 2: "HATCHBACK", } CarBody_value = map[string]int32{ "SEDAN": 0, "PHAETON": 1, "HATCHBACK": 2, } )
Enum value maps for CarBody.
var File_api_subworkshop_proto protoreflect.FileDescriptor
Functions ¶
func RegisterSubWorkshopHandler ¶
func RegisterSubWorkshopHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterSubWorkshopHandler registers the http handlers for service SubWorkshop to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterSubWorkshopHandlerClient ¶
func RegisterSubWorkshopHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SubWorkshopClient) error
RegisterSubWorkshopHandlerClient registers the http handlers for service SubWorkshop to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SubWorkshopClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SubWorkshopClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SubWorkshopClient" to call the correct interceptors.
func RegisterSubWorkshopHandlerFromEndpoint ¶
func RegisterSubWorkshopHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterSubWorkshopHandlerFromEndpoint is same as RegisterSubWorkshopHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterSubWorkshopHandlerServer ¶
func RegisterSubWorkshopHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SubWorkshopServer) error
RegisterSubWorkshopHandlerServer registers the http handlers for service SubWorkshop to "mux". UnaryRPC :call SubWorkshopServer 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 RegisterSubWorkshopHandlerFromEndpoint instead.
func RegisterSubWorkshopServer ¶
func RegisterSubWorkshopServer(s *grpc.Server, srv SubWorkshopServer)
Types ¶
type Car ¶
type Car struct { Number string `protobuf:"bytes,1,opt,name=number,proto3" json:"number,omitempty"` Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` BodyStyle CarBody `protobuf:"varint,3,opt,name=body_style,json=bodyStyle,proto3,enum=demo.subworkshop.CarBody" json:"body_style,omitempty"` Color string `protobuf:"bytes,4,opt,name=color,proto3" json:"color,omitempty"` // contains filtered or unexported fields }
func (*Car) Descriptor
deprecated
func (*Car) GetBodyStyle ¶
func (*Car) ProtoMessage ¶
func (*Car) ProtoMessage()
func (*Car) ProtoReflect ¶
func (x *Car) ProtoReflect() protoreflect.Message
type CarBody ¶
type CarBody int32
func (CarBody) Descriptor ¶
func (CarBody) Descriptor() protoreflect.EnumDescriptor
func (CarBody) EnumDescriptor
deprecated
func (CarBody) Number ¶
func (x CarBody) Number() protoreflect.EnumNumber
func (CarBody) Type ¶
func (CarBody) Type() protoreflect.EnumType
type SubPaintCarRequest ¶
type SubPaintCarRequest struct { Car *Car `protobuf:"bytes,1,opt,name=car,proto3" json:"car,omitempty"` DesiredColor string `protobuf:"bytes,2,opt,name=desired_color,json=desiredColor,proto3" json:"desired_color,omitempty"` CallbackServiceAddress string `` /* 129-byte string literal not displayed */ // contains filtered or unexported fields }
func (*SubPaintCarRequest) Descriptor
deprecated
func (*SubPaintCarRequest) Descriptor() ([]byte, []int)
Deprecated: Use SubPaintCarRequest.ProtoReflect.Descriptor instead.
func (*SubPaintCarRequest) GetCallbackServiceAddress ¶
func (x *SubPaintCarRequest) GetCallbackServiceAddress() string
func (*SubPaintCarRequest) GetCar ¶
func (x *SubPaintCarRequest) GetCar() *Car
func (*SubPaintCarRequest) GetDesiredColor ¶
func (x *SubPaintCarRequest) GetDesiredColor() string
func (*SubPaintCarRequest) ProtoMessage ¶
func (*SubPaintCarRequest) ProtoMessage()
func (*SubPaintCarRequest) ProtoReflect ¶
func (x *SubPaintCarRequest) ProtoReflect() protoreflect.Message
func (*SubPaintCarRequest) Reset ¶
func (x *SubPaintCarRequest) Reset()
func (*SubPaintCarRequest) String ¶
func (x *SubPaintCarRequest) String() string
type SubWorkshopClient ¶
type SubWorkshopClient interface {
PaintCar(ctx context.Context, in *SubPaintCarRequest, opts ...grpc.CallOption) (*empty.Empty, error)
}
SubWorkshopClient is the client API for SubWorkshop 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 NewSubWorkshopClient ¶
func NewSubWorkshopClient(cc grpc.ClientConnInterface) SubWorkshopClient
type SubWorkshopServer ¶
type SubWorkshopServer interface { PaintCar(context.Context, *SubPaintCarRequest) (*empty.Empty, error) // contains filtered or unexported methods }
SubWorkshopServer is the server API for SubWorkshop service. All implementations must embed UnimplementedSubWorkshopServer for forward compatibility
type UnimplementedSubWorkshopServer ¶
type UnimplementedSubWorkshopServer struct { }
UnimplementedSubWorkshopServer must be embedded to have forward compatible implementations.
func (UnimplementedSubWorkshopServer) PaintCar ¶
func (UnimplementedSubWorkshopServer) PaintCar(context.Context, *SubPaintCarRequest) (*empty.Empty, error)
type UnsafeSubWorkshopServer ¶
type UnsafeSubWorkshopServer interface {
// contains filtered or unexported methods
}
UnsafeSubWorkshopServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to SubWorkshopServer will result in compilation errors.