subworkshop

package
v0.0.0-...-e6b574e Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 18 Imported by: 0

README

/api

Protobuf files and artifacts

  • protobuf definitions *.proto
  • gRPC server and client interfaces *.pb.go
  • Swagger *.swagger.json
  • grpc-gateway *.pb.gw.go

Documentation

Overview

Package subworkshop is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Car.ProtoReflect.Descriptor instead.

func (*Car) GetBodyStyle

func (x *Car) GetBodyStyle() CarBody

func (*Car) GetColor

func (x *Car) GetColor() string

func (*Car) GetNumber

func (x *Car) GetNumber() string

func (*Car) GetOwner

func (x *Car) GetOwner() string

func (*Car) ProtoMessage

func (*Car) ProtoMessage()

func (*Car) ProtoReflect

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

func (*Car) Reset

func (x *Car) Reset()

func (*Car) String

func (x *Car) String() string

type CarBody

type CarBody int32
const (
	Car_SEDAN     CarBody = 0
	Car_PHAETON   CarBody = 1
	Car_HATCHBACK CarBody = 2
)

func (CarBody) Descriptor

func (CarBody) Descriptor() protoreflect.EnumDescriptor

func (CarBody) Enum

func (x CarBody) Enum() *CarBody

func (CarBody) EnumDescriptor deprecated

func (CarBody) EnumDescriptor() ([]byte, []int)

Deprecated: Use CarBody.Descriptor instead.

func (CarBody) Number

func (x CarBody) Number() protoreflect.EnumNumber

func (CarBody) String

func (x CarBody) String() string

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.

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

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.

Jump to

Keyboard shortcuts

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