endpoint

package
v4.25.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Overview

Package endpoint is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Endpoint_InNamespace_FullMethodName = "/endpoint.Endpoint/InNamespace"
	Endpoint_InProject_FullMethodName   = "/endpoint.Endpoint/InProject"
)

Variables

View Source
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)

View Source
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 名称空间下所有的 endpoints
	InNamespace(ctx context.Context, in *InNamespaceRequest, opts ...grpc.CallOption) (*InNamespaceResponse, error)
	// InProject 项目下所有的 endpoints
	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 名称空间下所有的 endpoints
	InNamespace(context.Context, *InNamespaceRequest) (*InNamespaceResponse, error)
	// InProject 项目下所有的 endpoints
	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 int64 `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() int64

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

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

Cause function returns cause value.

func (InNamespaceRequestValidationError) Error

Error satisfies the builtin error interface

func (InNamespaceRequestValidationError) ErrorName

ErrorName returns error name.

func (InNamespaceRequestValidationError) Field

Field function returns field value.

func (InNamespaceRequestValidationError) Key

Key function returns key value.

func (InNamespaceRequestValidationError) Reason

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

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

Cause function returns cause value.

func (InNamespaceResponseValidationError) Error

Error satisfies the builtin error interface

func (InNamespaceResponseValidationError) ErrorName

ErrorName returns error name.

func (InNamespaceResponseValidationError) Field

Field function returns field value.

func (InNamespaceResponseValidationError) Key

Key function returns key value.

func (InNamespaceResponseValidationError) Reason

Reason function returns reason value.

type InProjectRequest

type InProjectRequest struct {
	ProjectId int64 `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() int64

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

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

Cause function returns cause value.

func (InProjectRequestValidationError) Error

Error satisfies the builtin error interface

func (InProjectRequestValidationError) ErrorName

ErrorName returns error name.

func (InProjectRequestValidationError) Field

Field function returns field value.

func (InProjectRequestValidationError) Key

Key function returns key value.

func (InProjectRequestValidationError) Reason

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

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

Cause function returns cause value.

func (InProjectResponseValidationError) Error

Error satisfies the builtin error interface

func (InProjectResponseValidationError) ErrorName

ErrorName returns error name.

func (InProjectResponseValidationError) Field

Field function returns field value.

func (InProjectResponseValidationError) Key

Key function returns key value.

func (InProjectResponseValidationError) Reason

Reason function returns reason value.

type UnimplementedEndpointServer

type UnimplementedEndpointServer struct {
}

UnimplementedEndpointServer must be embedded to have forward compatible implementations.

func (UnimplementedEndpointServer) InNamespace

func (UnimplementedEndpointServer) InProject

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.

Jump to

Keyboard shortcuts

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