Documentation ¶
Overview ¶
Package provenancev2 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterProvenanceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterProvenanceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProvenanceClient) error
- func RegisterProvenanceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterProvenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProvenanceServer) error
- func RegisterProvenanceServer(s grpc.ServiceRegistrar, srv ProvenanceServer)
- type ProvenanceClient
- type ProvenanceResponse
- func (*ProvenanceResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ProvenanceResponse) GetPurls() []*ProvenanceResponse_Purls
- func (x *ProvenanceResponse) GetStatus() *commonv2.StatusResponse
- func (*ProvenanceResponse) ProtoMessage()
- func (x *ProvenanceResponse) ProtoReflect() protoreflect.Message
- func (x *ProvenanceResponse) Reset()
- func (x *ProvenanceResponse) String() string
- type ProvenanceResponse_CuratedLocation
- func (*ProvenanceResponse_CuratedLocation) Descriptor() ([]byte, []int)deprecated
- func (x *ProvenanceResponse_CuratedLocation) GetCount() int32
- func (x *ProvenanceResponse_CuratedLocation) GetCountry() string
- func (*ProvenanceResponse_CuratedLocation) ProtoMessage()
- func (x *ProvenanceResponse_CuratedLocation) ProtoReflect() protoreflect.Message
- func (x *ProvenanceResponse_CuratedLocation) Reset()
- func (x *ProvenanceResponse_CuratedLocation) String() string
- type ProvenanceResponse_DeclaredLocation
- func (*ProvenanceResponse_DeclaredLocation) Descriptor() ([]byte, []int)deprecated
- func (x *ProvenanceResponse_DeclaredLocation) GetLocation() string
- func (x *ProvenanceResponse_DeclaredLocation) GetType() string
- func (*ProvenanceResponse_DeclaredLocation) ProtoMessage()
- func (x *ProvenanceResponse_DeclaredLocation) ProtoReflect() protoreflect.Message
- func (x *ProvenanceResponse_DeclaredLocation) Reset()
- func (x *ProvenanceResponse_DeclaredLocation) String() string
- type ProvenanceResponse_Purls
- func (*ProvenanceResponse_Purls) Descriptor() ([]byte, []int)deprecated
- func (x *ProvenanceResponse_Purls) GetCuratedLocations() []*ProvenanceResponse_CuratedLocation
- func (x *ProvenanceResponse_Purls) GetDeclaredLocations() []*ProvenanceResponse_DeclaredLocation
- func (x *ProvenanceResponse_Purls) GetPurl() string
- func (x *ProvenanceResponse_Purls) GetVersion() string
- func (*ProvenanceResponse_Purls) ProtoMessage()
- func (x *ProvenanceResponse_Purls) ProtoReflect() protoreflect.Message
- func (x *ProvenanceResponse_Purls) Reset()
- func (x *ProvenanceResponse_Purls) String() string
- type ProvenanceServer
- type UnimplementedProvenanceServer
- type UnsafeProvenanceServer
Constants ¶
const ( Provenance_Echo_FullMethodName = "/scanoss.api.provenance.v2.Provenance/Echo" Provenance_GetComponentProvenance_FullMethodName = "/scanoss.api.provenance.v2.Provenance/GetComponentProvenance" )
Variables ¶
var File_scanoss_api_provenance_v2_scanoss_provenance_proto protoreflect.FileDescriptor
var Provenance_ServiceDesc = grpc.ServiceDesc{ ServiceName: "scanoss.api.provenance.v2.Provenance", HandlerType: (*ProvenanceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Echo", Handler: _Provenance_Echo_Handler, }, { MethodName: "GetComponentProvenance", Handler: _Provenance_GetComponentProvenance_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "scanoss/api/provenance/v2/scanoss-provenance.proto", }
Provenance_ServiceDesc is the grpc.ServiceDesc for Provenance service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterProvenanceHandler ¶
func RegisterProvenanceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterProvenanceHandler registers the http handlers for service Provenance to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterProvenanceHandlerClient ¶
func RegisterProvenanceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProvenanceClient) error
RegisterProvenanceHandlerClient registers the http handlers for service Provenance to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ProvenanceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ProvenanceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ProvenanceClient" to call the correct interceptors.
func RegisterProvenanceHandlerFromEndpoint ¶
func RegisterProvenanceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterProvenanceHandlerFromEndpoint is same as RegisterProvenanceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterProvenanceHandlerServer ¶
func RegisterProvenanceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProvenanceServer) error
RegisterProvenanceHandlerServer registers the http handlers for service Provenance to "mux". UnaryRPC :call ProvenanceServer 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 RegisterProvenanceHandlerFromEndpoint instead.
func RegisterProvenanceServer ¶
func RegisterProvenanceServer(s grpc.ServiceRegistrar, srv ProvenanceServer)
Types ¶
type ProvenanceClient ¶
type ProvenanceClient interface { // Standard echo Echo(ctx context.Context, in *commonv2.EchoRequest, opts ...grpc.CallOption) (*commonv2.EchoResponse, error) // Get Provenance countrues associated with a list of PURLs GetComponentProvenance(ctx context.Context, in *commonv2.PurlRequest, opts ...grpc.CallOption) (*ProvenanceResponse, error) }
ProvenanceClient is the client API for Provenance 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 NewProvenanceClient ¶
func NewProvenanceClient(cc grpc.ClientConnInterface) ProvenanceClient
type ProvenanceResponse ¶
type ProvenanceResponse struct { // Provenance details Purls []*ProvenanceResponse_Purls `protobuf:"bytes,1,rep,name=purls,proto3" json:"purls,omitempty"` // Response status Status *commonv2.StatusResponse `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
* Component level Provenance Response data (JSON payload)
func (*ProvenanceResponse) Descriptor
deprecated
func (*ProvenanceResponse) Descriptor() ([]byte, []int)
Deprecated: Use ProvenanceResponse.ProtoReflect.Descriptor instead.
func (*ProvenanceResponse) GetPurls ¶
func (x *ProvenanceResponse) GetPurls() []*ProvenanceResponse_Purls
func (*ProvenanceResponse) GetStatus ¶
func (x *ProvenanceResponse) GetStatus() *commonv2.StatusResponse
func (*ProvenanceResponse) ProtoMessage ¶
func (*ProvenanceResponse) ProtoMessage()
func (*ProvenanceResponse) ProtoReflect ¶
func (x *ProvenanceResponse) ProtoReflect() protoreflect.Message
func (*ProvenanceResponse) Reset ¶
func (x *ProvenanceResponse) Reset()
func (*ProvenanceResponse) String ¶
func (x *ProvenanceResponse) String() string
type ProvenanceResponse_CuratedLocation ¶
type ProvenanceResponse_CuratedLocation struct { // Country for the owner or contributor Country string `protobuf:"bytes,1,opt,name=country,proto3" json:"country,omitempty"` // Ocurrences for users or contributors on this specific country Count int32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` // contains filtered or unexported fields }
Curated provenance information about the project
func (*ProvenanceResponse_CuratedLocation) Descriptor
deprecated
func (*ProvenanceResponse_CuratedLocation) Descriptor() ([]byte, []int)
Deprecated: Use ProvenanceResponse_CuratedLocation.ProtoReflect.Descriptor instead.
func (*ProvenanceResponse_CuratedLocation) GetCount ¶
func (x *ProvenanceResponse_CuratedLocation) GetCount() int32
func (*ProvenanceResponse_CuratedLocation) GetCountry ¶
func (x *ProvenanceResponse_CuratedLocation) GetCountry() string
func (*ProvenanceResponse_CuratedLocation) ProtoMessage ¶
func (*ProvenanceResponse_CuratedLocation) ProtoMessage()
func (*ProvenanceResponse_CuratedLocation) ProtoReflect ¶
func (x *ProvenanceResponse_CuratedLocation) ProtoReflect() protoreflect.Message
func (*ProvenanceResponse_CuratedLocation) Reset ¶
func (x *ProvenanceResponse_CuratedLocation) Reset()
func (*ProvenanceResponse_CuratedLocation) String ¶
func (x *ProvenanceResponse_CuratedLocation) String() string
type ProvenanceResponse_DeclaredLocation ¶
type ProvenanceResponse_DeclaredLocation struct { // Declared location could be either from the owner or a contributor Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Country/State/City/Province/Place declared on the repo Location string `protobuf:"bytes,2,opt,name=location,proto3" json:"location,omitempty"` // contains filtered or unexported fields }
Declared location for the project
func (*ProvenanceResponse_DeclaredLocation) Descriptor
deprecated
func (*ProvenanceResponse_DeclaredLocation) Descriptor() ([]byte, []int)
Deprecated: Use ProvenanceResponse_DeclaredLocation.ProtoReflect.Descriptor instead.
func (*ProvenanceResponse_DeclaredLocation) GetLocation ¶
func (x *ProvenanceResponse_DeclaredLocation) GetLocation() string
func (*ProvenanceResponse_DeclaredLocation) GetType ¶
func (x *ProvenanceResponse_DeclaredLocation) GetType() string
func (*ProvenanceResponse_DeclaredLocation) ProtoMessage ¶
func (*ProvenanceResponse_DeclaredLocation) ProtoMessage()
func (*ProvenanceResponse_DeclaredLocation) ProtoReflect ¶
func (x *ProvenanceResponse_DeclaredLocation) ProtoReflect() protoreflect.Message
func (*ProvenanceResponse_DeclaredLocation) Reset ¶
func (x *ProvenanceResponse_DeclaredLocation) Reset()
func (*ProvenanceResponse_DeclaredLocation) String ¶
func (x *ProvenanceResponse_DeclaredLocation) String() string
type ProvenanceResponse_Purls ¶
type ProvenanceResponse_Purls struct { Purl string `protobuf:"bytes,1,opt,name=purl,proto3" json:"purl,omitempty"` Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` DeclaredLocations []*ProvenanceResponse_DeclaredLocation `protobuf:"bytes,3,rep,name=declared_locations,json=declaredLocations,proto3" json:"declared_locations,omitempty"` CuratedLocations []*ProvenanceResponse_CuratedLocation `protobuf:"bytes,4,rep,name=curated_locations,json=curatedLocations,proto3" json:"curated_locations,omitempty"` // contains filtered or unexported fields }
func (*ProvenanceResponse_Purls) Descriptor
deprecated
func (*ProvenanceResponse_Purls) Descriptor() ([]byte, []int)
Deprecated: Use ProvenanceResponse_Purls.ProtoReflect.Descriptor instead.
func (*ProvenanceResponse_Purls) GetCuratedLocations ¶
func (x *ProvenanceResponse_Purls) GetCuratedLocations() []*ProvenanceResponse_CuratedLocation
func (*ProvenanceResponse_Purls) GetDeclaredLocations ¶
func (x *ProvenanceResponse_Purls) GetDeclaredLocations() []*ProvenanceResponse_DeclaredLocation
func (*ProvenanceResponse_Purls) GetPurl ¶
func (x *ProvenanceResponse_Purls) GetPurl() string
func (*ProvenanceResponse_Purls) GetVersion ¶
func (x *ProvenanceResponse_Purls) GetVersion() string
func (*ProvenanceResponse_Purls) ProtoMessage ¶
func (*ProvenanceResponse_Purls) ProtoMessage()
func (*ProvenanceResponse_Purls) ProtoReflect ¶
func (x *ProvenanceResponse_Purls) ProtoReflect() protoreflect.Message
func (*ProvenanceResponse_Purls) Reset ¶
func (x *ProvenanceResponse_Purls) Reset()
func (*ProvenanceResponse_Purls) String ¶
func (x *ProvenanceResponse_Purls) String() string
type ProvenanceServer ¶
type ProvenanceServer interface { // Standard echo Echo(context.Context, *commonv2.EchoRequest) (*commonv2.EchoResponse, error) // Get Provenance countrues associated with a list of PURLs GetComponentProvenance(context.Context, *commonv2.PurlRequest) (*ProvenanceResponse, error) // contains filtered or unexported methods }
ProvenanceServer is the server API for Provenance service. All implementations must embed UnimplementedProvenanceServer for forward compatibility
type UnimplementedProvenanceServer ¶
type UnimplementedProvenanceServer struct { }
UnimplementedProvenanceServer must be embedded to have forward compatible implementations.
func (UnimplementedProvenanceServer) Echo ¶
func (UnimplementedProvenanceServer) Echo(context.Context, *commonv2.EchoRequest) (*commonv2.EchoResponse, error)
func (UnimplementedProvenanceServer) GetComponentProvenance ¶
func (UnimplementedProvenanceServer) GetComponentProvenance(context.Context, *commonv2.PurlRequest) (*ProvenanceResponse, error)
type UnsafeProvenanceServer ¶
type UnsafeProvenanceServer interface {
// contains filtered or unexported methods
}
UnsafeProvenanceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProvenanceServer will result in compilation errors.