pb

package
v0.0.0-...-377d37b Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_github_com_alavrovinfb_fls_interpreter_pkg_pb_service_proto protoreflect.FileDescriptor
View Source
var FlsInterpreter_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "flsinterpreter.FlsInterpreter",
	HandlerType: (*FlsInterpreterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetVersion",
			Handler:    _FlsInterpreter_GetVersion_Handler,
		},
		{
			MethodName: "ScriptExecute",
			Handler:    _FlsInterpreter_ScriptExecute_Handler,
		},
		{
			MethodName: "Reset",
			Handler:    _FlsInterpreter_Reset_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "github.com/alavrovinfb/fls-interpreter/pkg/pb/service.proto",
}

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

Functions

func RegisterFlsInterpreterHandler

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

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

func RegisterFlsInterpreterHandlerClient

func RegisterFlsInterpreterHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FlsInterpreterClient) error

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

func RegisterFlsInterpreterHandlerFromEndpoint

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

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

func RegisterFlsInterpreterHandlerServer

func RegisterFlsInterpreterHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FlsInterpreterServer) error

RegisterFlsInterpreterHandlerServer registers the http handlers for service FlsInterpreter to "mux". UnaryRPC :call FlsInterpreterServer 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 RegisterFlsInterpreterHandlerFromEndpoint instead.

func RegisterFlsInterpreterServer

func RegisterFlsInterpreterServer(s grpc.ServiceRegistrar, srv FlsInterpreterServer)

Types

type FlsInterpreterClient

type FlsInterpreterClient interface {
	//
	//Return service version
	GetVersion(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*VersionResponse, error)
	//
	//Execute FLS scrips
	ScriptExecute(ctx context.Context, in *ScriptRequest, opts ...grpc.CallOption) (*ScriptResponse, error)
	//
	//Return service version
	Reset(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ResetResponse, error)
}

FlsInterpreterClient is the client API for FlsInterpreter 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 FlsInterpreterServer

type FlsInterpreterServer interface {
	//
	//Return service version
	GetVersion(context.Context, *emptypb.Empty) (*VersionResponse, error)
	//
	//Execute FLS scrips
	ScriptExecute(context.Context, *ScriptRequest) (*ScriptResponse, error)
	//
	//Return service version
	Reset(context.Context, *emptypb.Empty) (*ResetResponse, error)
}

FlsInterpreterServer is the server API for FlsInterpreter service. All implementations should embed UnimplementedFlsInterpreterServer for forward compatibility

type ResetResponse

type ResetResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	Status  int32  `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*ResetResponse) Descriptor deprecated

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

Deprecated: Use ResetResponse.ProtoReflect.Descriptor instead.

func (*ResetResponse) GetMessage

func (x *ResetResponse) GetMessage() string

func (*ResetResponse) GetStatus

func (x *ResetResponse) GetStatus() int32

func (*ResetResponse) ProtoMessage

func (*ResetResponse) ProtoMessage()

func (*ResetResponse) ProtoReflect

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

func (*ResetResponse) Reset

func (x *ResetResponse) Reset()

func (*ResetResponse) String

func (x *ResetResponse) String() string

func (*ResetResponse) Validate

func (m *ResetResponse) Validate() error

Validate checks the field values on ResetResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ResetResponseValidationError

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

ResetResponseValidationError is the validation error returned by ResetResponse.Validate if the designated constraints aren't met.

func (ResetResponseValidationError) Cause

Cause function returns cause value.

func (ResetResponseValidationError) Error

Error satisfies the builtin error interface

func (ResetResponseValidationError) ErrorName

func (e ResetResponseValidationError) ErrorName() string

ErrorName returns error name.

func (ResetResponseValidationError) Field

Field function returns field value.

func (ResetResponseValidationError) Key

Key function returns key value.

func (ResetResponseValidationError) Reason

Reason function returns reason value.

type ScriptRequest

type ScriptRequest struct {
	Script *structpb.Struct `protobuf:"bytes,1,opt,name=script,proto3" json:"script,omitempty"`
	// contains filtered or unexported fields
}

func (*ScriptRequest) Descriptor deprecated

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

Deprecated: Use ScriptRequest.ProtoReflect.Descriptor instead.

func (*ScriptRequest) GetScript

func (x *ScriptRequest) GetScript() *structpb.Struct

func (*ScriptRequest) ProtoMessage

func (*ScriptRequest) ProtoMessage()

func (*ScriptRequest) ProtoReflect

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

func (*ScriptRequest) Reset

func (x *ScriptRequest) Reset()

func (*ScriptRequest) String

func (x *ScriptRequest) String() string

func (*ScriptRequest) Validate

func (m *ScriptRequest) Validate() error

Validate checks the field values on ScriptRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ScriptRequestValidationError

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

ScriptRequestValidationError is the validation error returned by ScriptRequest.Validate if the designated constraints aren't met.

func (ScriptRequestValidationError) Cause

Cause function returns cause value.

func (ScriptRequestValidationError) Error

Error satisfies the builtin error interface

func (ScriptRequestValidationError) ErrorName

func (e ScriptRequestValidationError) ErrorName() string

ErrorName returns error name.

func (ScriptRequestValidationError) Field

Field function returns field value.

func (ScriptRequestValidationError) Key

Key function returns key value.

func (ScriptRequestValidationError) Reason

Reason function returns reason value.

type ScriptResponse

type ScriptResponse struct {

	// FLS script execution results
	Result []*structpb.Value `protobuf:"bytes,1,rep,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func OutToPB

func OutToPB(in *[]interface{}) (*ScriptResponse, error)

func (*ScriptResponse) Descriptor deprecated

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

Deprecated: Use ScriptResponse.ProtoReflect.Descriptor instead.

func (*ScriptResponse) GetResult

func (x *ScriptResponse) GetResult() []*structpb.Value

func (*ScriptResponse) ProtoMessage

func (*ScriptResponse) ProtoMessage()

func (*ScriptResponse) ProtoReflect

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

func (*ScriptResponse) Reset

func (x *ScriptResponse) Reset()

func (*ScriptResponse) String

func (x *ScriptResponse) String() string

func (*ScriptResponse) Validate

func (m *ScriptResponse) Validate() error

Validate checks the field values on ScriptResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ScriptResponseValidationError

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

ScriptResponseValidationError is the validation error returned by ScriptResponse.Validate if the designated constraints aren't met.

func (ScriptResponseValidationError) Cause

Cause function returns cause value.

func (ScriptResponseValidationError) Error

Error satisfies the builtin error interface

func (ScriptResponseValidationError) ErrorName

func (e ScriptResponseValidationError) ErrorName() string

ErrorName returns error name.

func (ScriptResponseValidationError) Field

Field function returns field value.

func (ScriptResponseValidationError) Key

Key function returns key value.

func (ScriptResponseValidationError) Reason

Reason function returns reason value.

type UnimplementedFlsInterpreterServer

type UnimplementedFlsInterpreterServer struct {
}

UnimplementedFlsInterpreterServer should be embedded to have forward compatible implementations.

func (UnimplementedFlsInterpreterServer) GetVersion

func (UnimplementedFlsInterpreterServer) Reset

func (UnimplementedFlsInterpreterServer) ScriptExecute

type UnsafeFlsInterpreterServer

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

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

type VersionResponse

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

TODO: Structure your own protobuf messages. Each protocol buffer message is a small logical record of information, containing a series of name-value pairs.

func (*VersionResponse) Descriptor deprecated

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

Deprecated: Use VersionResponse.ProtoReflect.Descriptor instead.

func (*VersionResponse) GetVersion

func (x *VersionResponse) GetVersion() string

func (*VersionResponse) ProtoMessage

func (*VersionResponse) ProtoMessage()

func (*VersionResponse) ProtoReflect

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

func (*VersionResponse) Reset

func (x *VersionResponse) Reset()

func (*VersionResponse) String

func (x *VersionResponse) String() string

func (*VersionResponse) Validate

func (m *VersionResponse) Validate() error

Validate checks the field values on VersionResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type VersionResponseValidationError

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

VersionResponseValidationError is the validation error returned by VersionResponse.Validate if the designated constraints aren't met.

func (VersionResponseValidationError) Cause

Cause function returns cause value.

func (VersionResponseValidationError) Error

Error satisfies the builtin error interface

func (VersionResponseValidationError) ErrorName

func (e VersionResponseValidationError) ErrorName() string

ErrorName returns error name.

func (VersionResponseValidationError) Field

Field function returns field value.

func (VersionResponseValidationError) Key

Key function returns key value.

func (VersionResponseValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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