Documentation ¶
Overview ¶
Package discovery is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- 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 DiscoveryClient
- type DiscoveryServer
- type OPAConfig
- type OPAInstanceDiscoveryRequest
- func (*OPAInstanceDiscoveryRequest) Descriptor() ([]byte, []int)deprecated
- func (x *OPAInstanceDiscoveryRequest) GetInstanceLabel() string
- func (x *OPAInstanceDiscoveryRequest) GetPolicyName() string
- func (*OPAInstanceDiscoveryRequest) ProtoMessage()
- func (x *OPAInstanceDiscoveryRequest) ProtoReflect() protoreflect.Message
- func (x *OPAInstanceDiscoveryRequest) Reset()
- func (x *OPAInstanceDiscoveryRequest) String() string
- type OPAInstanceDiscoveryResponse
- func (*OPAInstanceDiscoveryResponse) Descriptor() ([]byte, []int)deprecated
- func (x *OPAInstanceDiscoveryResponse) GetOpa() *OPAConfig
- func (*OPAInstanceDiscoveryResponse) ProtoMessage()
- func (x *OPAInstanceDiscoveryResponse) ProtoReflect() protoreflect.Message
- func (x *OPAInstanceDiscoveryResponse) Reset()
- func (x *OPAInstanceDiscoveryResponse) String() string
- type UnimplementedDiscoveryServer
- type UnsafeDiscoveryServer
Constants ¶
const (
Discovery_OPAInstanceDiscovery_FullMethodName = "/aserto.discovery.policy.v2.Discovery/OPAInstanceDiscovery"
)
Variables ¶
var Discovery_ServiceDesc = grpc.ServiceDesc{ ServiceName: "aserto.discovery.policy.v2.Discovery", HandlerType: (*DiscoveryServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "OPAInstanceDiscovery", Handler: _Discovery_OPAInstanceDiscovery_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "aserto/discovery/v2/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_aserto_discovery_v2_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 {
OPAInstanceDiscovery(ctx context.Context, in *OPAInstanceDiscoveryRequest, opts ...grpc.CallOption) (*OPAInstanceDiscoveryResponse, 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 {
OPAInstanceDiscovery(context.Context, *OPAInstanceDiscoveryRequest) (*OPAInstanceDiscoveryResponse, 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) GetDiscovery ¶
func (*OPAConfig) ProtoMessage ¶
func (*OPAConfig) ProtoMessage()
func (*OPAConfig) ProtoReflect ¶
func (x *OPAConfig) ProtoReflect() protoreflect.Message
type OPAInstanceDiscoveryRequest ¶
type OPAInstanceDiscoveryRequest struct { PolicyName string `protobuf:"bytes,1,opt,name=policy_name,json=policyName,proto3" json:"policy_name,omitempty"` InstanceLabel string `protobuf:"bytes,2,opt,name=instance_label,json=instanceLabel,proto3" json:"instance_label,omitempty"` // contains filtered or unexported fields }
func (*OPAInstanceDiscoveryRequest) Descriptor
deprecated
func (*OPAInstanceDiscoveryRequest) Descriptor() ([]byte, []int)
Deprecated: Use OPAInstanceDiscoveryRequest.ProtoReflect.Descriptor instead.
func (*OPAInstanceDiscoveryRequest) GetInstanceLabel ¶
func (x *OPAInstanceDiscoveryRequest) GetInstanceLabel() string
func (*OPAInstanceDiscoveryRequest) GetPolicyName ¶
func (x *OPAInstanceDiscoveryRequest) GetPolicyName() string
func (*OPAInstanceDiscoveryRequest) ProtoMessage ¶
func (*OPAInstanceDiscoveryRequest) ProtoMessage()
func (*OPAInstanceDiscoveryRequest) ProtoReflect ¶
func (x *OPAInstanceDiscoveryRequest) ProtoReflect() protoreflect.Message
func (*OPAInstanceDiscoveryRequest) Reset ¶
func (x *OPAInstanceDiscoveryRequest) Reset()
func (*OPAInstanceDiscoveryRequest) String ¶
func (x *OPAInstanceDiscoveryRequest) String() string
type OPAInstanceDiscoveryResponse ¶
type OPAInstanceDiscoveryResponse struct { Opa *OPAConfig `protobuf:"bytes,1,opt,name=opa,proto3" json:"opa,omitempty"` // contains filtered or unexported fields }
func (*OPAInstanceDiscoveryResponse) Descriptor
deprecated
func (*OPAInstanceDiscoveryResponse) Descriptor() ([]byte, []int)
Deprecated: Use OPAInstanceDiscoveryResponse.ProtoReflect.Descriptor instead.
func (*OPAInstanceDiscoveryResponse) GetOpa ¶
func (x *OPAInstanceDiscoveryResponse) GetOpa() *OPAConfig
func (*OPAInstanceDiscoveryResponse) ProtoMessage ¶
func (*OPAInstanceDiscoveryResponse) ProtoMessage()
func (*OPAInstanceDiscoveryResponse) ProtoReflect ¶
func (x *OPAInstanceDiscoveryResponse) ProtoReflect() protoreflect.Message
func (*OPAInstanceDiscoveryResponse) Reset ¶
func (x *OPAInstanceDiscoveryResponse) Reset()
func (*OPAInstanceDiscoveryResponse) String ¶
func (x *OPAInstanceDiscoveryResponse) String() string
type UnimplementedDiscoveryServer ¶
type UnimplementedDiscoveryServer struct { }
UnimplementedDiscoveryServer should be embedded to have forward compatible implementations.
func (UnimplementedDiscoveryServer) OPAInstanceDiscovery ¶
func (UnimplementedDiscoveryServer) OPAInstanceDiscovery(context.Context, *OPAInstanceDiscoveryRequest) (*OPAInstanceDiscoveryResponse, 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.