example

package
v0.8.2-rc3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package example is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var ExampleAPIExtension_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "example.ExampleAPIExtension",
	HandlerType: (*ExampleAPIExtensionServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Echo",
			Handler:    _ExampleAPIExtension_Echo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/rancher/opni/plugins/example/pkg/example/example.proto",
}

ExampleAPIExtension_ServiceDesc is the grpc.ServiceDesc for ExampleAPIExtension 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 ExampleUnaryExtension_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "example.ExampleUnaryExtension",
	HandlerType: (*ExampleUnaryExtensionServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Hello",
			Handler:    _ExampleUnaryExtension_Hello_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/rancher/opni/plugins/example/pkg/example/example.proto",
}

ExampleUnaryExtension_ServiceDesc is the grpc.ServiceDesc for ExampleUnaryExtension 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_github_com_rancher_opni_plugins_example_pkg_example_example_proto protoreflect.FileDescriptor

Functions

func RegisterExampleAPIExtensionHandler

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

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

func RegisterExampleAPIExtensionHandlerClient

func RegisterExampleAPIExtensionHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ExampleAPIExtensionClient) error

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

func RegisterExampleAPIExtensionHandlerFromEndpoint

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

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

func RegisterExampleAPIExtensionHandlerServer

func RegisterExampleAPIExtensionHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ExampleAPIExtensionServer) error

RegisterExampleAPIExtensionHandlerServer registers the http handlers for service ExampleAPIExtension to "mux". UnaryRPC :call ExampleAPIExtensionServer 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 RegisterExampleAPIExtensionHandlerFromEndpoint instead.

func RegisterExampleAPIExtensionServer

func RegisterExampleAPIExtensionServer(s grpc.ServiceRegistrar, srv ExampleAPIExtensionServer)

func RegisterExampleUnaryExtensionServer added in v0.5.4

func RegisterExampleUnaryExtensionServer(s grpc.ServiceRegistrar, srv ExampleUnaryExtensionServer)

func Scheme

func Scheme(_ context.Context) meta.Scheme

Types

type EchoRequest

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

func (*EchoRequest) Descriptor deprecated

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

Deprecated: Use EchoRequest.ProtoReflect.Descriptor instead.

func (*EchoRequest) GetMessage

func (x *EchoRequest) GetMessage() 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 {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*EchoResponse) Descriptor deprecated

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

Deprecated: Use EchoResponse.ProtoReflect.Descriptor instead.

func (*EchoResponse) GetMessage

func (x *EchoResponse) GetMessage() string

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 ExampleAPIExtensionClient

type ExampleAPIExtensionClient interface {
	Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error)
}

ExampleAPIExtensionClient is the client API for ExampleAPIExtension 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 ExampleAPIExtensionServer

type ExampleAPIExtensionServer interface {
	Echo(context.Context, *EchoRequest) (*EchoResponse, error)
	// contains filtered or unexported methods
}

ExampleAPIExtensionServer is the server API for ExampleAPIExtension service. All implementations must embed UnimplementedExampleAPIExtensionServer for forward compatibility

type ExamplePlugin

func (*ExamplePlugin) CanInstall

func (*ExamplePlugin) CancelUninstall added in v0.6.0

func (s *ExamplePlugin) CancelUninstall(context.Context, *corev1.Reference) (*emptypb.Empty, error)

func (*ExamplePlugin) ConfigureRoutes

func (s *ExamplePlugin) ConfigureRoutes(app *gin.Engine)

func (*ExamplePlugin) Echo

func (*ExamplePlugin) Hello added in v0.5.4

func (*ExamplePlugin) Info added in v0.6.0

func (*ExamplePlugin) InstallerTemplate

func (*ExamplePlugin) Status added in v0.6.0

func (*ExamplePlugin) Uninstall added in v0.4.2

func (*ExamplePlugin) UninstallStatus added in v0.6.0

func (s *ExamplePlugin) UninstallStatus(context.Context, *corev1.Reference) (*corev1.TaskStatus, error)

func (*ExamplePlugin) UseKeyValueStore

func (s *ExamplePlugin) UseKeyValueStore(client system.KeyValueStoreClient)

func (*ExamplePlugin) UseManagementAPI

func (s *ExamplePlugin) UseManagementAPI(api managementv1.ManagementClient)

type ExampleUnaryExtensionClient added in v0.5.4

type ExampleUnaryExtensionClient interface {
	Hello(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*EchoResponse, error)
}

ExampleUnaryExtensionClient is the client API for ExampleUnaryExtension 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 NewExampleUnaryExtensionClient added in v0.5.4

func NewExampleUnaryExtensionClient(cc grpc.ClientConnInterface) ExampleUnaryExtensionClient

type ExampleUnaryExtensionServer added in v0.5.4

type ExampleUnaryExtensionServer interface {
	Hello(context.Context, *emptypb.Empty) (*EchoResponse, error)
	// contains filtered or unexported methods
}

ExampleUnaryExtensionServer is the server API for ExampleUnaryExtension service. All implementations must embed UnimplementedExampleUnaryExtensionServer for forward compatibility

type UnimplementedExampleAPIExtensionServer

type UnimplementedExampleAPIExtensionServer struct {
}

UnimplementedExampleAPIExtensionServer must be embedded to have forward compatible implementations.

func (UnimplementedExampleAPIExtensionServer) Echo

type UnimplementedExampleUnaryExtensionServer added in v0.5.4

type UnimplementedExampleUnaryExtensionServer struct {
}

UnimplementedExampleUnaryExtensionServer must be embedded to have forward compatible implementations.

func (UnimplementedExampleUnaryExtensionServer) Hello added in v0.5.4

type UnsafeExampleAPIExtensionServer

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

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

type UnsafeExampleUnaryExtensionServer added in v0.5.4

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

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

Jump to

Keyboard shortcuts

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