v1

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Status_name = map[int32]string{
		0: "OK",
		1: "FAIL",
	}
	Status_value = map[string]int32{
		"OK":   0,
		"FAIL": 1,
	}
)

Enum value maps for Status.

View Source
var File_proto_vatz_rpc_v1_rpc_proto protoreflect.FileDescriptor
View Source
var VatzRPC_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "vatz.rpc.VatzRPC",
	HandlerType: (*VatzRPCServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PluginStatus",
			Handler:    _VatzRPC_PluginStatus_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/vatz/rpc/v1/rpc.proto",
}

VatzRPC_ServiceDesc is the grpc.ServiceDesc for VatzRPC service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterVatzRPCHandler

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

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

func RegisterVatzRPCHandlerClient

func RegisterVatzRPCHandlerClient(ctx context.Context, mux *runtime.ServeMux, client VatzRPCClient) error

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

func RegisterVatzRPCHandlerFromEndpoint

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

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

func RegisterVatzRPCHandlerServer

func RegisterVatzRPCHandlerServer(ctx context.Context, mux *runtime.ServeMux, server VatzRPCServer) error

RegisterVatzRPCHandlerServer registers the http handlers for service VatzRPC to "mux". UnaryRPC :call VatzRPCServer 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 RegisterVatzRPCHandlerFromEndpoint instead.

func RegisterVatzRPCServer

func RegisterVatzRPCServer(s grpc.ServiceRegistrar, srv VatzRPCServer)

Types

type PluginStatus

type PluginStatus struct {
	Status     Status `protobuf:"varint,1,opt,name=status,proto3,enum=vatz.rpc.Status" json:"status,omitempty"`
	PluginName string `protobuf:"bytes,2,opt,name=plugin_name,json=pluginName,proto3" json:"plugin_name,omitempty"`
	// contains filtered or unexported fields
}

func (*PluginStatus) Descriptor deprecated

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

Deprecated: Use PluginStatus.ProtoReflect.Descriptor instead.

func (*PluginStatus) GetPluginName

func (x *PluginStatus) GetPluginName() string

func (*PluginStatus) GetStatus

func (x *PluginStatus) GetStatus() Status

func (*PluginStatus) ProtoMessage

func (*PluginStatus) ProtoMessage()

func (*PluginStatus) ProtoReflect

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

func (*PluginStatus) Reset

func (x *PluginStatus) Reset()

func (*PluginStatus) String

func (x *PluginStatus) String() string

type PluginStatusResponse

type PluginStatusResponse struct {
	Status       Status          `protobuf:"varint,1,opt,name=status,proto3,enum=vatz.rpc.Status" json:"status,omitempty"`
	PluginStatus []*PluginStatus `protobuf:"bytes,2,rep,name=plugin_status,json=pluginStatus,proto3" json:"plugin_status,omitempty"`
	// contains filtered or unexported fields
}

func (*PluginStatusResponse) Descriptor deprecated

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

Deprecated: Use PluginStatusResponse.ProtoReflect.Descriptor instead.

func (*PluginStatusResponse) GetPluginStatus

func (x *PluginStatusResponse) GetPluginStatus() []*PluginStatus

func (*PluginStatusResponse) GetStatus

func (x *PluginStatusResponse) GetStatus() Status

func (*PluginStatusResponse) ProtoMessage

func (*PluginStatusResponse) ProtoMessage()

func (*PluginStatusResponse) ProtoReflect

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

func (*PluginStatusResponse) Reset

func (x *PluginStatusResponse) Reset()

func (*PluginStatusResponse) String

func (x *PluginStatusResponse) String() string

type Status

type Status int32
const (
	Status_OK   Status = 0
	Status_FAIL Status = 1
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

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

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

type UnimplementedVatzRPCServer

type UnimplementedVatzRPCServer struct {
}

UnimplementedVatzRPCServer must be embedded to have forward compatible implementations.

func (UnimplementedVatzRPCServer) PluginStatus

type UnsafeVatzRPCServer

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

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

type VatzRPCClient

type VatzRPCClient interface {
	PluginStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PluginStatusResponse, error)
}

VatzRPCClient is the client API for VatzRPC 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 NewVatzRPCClient

func NewVatzRPCClient(cc grpc.ClientConnInterface) VatzRPCClient

type VatzRPCServer

type VatzRPCServer interface {
	PluginStatus(context.Context, *emptypb.Empty) (*PluginStatusResponse, error)
	// contains filtered or unexported methods
}

VatzRPCServer is the server API for VatzRPC service. All implementations must embed UnimplementedVatzRPCServer for forward compatibility

Jump to

Keyboard shortcuts

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