Documentation ¶
Overview ¶
Package endpoint is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterEndpointHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterEndpointHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EndpointClient) error
- func RegisterEndpointHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterEndpointHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EndpointServer) error
- func RegisterEndpointServer(s grpc.ServiceRegistrar, srv EndpointServer)
- type EndpointClient
- type EndpointServer
- type InNamespaceRequest
- func (*InNamespaceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *InNamespaceRequest) GetNamespaceId() int32
- func (*InNamespaceRequest) ProtoMessage()
- func (x *InNamespaceRequest) ProtoReflect() protoreflect.Message
- func (x *InNamespaceRequest) Reset()
- func (x *InNamespaceRequest) String() string
- func (m *InNamespaceRequest) Validate() error
- func (m *InNamespaceRequest) ValidateAll() error
- type InNamespaceRequestMultiError
- type InNamespaceRequestValidationError
- func (e InNamespaceRequestValidationError) Cause() error
- func (e InNamespaceRequestValidationError) Error() string
- func (e InNamespaceRequestValidationError) ErrorName() string
- func (e InNamespaceRequestValidationError) Field() string
- func (e InNamespaceRequestValidationError) Key() bool
- func (e InNamespaceRequestValidationError) Reason() string
- type InNamespaceResponse
- func (*InNamespaceResponse) Descriptor() ([]byte, []int)deprecated
- func (x *InNamespaceResponse) GetItems() []*types.ServiceEndpoint
- func (*InNamespaceResponse) ProtoMessage()
- func (x *InNamespaceResponse) ProtoReflect() protoreflect.Message
- func (x *InNamespaceResponse) Reset()
- func (x *InNamespaceResponse) String() string
- func (m *InNamespaceResponse) Validate() error
- func (m *InNamespaceResponse) ValidateAll() error
- type InNamespaceResponseMultiError
- type InNamespaceResponseValidationError
- func (e InNamespaceResponseValidationError) Cause() error
- func (e InNamespaceResponseValidationError) Error() string
- func (e InNamespaceResponseValidationError) ErrorName() string
- func (e InNamespaceResponseValidationError) Field() string
- func (e InNamespaceResponseValidationError) Key() bool
- func (e InNamespaceResponseValidationError) Reason() string
- type InProjectRequest
- func (*InProjectRequest) Descriptor() ([]byte, []int)deprecated
- func (x *InProjectRequest) GetProjectId() int32
- func (*InProjectRequest) ProtoMessage()
- func (x *InProjectRequest) ProtoReflect() protoreflect.Message
- func (x *InProjectRequest) Reset()
- func (x *InProjectRequest) String() string
- func (m *InProjectRequest) Validate() error
- func (m *InProjectRequest) ValidateAll() error
- type InProjectRequestMultiError
- type InProjectRequestValidationError
- func (e InProjectRequestValidationError) Cause() error
- func (e InProjectRequestValidationError) Error() string
- func (e InProjectRequestValidationError) ErrorName() string
- func (e InProjectRequestValidationError) Field() string
- func (e InProjectRequestValidationError) Key() bool
- func (e InProjectRequestValidationError) Reason() string
- type InProjectResponse
- func (*InProjectResponse) Descriptor() ([]byte, []int)deprecated
- func (x *InProjectResponse) GetItems() []*types.ServiceEndpoint
- func (*InProjectResponse) ProtoMessage()
- func (x *InProjectResponse) ProtoReflect() protoreflect.Message
- func (x *InProjectResponse) Reset()
- func (x *InProjectResponse) String() string
- func (m *InProjectResponse) Validate() error
- func (m *InProjectResponse) ValidateAll() error
- type InProjectResponseMultiError
- type InProjectResponseValidationError
- func (e InProjectResponseValidationError) Cause() error
- func (e InProjectResponseValidationError) Error() string
- func (e InProjectResponseValidationError) ErrorName() string
- func (e InProjectResponseValidationError) Field() string
- func (e InProjectResponseValidationError) Key() bool
- func (e InProjectResponseValidationError) Reason() string
- type UnimplementedEndpointServer
- type UnsafeEndpointServer
Constants ¶
const ( Endpoint_InNamespace_FullMethodName = "/endpoint.Endpoint/InNamespace" Endpoint_InProject_FullMethodName = "/endpoint.Endpoint/InProject" )
Variables ¶
var Endpoint_ServiceDesc = grpc.ServiceDesc{ ServiceName: "endpoint.Endpoint", HandlerType: (*EndpointServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "InNamespace", Handler: _Endpoint_InNamespace_Handler, }, { MethodName: "InProject", Handler: _Endpoint_InProject_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "endpoint/endpoint.proto", }
Endpoint_ServiceDesc is the grpc.ServiceDesc for Endpoint service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_endpoint_endpoint_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEndpointHandler ¶
func RegisterEndpointHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterEndpointHandler registers the http handlers for service Endpoint to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterEndpointHandlerClient ¶
func RegisterEndpointHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EndpointClient) error
RegisterEndpointHandlerClient registers the http handlers for service Endpoint to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EndpointClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EndpointClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "EndpointClient" to call the correct interceptors.
func RegisterEndpointHandlerFromEndpoint ¶
func RegisterEndpointHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterEndpointHandlerFromEndpoint is same as RegisterEndpointHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterEndpointHandlerServer ¶
func RegisterEndpointHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EndpointServer) error
RegisterEndpointHandlerServer registers the http handlers for service Endpoint to "mux". UnaryRPC :call EndpointServer 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 RegisterEndpointHandlerFromEndpoint instead.
func RegisterEndpointServer ¶
func RegisterEndpointServer(s grpc.ServiceRegistrar, srv EndpointServer)
Types ¶
type EndpointClient ¶
type EndpointClient interface { InNamespace(ctx context.Context, in *InNamespaceRequest, opts ...grpc.CallOption) (*InNamespaceResponse, error) InProject(ctx context.Context, in *InProjectRequest, opts ...grpc.CallOption) (*InProjectResponse, error) }
EndpointClient is the client API for Endpoint 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 NewEndpointClient ¶
func NewEndpointClient(cc grpc.ClientConnInterface) EndpointClient
type EndpointServer ¶
type EndpointServer interface { InNamespace(context.Context, *InNamespaceRequest) (*InNamespaceResponse, error) InProject(context.Context, *InProjectRequest) (*InProjectResponse, error) // contains filtered or unexported methods }
EndpointServer is the server API for Endpoint service. All implementations must embed UnimplementedEndpointServer for forward compatibility
type InNamespaceRequest ¶
type InNamespaceRequest struct { NamespaceId int32 `protobuf:"varint,1,opt,name=namespace_id,json=namespaceId,proto3" json:"namespace_id,omitempty"` // contains filtered or unexported fields }
func (*InNamespaceRequest) Descriptor
deprecated
func (*InNamespaceRequest) Descriptor() ([]byte, []int)
Deprecated: Use InNamespaceRequest.ProtoReflect.Descriptor instead.
func (*InNamespaceRequest) GetNamespaceId ¶
func (x *InNamespaceRequest) GetNamespaceId() int32
func (*InNamespaceRequest) ProtoMessage ¶
func (*InNamespaceRequest) ProtoMessage()
func (*InNamespaceRequest) ProtoReflect ¶
func (x *InNamespaceRequest) ProtoReflect() protoreflect.Message
func (*InNamespaceRequest) Reset ¶
func (x *InNamespaceRequest) Reset()
func (*InNamespaceRequest) String ¶
func (x *InNamespaceRequest) String() string
func (*InNamespaceRequest) Validate ¶
func (m *InNamespaceRequest) Validate() error
Validate checks the field values on InNamespaceRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*InNamespaceRequest) ValidateAll ¶
func (m *InNamespaceRequest) ValidateAll() error
ValidateAll checks the field values on InNamespaceRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in InNamespaceRequestMultiError, or nil if none found.
type InNamespaceRequestMultiError ¶
type InNamespaceRequestMultiError []error
InNamespaceRequestMultiError is an error wrapping multiple validation errors returned by InNamespaceRequest.ValidateAll() if the designated constraints aren't met.
func (InNamespaceRequestMultiError) AllErrors ¶
func (m InNamespaceRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (InNamespaceRequestMultiError) Error ¶
func (m InNamespaceRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type InNamespaceRequestValidationError ¶
type InNamespaceRequestValidationError struct {
// contains filtered or unexported fields
}
InNamespaceRequestValidationError is the validation error returned by InNamespaceRequest.Validate if the designated constraints aren't met.
func (InNamespaceRequestValidationError) Cause ¶
func (e InNamespaceRequestValidationError) Cause() error
Cause function returns cause value.
func (InNamespaceRequestValidationError) Error ¶
func (e InNamespaceRequestValidationError) Error() string
Error satisfies the builtin error interface
func (InNamespaceRequestValidationError) ErrorName ¶
func (e InNamespaceRequestValidationError) ErrorName() string
ErrorName returns error name.
func (InNamespaceRequestValidationError) Field ¶
func (e InNamespaceRequestValidationError) Field() string
Field function returns field value.
func (InNamespaceRequestValidationError) Key ¶
func (e InNamespaceRequestValidationError) Key() bool
Key function returns key value.
func (InNamespaceRequestValidationError) Reason ¶
func (e InNamespaceRequestValidationError) Reason() string
Reason function returns reason value.
type InNamespaceResponse ¶
type InNamespaceResponse struct { Items []*types.ServiceEndpoint `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func (*InNamespaceResponse) Descriptor
deprecated
func (*InNamespaceResponse) Descriptor() ([]byte, []int)
Deprecated: Use InNamespaceResponse.ProtoReflect.Descriptor instead.
func (*InNamespaceResponse) GetItems ¶
func (x *InNamespaceResponse) GetItems() []*types.ServiceEndpoint
func (*InNamespaceResponse) ProtoMessage ¶
func (*InNamespaceResponse) ProtoMessage()
func (*InNamespaceResponse) ProtoReflect ¶
func (x *InNamespaceResponse) ProtoReflect() protoreflect.Message
func (*InNamespaceResponse) Reset ¶
func (x *InNamespaceResponse) Reset()
func (*InNamespaceResponse) String ¶
func (x *InNamespaceResponse) String() string
func (*InNamespaceResponse) Validate ¶
func (m *InNamespaceResponse) Validate() error
Validate checks the field values on InNamespaceResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*InNamespaceResponse) ValidateAll ¶
func (m *InNamespaceResponse) ValidateAll() error
ValidateAll checks the field values on InNamespaceResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in InNamespaceResponseMultiError, or nil if none found.
type InNamespaceResponseMultiError ¶
type InNamespaceResponseMultiError []error
InNamespaceResponseMultiError is an error wrapping multiple validation errors returned by InNamespaceResponse.ValidateAll() if the designated constraints aren't met.
func (InNamespaceResponseMultiError) AllErrors ¶
func (m InNamespaceResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (InNamespaceResponseMultiError) Error ¶
func (m InNamespaceResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type InNamespaceResponseValidationError ¶
type InNamespaceResponseValidationError struct {
// contains filtered or unexported fields
}
InNamespaceResponseValidationError is the validation error returned by InNamespaceResponse.Validate if the designated constraints aren't met.
func (InNamespaceResponseValidationError) Cause ¶
func (e InNamespaceResponseValidationError) Cause() error
Cause function returns cause value.
func (InNamespaceResponseValidationError) Error ¶
func (e InNamespaceResponseValidationError) Error() string
Error satisfies the builtin error interface
func (InNamespaceResponseValidationError) ErrorName ¶
func (e InNamespaceResponseValidationError) ErrorName() string
ErrorName returns error name.
func (InNamespaceResponseValidationError) Field ¶
func (e InNamespaceResponseValidationError) Field() string
Field function returns field value.
func (InNamespaceResponseValidationError) Key ¶
func (e InNamespaceResponseValidationError) Key() bool
Key function returns key value.
func (InNamespaceResponseValidationError) Reason ¶
func (e InNamespaceResponseValidationError) Reason() string
Reason function returns reason value.
type InProjectRequest ¶
type InProjectRequest struct { ProjectId int32 `protobuf:"varint,1,opt,name=project_id,json=projectId,proto3" json:"project_id,omitempty"` // contains filtered or unexported fields }
func (*InProjectRequest) Descriptor
deprecated
func (*InProjectRequest) Descriptor() ([]byte, []int)
Deprecated: Use InProjectRequest.ProtoReflect.Descriptor instead.
func (*InProjectRequest) GetProjectId ¶
func (x *InProjectRequest) GetProjectId() int32
func (*InProjectRequest) ProtoMessage ¶
func (*InProjectRequest) ProtoMessage()
func (*InProjectRequest) ProtoReflect ¶
func (x *InProjectRequest) ProtoReflect() protoreflect.Message
func (*InProjectRequest) Reset ¶
func (x *InProjectRequest) Reset()
func (*InProjectRequest) String ¶
func (x *InProjectRequest) String() string
func (*InProjectRequest) Validate ¶
func (m *InProjectRequest) Validate() error
Validate checks the field values on InProjectRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*InProjectRequest) ValidateAll ¶
func (m *InProjectRequest) ValidateAll() error
ValidateAll checks the field values on InProjectRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in InProjectRequestMultiError, or nil if none found.
type InProjectRequestMultiError ¶
type InProjectRequestMultiError []error
InProjectRequestMultiError is an error wrapping multiple validation errors returned by InProjectRequest.ValidateAll() if the designated constraints aren't met.
func (InProjectRequestMultiError) AllErrors ¶
func (m InProjectRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (InProjectRequestMultiError) Error ¶
func (m InProjectRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type InProjectRequestValidationError ¶
type InProjectRequestValidationError struct {
// contains filtered or unexported fields
}
InProjectRequestValidationError is the validation error returned by InProjectRequest.Validate if the designated constraints aren't met.
func (InProjectRequestValidationError) Cause ¶
func (e InProjectRequestValidationError) Cause() error
Cause function returns cause value.
func (InProjectRequestValidationError) Error ¶
func (e InProjectRequestValidationError) Error() string
Error satisfies the builtin error interface
func (InProjectRequestValidationError) ErrorName ¶
func (e InProjectRequestValidationError) ErrorName() string
ErrorName returns error name.
func (InProjectRequestValidationError) Field ¶
func (e InProjectRequestValidationError) Field() string
Field function returns field value.
func (InProjectRequestValidationError) Key ¶
func (e InProjectRequestValidationError) Key() bool
Key function returns key value.
func (InProjectRequestValidationError) Reason ¶
func (e InProjectRequestValidationError) Reason() string
Reason function returns reason value.
type InProjectResponse ¶
type InProjectResponse struct { Items []*types.ServiceEndpoint `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func (*InProjectResponse) Descriptor
deprecated
func (*InProjectResponse) Descriptor() ([]byte, []int)
Deprecated: Use InProjectResponse.ProtoReflect.Descriptor instead.
func (*InProjectResponse) GetItems ¶
func (x *InProjectResponse) GetItems() []*types.ServiceEndpoint
func (*InProjectResponse) ProtoMessage ¶
func (*InProjectResponse) ProtoMessage()
func (*InProjectResponse) ProtoReflect ¶
func (x *InProjectResponse) ProtoReflect() protoreflect.Message
func (*InProjectResponse) Reset ¶
func (x *InProjectResponse) Reset()
func (*InProjectResponse) String ¶
func (x *InProjectResponse) String() string
func (*InProjectResponse) Validate ¶
func (m *InProjectResponse) Validate() error
Validate checks the field values on InProjectResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*InProjectResponse) ValidateAll ¶
func (m *InProjectResponse) ValidateAll() error
ValidateAll checks the field values on InProjectResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in InProjectResponseMultiError, or nil if none found.
type InProjectResponseMultiError ¶
type InProjectResponseMultiError []error
InProjectResponseMultiError is an error wrapping multiple validation errors returned by InProjectResponse.ValidateAll() if the designated constraints aren't met.
func (InProjectResponseMultiError) AllErrors ¶
func (m InProjectResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (InProjectResponseMultiError) Error ¶
func (m InProjectResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type InProjectResponseValidationError ¶
type InProjectResponseValidationError struct {
// contains filtered or unexported fields
}
InProjectResponseValidationError is the validation error returned by InProjectResponse.Validate if the designated constraints aren't met.
func (InProjectResponseValidationError) Cause ¶
func (e InProjectResponseValidationError) Cause() error
Cause function returns cause value.
func (InProjectResponseValidationError) Error ¶
func (e InProjectResponseValidationError) Error() string
Error satisfies the builtin error interface
func (InProjectResponseValidationError) ErrorName ¶
func (e InProjectResponseValidationError) ErrorName() string
ErrorName returns error name.
func (InProjectResponseValidationError) Field ¶
func (e InProjectResponseValidationError) Field() string
Field function returns field value.
func (InProjectResponseValidationError) Key ¶
func (e InProjectResponseValidationError) Key() bool
Key function returns key value.
func (InProjectResponseValidationError) Reason ¶
func (e InProjectResponseValidationError) Reason() string
Reason function returns reason value.
type UnimplementedEndpointServer ¶
type UnimplementedEndpointServer struct { }
UnimplementedEndpointServer must be embedded to have forward compatible implementations.
func (UnimplementedEndpointServer) InNamespace ¶
func (UnimplementedEndpointServer) InNamespace(context.Context, *InNamespaceRequest) (*InNamespaceResponse, error)
func (UnimplementedEndpointServer) InProject ¶
func (UnimplementedEndpointServer) InProject(context.Context, *InProjectRequest) (*InProjectResponse, error)
type UnsafeEndpointServer ¶
type UnsafeEndpointServer interface {
// contains filtered or unexported methods
}
UnsafeEndpointServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EndpointServer will result in compilation errors.