discovery

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Overview

Package discovery is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

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

View Source
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.ClientConnInterface) 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"`
	// 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) 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"`
	// 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) 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) Start

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.

Jump to

Keyboard shortcuts

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