k8_backend

package
v0.0.0-...-461386e Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package k8_backend is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var EnvValue_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.EnvValue",
	HandlerType: (*EnvValueServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetEnvValue",
			Handler:    _EnvValue_GetEnvValue_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "env/env.proto",
}

EnvValue_ServiceDesc is the grpc.ServiceDesc for EnvValue 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_env_env_proto protoreflect.FileDescriptor

Functions

func RegisterEnvValueHandler

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

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

func RegisterEnvValueHandlerClient

func RegisterEnvValueHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EnvValueClient) error

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

func RegisterEnvValueHandlerFromEndpoint

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

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

func RegisterEnvValueHandlerServer

func RegisterEnvValueHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EnvValueServer) error

RegisterEnvValueHandlerServer registers the http handlers for service EnvValue to "mux". UnaryRPC :call EnvValueServer 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 RegisterEnvValueHandlerFromEndpoint instead.

func RegisterEnvValueServer

func RegisterEnvValueServer(s grpc.ServiceRegistrar, srv EnvValueServer)

Types

type EnvValueClient

type EnvValueClient interface {
	GetEnvValue(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}

EnvValueClient is the client API for EnvValue 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 NewEnvValueClient

func NewEnvValueClient(cc grpc.ClientConnInterface) EnvValueClient

type EnvValueServer

type EnvValueServer interface {
	GetEnvValue(context.Context, *Request) (*Response, error)
	// contains filtered or unexported methods
}

EnvValueServer is the server API for EnvValue service. All implementations must embed UnimplementedEnvValueServer for forward compatibility

type Request

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

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetName

func (x *Request) GetName() string

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) String

func (x *Request) String() string

type Response

type Response struct {
	PodName    string `protobuf:"bytes,1,opt,name=podName,proto3" json:"podName,omitempty"`
	ServerName string `protobuf:"bytes,2,opt,name=serverName,proto3" json:"serverName,omitempty"`
	Value      string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetPodName

func (x *Response) GetPodName() string

func (*Response) GetServerName

func (x *Response) GetServerName() string

func (*Response) GetValue

func (x *Response) GetValue() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type UnimplementedEnvValueServer

type UnimplementedEnvValueServer struct {
}

UnimplementedEnvValueServer must be embedded to have forward compatible implementations.

func (UnimplementedEnvValueServer) GetEnvValue

type UnsafeEnvValueServer

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

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

Jump to

Keyboard shortcuts

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