discovery

package
v0.8.63 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package discovery is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Discovery_OPADiscovery_FullMethodName = "/aserto.discovery.policy.v1.Discovery/OPADiscovery"
)

Variables

View Source
var Discovery_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "aserto.discovery.policy.v1.Discovery",
	HandlerType: (*DiscoveryServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "OPADiscovery",
			Handler:    _Discovery_OPADiscovery_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "aserto/discovery/v1/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_aserto_discovery_v1_discovery_proto protoreflect.FileDescriptor

Functions

func RegisterDiscoveryHandler

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

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

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

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 DiscoveryClient

type DiscoveryClient interface {
	OPADiscovery(ctx context.Context, in *OPADiscoveryRequest, opts ...grpc.CallOption) (*OPADiscoveryResponse, 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 {
	OPADiscovery(context.Context, *OPADiscoveryRequest) (*OPADiscoveryResponse, error)
}

DiscoveryServer is the server API for Discovery service. All implementations should embed UnimplementedDiscoveryServer for forward compatibility

type OPAConfig

type OPAConfig struct {
	Discovery *structpb.Struct `protobuf:"bytes,1,opt,name=discovery,proto3" json:"discovery,omitempty"`
	// contains filtered or unexported fields
}

func (*OPAConfig) Descriptor deprecated

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

Deprecated: Use OPAConfig.ProtoReflect.Descriptor instead.

func (*OPAConfig) GetDiscovery

func (x *OPAConfig) GetDiscovery() *structpb.Struct

func (*OPAConfig) ProtoMessage

func (*OPAConfig) ProtoMessage()

func (*OPAConfig) ProtoReflect

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

func (*OPAConfig) Reset

func (x *OPAConfig) Reset()

func (*OPAConfig) String

func (x *OPAConfig) String() string

type OPADiscoveryRequest

type OPADiscoveryRequest struct {
	PolicyId string `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3" json:"policy_id,omitempty"`
	UseTags  string `protobuf:"bytes,2,opt,name=use_tags,json=useTags,proto3" json:"use_tags,omitempty"`
	// contains filtered or unexported fields
}

func (*OPADiscoveryRequest) Descriptor deprecated

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

Deprecated: Use OPADiscoveryRequest.ProtoReflect.Descriptor instead.

func (*OPADiscoveryRequest) GetPolicyId

func (x *OPADiscoveryRequest) GetPolicyId() string

func (*OPADiscoveryRequest) GetUseTags

func (x *OPADiscoveryRequest) GetUseTags() string

func (*OPADiscoveryRequest) ProtoMessage

func (*OPADiscoveryRequest) ProtoMessage()

func (*OPADiscoveryRequest) ProtoReflect

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

func (*OPADiscoveryRequest) Reset

func (x *OPADiscoveryRequest) Reset()

func (*OPADiscoveryRequest) String

func (x *OPADiscoveryRequest) String() string

type OPADiscoveryResponse

type OPADiscoveryResponse struct {
	Opa *OPAConfig `protobuf:"bytes,1,opt,name=opa,proto3" json:"opa,omitempty"`
	// contains filtered or unexported fields
}

func (*OPADiscoveryResponse) Descriptor deprecated

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

Deprecated: Use OPADiscoveryResponse.ProtoReflect.Descriptor instead.

func (*OPADiscoveryResponse) GetOpa

func (x *OPADiscoveryResponse) GetOpa() *OPAConfig

func (*OPADiscoveryResponse) ProtoMessage

func (*OPADiscoveryResponse) ProtoMessage()

func (*OPADiscoveryResponse) ProtoReflect

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

func (*OPADiscoveryResponse) Reset

func (x *OPADiscoveryResponse) Reset()

func (*OPADiscoveryResponse) String

func (x *OPADiscoveryResponse) String() string

type UnimplementedDiscoveryServer

type UnimplementedDiscoveryServer struct {
}

UnimplementedDiscoveryServer should be embedded to have forward compatible implementations.

func (UnimplementedDiscoveryServer) OPADiscovery

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