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 DiscoveryClient
- type DiscoveryServer
- type OPAConfig
- type OPADiscoveryRequest
- func (*OPADiscoveryRequest) Descriptor() ([]byte, []int)deprecated
- func (x *OPADiscoveryRequest) GetPolicyId() string
- func (x *OPADiscoveryRequest) GetUseTags() string
- func (*OPADiscoveryRequest) ProtoMessage()
- func (x *OPADiscoveryRequest) ProtoReflect() protoreflect.Message
- func (x *OPADiscoveryRequest) Reset()
- func (x *OPADiscoveryRequest) String() string
- type OPADiscoveryResponse
- func (*OPADiscoveryResponse) Descriptor() ([]byte, []int)deprecated
- func (x *OPADiscoveryResponse) GetOpa() *OPAConfig
- func (*OPADiscoveryResponse) ProtoMessage()
- func (x *OPADiscoveryResponse) ProtoReflect() protoreflect.Message
- func (x *OPADiscoveryResponse) Reset()
- func (x *OPADiscoveryResponse) String() string
- type UnimplementedDiscoveryServer
- type UnsafeDiscoveryServer
Constants ¶
This section is empty.
Variables ¶
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)
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) GetDiscovery ¶
func (*OPAConfig) ProtoMessage ¶
func (*OPAConfig) ProtoMessage()
func (*OPAConfig) ProtoReflect ¶
func (x *OPAConfig) ProtoReflect() protoreflect.Message
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 ¶
func (UnimplementedDiscoveryServer) OPADiscovery(context.Context, *OPADiscoveryRequest) (*OPADiscoveryResponse, 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.