Documentation ¶
Overview ¶
Package discovery is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterDiscoveryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterDiscoveryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DiscoveryClient) error
- func RegisterDiscoveryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterDiscoveryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DiscoveryServer) error
- func RegisterDiscoveryServer(s grpc.ServiceRegistrar, srv DiscoveryServer)
- type Authorizer
- type Discoverer
- type DiscoveryClient
- type DiscoveryServer
- type QueryRequest
- func (*QueryRequest) Descriptor() ([]byte, []int)deprecated
- func (x *QueryRequest) GetFilteredType() string
- func (x *QueryRequest) GetPageSize() int32
- func (x *QueryRequest) GetPageToken() string
- func (*QueryRequest) ProtoMessage()
- func (x *QueryRequest) ProtoReflect() protoreflect.Message
- func (x *QueryRequest) Reset()
- func (x *QueryRequest) String() string
- type QueryResponse
- func (*QueryResponse) Descriptor() ([]byte, []int)deprecated
- func (x *QueryResponse) GetNextPageToken() string
- func (x *QueryResponse) GetResults() *structpb.ListValue
- func (*QueryResponse) ProtoMessage()
- func (x *QueryResponse) ProtoReflect() protoreflect.Message
- func (x *QueryResponse) Reset()
- func (x *QueryResponse) String() string
- type StartDiscoveryRequest
- type StartDiscoveryResponse
- func (*StartDiscoveryResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StartDiscoveryResponse) GetSuccessful() bool
- func (*StartDiscoveryResponse) ProtoMessage()
- func (x *StartDiscoveryResponse) ProtoReflect() protoreflect.Message
- func (x *StartDiscoveryResponse) Reset()
- func (x *StartDiscoveryResponse) String() string
- type UnimplementedDiscoveryServer
- type UnsafeDiscoveryServer
Constants ¶
This section is empty.
Variables ¶
var Discovery_ServiceDesc = grpc.ServiceDesc{ ServiceName: "clouditor.Discovery", HandlerType: (*DiscoveryServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Start", Handler: _Discovery_Start_Handler, }, { MethodName: "Query", Handler: _Discovery_Query_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/discovery/discovery.proto", }
Discovery_ServiceDesc is the grpc.ServiceDesc for Discovery service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_api_discovery_discovery_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDiscoveryHandler ¶ added in v1.3.1
func RegisterDiscoveryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterDiscoveryHandler registers the http handlers for service Discovery to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterDiscoveryHandlerClient ¶ added in v1.3.1
func RegisterDiscoveryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DiscoveryClient) error
RegisterDiscoveryHandlerClient registers the http handlers for service Discovery to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DiscoveryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DiscoveryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "DiscoveryClient" to call the correct interceptors.
func RegisterDiscoveryHandlerFromEndpoint ¶ added in v1.3.1
func RegisterDiscoveryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterDiscoveryHandlerFromEndpoint is same as RegisterDiscoveryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterDiscoveryHandlerServer ¶ added in v1.3.1
func RegisterDiscoveryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DiscoveryServer) error
RegisterDiscoveryHandlerServer registers the http handlers for service Discovery to "mux". UnaryRPC :call DiscoveryServer 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 RegisterDiscoveryHandlerFromEndpoint instead.
func RegisterDiscoveryServer ¶
func RegisterDiscoveryServer(s grpc.ServiceRegistrar, srv DiscoveryServer)
Types ¶
type Authorizer ¶ added in v1.3.3
type Authorizer interface {
Authorize() (err error)
}
Authorizer authorizes a Cloud service
type Discoverer ¶ added in v1.3.2
type Discoverer interface { Name() string List() ([]voc.IsCloudResource, error) }
type DiscoveryClient ¶
type DiscoveryClient interface { // Starts discovering the cloud resources, exposed as REST. Start(ctx context.Context, in *StartDiscoveryRequest, opts ...grpc.CallOption) (*StartDiscoveryResponse, error) // Lists all evidences collected in the last run, exposed as REST. Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) }
DiscoveryClient is the client API for Discovery 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 NewDiscoveryClient ¶
func NewDiscoveryClient(cc grpc.ClientConnInterface) DiscoveryClient
type DiscoveryServer ¶
type DiscoveryServer interface { // Starts discovering the cloud resources, exposed as REST. Start(context.Context, *StartDiscoveryRequest) (*StartDiscoveryResponse, error) // Lists all evidences collected in the last run, exposed as REST. Query(context.Context, *QueryRequest) (*QueryResponse, error) // contains filtered or unexported methods }
DiscoveryServer is the server API for Discovery service. All implementations must embed UnimplementedDiscoveryServer for forward compatibility
type QueryRequest ¶ added in v1.3.5
type QueryRequest struct { FilteredType string `protobuf:"bytes,1,opt,name=filtered_type,json=filteredType,proto3" json:"filtered_type,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // contains filtered or unexported fields }
func (*QueryRequest) Descriptor
deprecated
added in
v1.3.5
func (*QueryRequest) Descriptor() ([]byte, []int)
Deprecated: Use QueryRequest.ProtoReflect.Descriptor instead.
func (*QueryRequest) GetFilteredType ¶ added in v1.3.5
func (x *QueryRequest) GetFilteredType() string
func (*QueryRequest) GetPageSize ¶ added in v1.4.6
func (x *QueryRequest) GetPageSize() int32
func (*QueryRequest) GetPageToken ¶ added in v1.4.6
func (x *QueryRequest) GetPageToken() string
func (*QueryRequest) ProtoMessage ¶ added in v1.3.5
func (*QueryRequest) ProtoMessage()
func (*QueryRequest) ProtoReflect ¶ added in v1.3.5
func (x *QueryRequest) ProtoReflect() protoreflect.Message
func (*QueryRequest) Reset ¶ added in v1.3.5
func (x *QueryRequest) Reset()
func (*QueryRequest) String ¶ added in v1.3.5
func (x *QueryRequest) String() string
type QueryResponse ¶ added in v1.3.2
type QueryResponse struct { Results *structpb.ListValue `protobuf:"bytes,1,opt,name=results,proto3" json:"results,omitempty"` NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` // contains filtered or unexported fields }
func (*QueryResponse) Descriptor
deprecated
added in
v1.3.2
func (*QueryResponse) Descriptor() ([]byte, []int)
Deprecated: Use QueryResponse.ProtoReflect.Descriptor instead.
func (*QueryResponse) GetNextPageToken ¶ added in v1.4.6
func (x *QueryResponse) GetNextPageToken() string
func (*QueryResponse) GetResults ¶ added in v1.3.7
func (x *QueryResponse) GetResults() *structpb.ListValue
func (*QueryResponse) ProtoMessage ¶ added in v1.3.2
func (*QueryResponse) ProtoMessage()
func (*QueryResponse) ProtoReflect ¶ added in v1.3.2
func (x *QueryResponse) ProtoReflect() protoreflect.Message
func (*QueryResponse) Reset ¶ added in v1.3.2
func (x *QueryResponse) Reset()
func (*QueryResponse) String ¶ added in v1.3.2
func (x *QueryResponse) String() string
type StartDiscoveryRequest ¶
type StartDiscoveryRequest struct {
// contains filtered or unexported fields
}
func (*StartDiscoveryRequest) Descriptor
deprecated
func (*StartDiscoveryRequest) Descriptor() ([]byte, []int)
Deprecated: Use StartDiscoveryRequest.ProtoReflect.Descriptor instead.
func (*StartDiscoveryRequest) ProtoMessage ¶
func (*StartDiscoveryRequest) ProtoMessage()
func (*StartDiscoveryRequest) ProtoReflect ¶
func (x *StartDiscoveryRequest) ProtoReflect() protoreflect.Message
func (*StartDiscoveryRequest) Reset ¶
func (x *StartDiscoveryRequest) Reset()
func (*StartDiscoveryRequest) String ¶
func (x *StartDiscoveryRequest) String() string
type StartDiscoveryResponse ¶
type StartDiscoveryResponse struct { Successful bool `protobuf:"varint,1,opt,name=successful,proto3" json:"successful,omitempty"` // contains filtered or unexported fields }
func (*StartDiscoveryResponse) Descriptor
deprecated
func (*StartDiscoveryResponse) Descriptor() ([]byte, []int)
Deprecated: Use StartDiscoveryResponse.ProtoReflect.Descriptor instead.
func (*StartDiscoveryResponse) GetSuccessful ¶
func (x *StartDiscoveryResponse) GetSuccessful() bool
func (*StartDiscoveryResponse) ProtoMessage ¶
func (*StartDiscoveryResponse) ProtoMessage()
func (*StartDiscoveryResponse) ProtoReflect ¶
func (x *StartDiscoveryResponse) ProtoReflect() protoreflect.Message
func (*StartDiscoveryResponse) Reset ¶
func (x *StartDiscoveryResponse) Reset()
func (*StartDiscoveryResponse) String ¶
func (x *StartDiscoveryResponse) String() string
type UnimplementedDiscoveryServer ¶
type UnimplementedDiscoveryServer struct { }
UnimplementedDiscoveryServer must be embedded to have forward compatible implementations.
func (UnimplementedDiscoveryServer) Query ¶ added in v1.3.2
func (UnimplementedDiscoveryServer) Query(context.Context, *QueryRequest) (*QueryResponse, error)
func (UnimplementedDiscoveryServer) Start ¶
func (UnimplementedDiscoveryServer) Start(context.Context, *StartDiscoveryRequest) (*StartDiscoveryResponse, error)
type UnsafeDiscoveryServer ¶
type UnsafeDiscoveryServer interface {
// contains filtered or unexported methods
}
UnsafeDiscoveryServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DiscoveryServer will result in compilation errors.