platformtestv1

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package platformtestv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EchoService_Echo_FullMethodName        = "/platformtest.v1.EchoService/Echo"
	EchoService_Fail_FullMethodName        = "/platformtest.v1.EchoService/Fail"
	EchoService_Upload_FullMethodName      = "/platformtest.v1.EchoService/Upload"
	EchoService_OldEcho_FullMethodName     = "/platformtest.v1.EchoService/OldEcho"
	EchoService_CreateThing_FullMethodName = "/platformtest.v1.EchoService/CreateThing"
)

Variables

View Source
var EchoService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "platformtest.v1.EchoService",
	HandlerType: (*EchoServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Echo",
			Handler:    _EchoService_Echo_Handler,
		},
		{
			MethodName: "Fail",
			Handler:    _EchoService_Fail_Handler,
		},
		{
			MethodName: "Upload",
			Handler:    _EchoService_Upload_Handler,
		},
		{
			MethodName: "OldEcho",
			Handler:    _EchoService_OldEcho_Handler,
		},
		{
			MethodName: "CreateThing",
			Handler:    _EchoService_CreateThing_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "platformtest/v1/echo.proto",
}

EchoService_ServiceDesc is the grpc.ServiceDesc for EchoService 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_platformtest_v1_echo_proto protoreflect.FileDescriptor

Functions

func RegisterEchoServiceHandler

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

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

func RegisterEchoServiceHandlerClient

func RegisterEchoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EchoServiceClient) error

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

func RegisterEchoServiceHandlerFromEndpoint

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

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

func RegisterEchoServiceHandlerServer

func RegisterEchoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EchoServiceServer) error

RegisterEchoServiceHandlerServer registers the http handlers for service EchoService to "mux". UnaryRPC :call EchoServiceServer 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 RegisterEchoServiceHandlerFromEndpoint 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 RegisterEchoServiceServer

func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer)

Types

type CreateThingRequest

type CreateThingRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateThingRequest) Descriptor deprecated

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

Deprecated: Use CreateThingRequest.ProtoReflect.Descriptor instead.

func (*CreateThingRequest) GetName

func (x *CreateThingRequest) GetName() string

func (*CreateThingRequest) ProtoMessage

func (*CreateThingRequest) ProtoMessage()

func (*CreateThingRequest) ProtoReflect

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

func (*CreateThingRequest) Reset

func (x *CreateThingRequest) Reset()

func (*CreateThingRequest) String

func (x *CreateThingRequest) String() string

type CreateThingResponse

type CreateThingResponse struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Calls int32  `protobuf:"varint,2,opt,name=calls,proto3" json:"calls,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateThingResponse) Descriptor deprecated

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

Deprecated: Use CreateThingResponse.ProtoReflect.Descriptor instead.

func (*CreateThingResponse) GetCalls

func (x *CreateThingResponse) GetCalls() int32

func (*CreateThingResponse) GetId

func (x *CreateThingResponse) GetId() string

func (*CreateThingResponse) ProtoMessage

func (*CreateThingResponse) ProtoMessage()

func (*CreateThingResponse) ProtoReflect

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

func (*CreateThingResponse) Reset

func (x *CreateThingResponse) Reset()

func (*CreateThingResponse) String

func (x *CreateThingResponse) String() string

type EchoRequest

type EchoRequest struct {
	MessageText string `protobuf:"bytes,1,opt,name=message_text,json=messageText,proto3" json:"message_text,omitempty"`
	// contains filtered or unexported fields
}

func (*EchoRequest) Descriptor deprecated

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

Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.

func (*EchoRequest) GetMessageText

func (x *EchoRequest) GetMessageText() string

func (*EchoRequest) ProtoMessage

func (*EchoRequest) ProtoMessage()

func (*EchoRequest) ProtoReflect

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

func (*EchoRequest) Reset

func (x *EchoRequest) Reset()

func (*EchoRequest) String

func (x *EchoRequest) String() string

type EchoResponse

type EchoResponse struct {
	MessageText string `protobuf:"bytes,1,opt,name=message_text,json=messageText,proto3" json:"message_text,omitempty"`
	Length      int32  `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"`
	Shouted     bool   `protobuf:"varint,3,opt,name=shouted,proto3" json:"shouted,omitempty"`
	// contains filtered or unexported fields
}

func (*EchoResponse) Descriptor deprecated

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

Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.

func (*EchoResponse) GetLength

func (x *EchoResponse) GetLength() int32

func (*EchoResponse) GetMessageText

func (x *EchoResponse) GetMessageText() string

func (*EchoResponse) GetShouted

func (x *EchoResponse) GetShouted() bool

func (*EchoResponse) ProtoMessage

func (*EchoResponse) ProtoMessage()

func (*EchoResponse) ProtoReflect

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

func (*EchoResponse) Reset

func (x *EchoResponse) Reset()

func (*EchoResponse) String

func (x *EchoResponse) String() string

type EchoServiceClient

type EchoServiceClient interface {
	Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
	Fail(ctx context.Context, in *FailRequest, opts ...grpc.CallOption) (*FailResponse, error)
	// Files over multipart/form-data through the gateway.
	Upload(ctx context.Context, in *UploadRequest, opts ...grpc.CallOption) (*UploadResponse, error)
	// Deprecated: Do not use.
	// A method kept for old clients.
	OldEcho(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
	// A method that creates something, for idempotency.
	CreateThing(ctx context.Context, in *CreateThingRequest, opts ...grpc.CallOption) (*CreateThingResponse, error)
}

EchoServiceClient is the client API for EchoService 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 EchoServiceServer

type EchoServiceServer interface {
	Echo(context.Context, *EchoRequest) (*EchoResponse, error)
	Fail(context.Context, *FailRequest) (*FailResponse, error)
	// Files over multipart/form-data through the gateway.
	Upload(context.Context, *UploadRequest) (*UploadResponse, error)
	// Deprecated: Do not use.
	// A method kept for old clients.
	OldEcho(context.Context, *EchoRequest) (*EchoResponse, error)
	// A method that creates something, for idempotency.
	CreateThing(context.Context, *CreateThingRequest) (*CreateThingResponse, error)
	// contains filtered or unexported methods
}

EchoServiceServer is the server API for EchoService service. All implementations must embed UnimplementedEchoServiceServer for forward compatibility.

type FailRequest

type FailRequest struct {

	// panic, internal, not_found or slow
	Kind string `protobuf:"bytes,1,opt,name=kind,proto3" json:"kind,omitempty"`
	// contains filtered or unexported fields
}

func (*FailRequest) Descriptor deprecated

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

Deprecated: Use FailRequest.ProtoReflect.Descriptor instead.

func (*FailRequest) GetKind

func (x *FailRequest) GetKind() string

func (*FailRequest) ProtoMessage

func (*FailRequest) ProtoMessage()

func (*FailRequest) ProtoReflect

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

func (*FailRequest) Reset

func (x *FailRequest) Reset()

func (*FailRequest) String

func (x *FailRequest) String() string

type FailResponse

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

func (*FailResponse) Descriptor deprecated

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

Deprecated: Use FailResponse.ProtoReflect.Descriptor instead.

func (*FailResponse) ProtoMessage

func (*FailResponse) ProtoMessage()

func (*FailResponse) ProtoReflect

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

func (*FailResponse) Reset

func (x *FailResponse) Reset()

func (*FailResponse) String

func (x *FailResponse) String() string

type File

type File struct {
	Filename    string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"`
	ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
	Content     []byte `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*File) Descriptor deprecated

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

Deprecated: Use File.ProtoReflect.Descriptor instead.

func (*File) GetContent

func (x *File) GetContent() []byte

func (*File) GetContentType

func (x *File) GetContentType() string

func (*File) GetFilename

func (x *File) GetFilename() string

func (*File) ProtoMessage

func (*File) ProtoMessage()

func (*File) ProtoReflect

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

func (*File) Reset

func (x *File) Reset()

func (*File) String

func (x *File) String() string

type Meta

type Meta struct {
	Author string `protobuf:"bytes,1,opt,name=author,proto3" json:"author,omitempty"`
	// contains filtered or unexported fields
}

func (*Meta) Descriptor deprecated

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

Deprecated: Use Meta.ProtoReflect.Descriptor instead.

func (*Meta) GetAuthor

func (x *Meta) GetAuthor() string

func (*Meta) ProtoMessage

func (*Meta) ProtoMessage()

func (*Meta) ProtoReflect

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

func (*Meta) Reset

func (x *Meta) Reset()

func (*Meta) String

func (x *Meta) String() string

type UnimplementedEchoServiceServer

type UnimplementedEchoServiceServer struct{}

UnimplementedEchoServiceServer 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 (UnimplementedEchoServiceServer) CreateThing

func (UnimplementedEchoServiceServer) Echo

func (UnimplementedEchoServiceServer) Fail

func (UnimplementedEchoServiceServer) OldEcho

func (UnimplementedEchoServiceServer) Upload

type UnsafeEchoServiceServer

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

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

type UploadRequest

type UploadRequest struct {
	Title  string  `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Avatar *File   `protobuf:"bytes,2,opt,name=avatar,proto3" json:"avatar,omitempty"`
	Images []*File `protobuf:"bytes,3,rep,name=images,proto3" json:"images,omitempty"`
	Meta   *Meta   `protobuf:"bytes,4,opt,name=meta,proto3" json:"meta,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadRequest) Descriptor deprecated

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

Deprecated: Use UploadRequest.ProtoReflect.Descriptor instead.

func (*UploadRequest) GetAvatar

func (x *UploadRequest) GetAvatar() *File

func (*UploadRequest) GetImages

func (x *UploadRequest) GetImages() []*File

func (*UploadRequest) GetMeta

func (x *UploadRequest) GetMeta() *Meta

func (*UploadRequest) GetTitle

func (x *UploadRequest) GetTitle() string

func (*UploadRequest) ProtoMessage

func (*UploadRequest) ProtoMessage()

func (*UploadRequest) ProtoReflect

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

func (*UploadRequest) Reset

func (x *UploadRequest) Reset()

func (*UploadRequest) String

func (x *UploadRequest) String() string

type UploadResponse

type UploadResponse struct {
	Title      string   `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	AvatarName string   `protobuf:"bytes,2,opt,name=avatar_name,json=avatarName,proto3" json:"avatar_name,omitempty"`
	AvatarSize int32    `protobuf:"varint,3,opt,name=avatar_size,json=avatarSize,proto3" json:"avatar_size,omitempty"`
	Images     []string `protobuf:"bytes,4,rep,name=images,proto3" json:"images,omitempty"`
	Author     string   `protobuf:"bytes,5,opt,name=author,proto3" json:"author,omitempty"`
	AvatarType string   `protobuf:"bytes,6,opt,name=avatar_type,json=avatarType,proto3" json:"avatar_type,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadResponse) Descriptor deprecated

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

Deprecated: Use UploadResponse.ProtoReflect.Descriptor instead.

func (*UploadResponse) GetAuthor

func (x *UploadResponse) GetAuthor() string

func (*UploadResponse) GetAvatarName

func (x *UploadResponse) GetAvatarName() string

func (*UploadResponse) GetAvatarSize

func (x *UploadResponse) GetAvatarSize() int32

func (*UploadResponse) GetAvatarType

func (x *UploadResponse) GetAvatarType() string

func (*UploadResponse) GetImages

func (x *UploadResponse) GetImages() []string

func (*UploadResponse) GetTitle

func (x *UploadResponse) GetTitle() string

func (*UploadResponse) ProtoMessage

func (*UploadResponse) ProtoMessage()

func (*UploadResponse) ProtoReflect

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

func (*UploadResponse) Reset

func (x *UploadResponse) Reset()

func (*UploadResponse) String

func (x *UploadResponse) String() string

Jump to

Keyboard shortcuts

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