v1

package
v0.0.0-...-d4a65ec Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	ValidateService_Check_FullMethodName = "/validate.v1.ValidateService/Check"
)

Variables

View Source
var File_proto_validate_v1_validate_proto protoreflect.FileDescriptor
View Source
var ValidateService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "validate.v1.ValidateService",
	HandlerType: (*ValidateServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Check",
			Handler:    _ValidateService_Check_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/validate/v1/validate.proto",
}

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

Functions

func RegisterValidateServiceHandler

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

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

func RegisterValidateServiceHandlerClient

func RegisterValidateServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ValidateServiceClient) error

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

func RegisterValidateServiceHandlerFromEndpoint

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

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

func RegisterValidateServiceHandlerServer

func RegisterValidateServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ValidateServiceServer) error

RegisterValidateServiceHandlerServer registers the http handlers for service ValidateService to "mux". UnaryRPC :call ValidateServiceServer 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 RegisterValidateServiceHandlerFromEndpoint instead.

func RegisterValidateServiceServer

func RegisterValidateServiceServer(s grpc.ServiceRegistrar, srv ValidateServiceServer)

Types

type CheckRequest

type CheckRequest struct {
	Validations []*Validation `protobuf:"bytes,1,rep,name=validations,proto3" json:"validations,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckRequest) Descriptor deprecated

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

Deprecated: Use CheckRequest.ProtoReflect.Descriptor instead.

func (*CheckRequest) GetValidations

func (x *CheckRequest) GetValidations() []*Validation

func (*CheckRequest) ProtoMessage

func (*CheckRequest) ProtoMessage()

func (*CheckRequest) ProtoReflect

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

func (*CheckRequest) Reset

func (x *CheckRequest) Reset()

func (*CheckRequest) String

func (x *CheckRequest) String() string

type CheckResponse

type CheckResponse struct {
	Results []*ValidationResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
	// contains filtered or unexported fields
}

func (*CheckResponse) Descriptor deprecated

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

Deprecated: Use CheckResponse.ProtoReflect.Descriptor instead.

func (*CheckResponse) GetResults

func (x *CheckResponse) GetResults() []*ValidationResult

func (*CheckResponse) ProtoMessage

func (*CheckResponse) ProtoMessage()

func (*CheckResponse) ProtoReflect

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

func (*CheckResponse) Reset

func (x *CheckResponse) Reset()

func (*CheckResponse) String

func (x *CheckResponse) String() string

type UnimplementedValidateServiceServer

type UnimplementedValidateServiceServer struct {
}

UnimplementedValidateServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedValidateServiceServer) Check

type UnsafeValidateServiceServer

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

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

type ValidateServiceClient

type ValidateServiceClient interface {
	Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
}

ValidateServiceClient is the client API for ValidateService 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 ValidateServiceServer

type ValidateServiceServer interface {
	Check(context.Context, *CheckRequest) (*CheckResponse, error)
	// contains filtered or unexported methods
}

ValidateServiceServer is the server API for ValidateService service. All implementations must embed UnimplementedValidateServiceServer for forward compatibility

type Validation

type Validation struct {
	Id        string                `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Variables map[string]*anypb.Any `` /* 159-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Validation) Descriptor deprecated

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

Deprecated: Use Validation.ProtoReflect.Descriptor instead.

func (*Validation) GetId

func (x *Validation) GetId() string

func (*Validation) GetVariables

func (x *Validation) GetVariables() map[string]*anypb.Any

func (*Validation) ProtoMessage

func (*Validation) ProtoMessage()

func (*Validation) ProtoReflect

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

func (*Validation) Reset

func (x *Validation) Reset()

func (*Validation) String

func (x *Validation) String() string

type ValidationResult

type ValidationResult struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	IsValid bool   `protobuf:"varint,2,opt,name=is_valid,json=isValid,proto3" json:"is_valid,omitempty"`
	Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*ValidationResult) Descriptor deprecated

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

Deprecated: Use ValidationResult.ProtoReflect.Descriptor instead.

func (*ValidationResult) GetId

func (x *ValidationResult) GetId() string

func (*ValidationResult) GetIsValid

func (x *ValidationResult) GetIsValid() bool

func (*ValidationResult) GetMessage

func (x *ValidationResult) GetMessage() string

func (*ValidationResult) ProtoMessage

func (*ValidationResult) ProtoMessage()

func (*ValidationResult) ProtoReflect

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

func (*ValidationResult) Reset

func (x *ValidationResult) Reset()

func (*ValidationResult) String

func (x *ValidationResult) String() string

Jump to

Keyboard shortcuts

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