componentsv2

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package componentsv2 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Components_Echo_FullMethodName                   = "/scanoss.api.components.v2.Components/Echo"
	Components_SearchComponents_FullMethodName       = "/scanoss.api.components.v2.Components/SearchComponents"
	Components_GetComponentVersions_FullMethodName   = "/scanoss.api.components.v2.Components/GetComponentVersions"
	Components_GetComponentStatistics_FullMethodName = "/scanoss.api.components.v2.Components/GetComponentStatistics"
)

Variables

View Source
var Components_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "scanoss.api.components.v2.Components",
	HandlerType: (*ComponentsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Echo",
			Handler:    _Components_Echo_Handler,
		},
		{
			MethodName: "SearchComponents",
			Handler:    _Components_SearchComponents_Handler,
		},
		{
			MethodName: "GetComponentVersions",
			Handler:    _Components_GetComponentVersions_Handler,
		},
		{
			MethodName: "GetComponentStatistics",
			Handler:    _Components_GetComponentStatistics_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "scanoss/api/components/v2/scanoss-components.proto",
}

Components_ServiceDesc is the grpc.ServiceDesc for Components 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_scanoss_api_components_v2_scanoss_components_proto protoreflect.FileDescriptor

Functions

func RegisterComponentsHandler added in v0.1.0

func RegisterComponentsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterComponentsHandler registers the http handlers for service Components to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterComponentsHandlerClient added in v0.1.0

func RegisterComponentsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ComponentsClient) error

RegisterComponentsHandlerClient registers the http handlers for service Components to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ComponentsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ComponentsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ComponentsClient" to call the correct interceptors.

func RegisterComponentsHandlerFromEndpoint added in v0.1.0

func RegisterComponentsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterComponentsHandlerFromEndpoint is same as RegisterComponentsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterComponentsHandlerServer added in v0.1.0

func RegisterComponentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ComponentsServer) error

RegisterComponentsHandlerServer registers the http handlers for service Components to "mux". UnaryRPC :call ComponentsServer 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 RegisterComponentsHandlerFromEndpoint instead.

func RegisterComponentsServer

func RegisterComponentsServer(s grpc.ServiceRegistrar, srv ComponentsServer)

Types

type CompSearchRequest

type CompSearchRequest struct {

	// Component to search for (vendor/component/purl). Search is exclusive (will override vendor/component)
	Search string `protobuf:"bytes,1,opt,name=search,proto3" json:"search,omitempty"`
	// Vendor to search for. Vendor can be combined with Component
	Vendor string `protobuf:"bytes,2,opt,name=vendor,proto3" json:"vendor,omitempty"`
	// Component to search for. Component can be combined with Vendor
	Component string `protobuf:"bytes,3,opt,name=component,proto3" json:"component,omitempty"`
	// Type of package (purl type) to search for. i.e. github, maven, golang, npm, all - default github
	Package string `protobuf:"bytes,4,opt,name=package,proto3" json:"package,omitempty"`
	// Number of matches to return - default 50
	Limit int32 `protobuf:"varint,6,opt,name=limit,proto3" json:"limit,omitempty"`
	// Offset to submit to return the next (limit) of component matches
	Offset int32 `protobuf:"varint,7,opt,name=offset,proto3" json:"offset,omitempty"`
	// contains filtered or unexported fields
}

Component Search request data (JSON payload)

func (*CompSearchRequest) Descriptor deprecated

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

Deprecated: Use CompSearchRequest.ProtoReflect.Descriptor instead.

func (*CompSearchRequest) GetComponent

func (x *CompSearchRequest) GetComponent() string

func (*CompSearchRequest) GetLimit

func (x *CompSearchRequest) GetLimit() int32

func (*CompSearchRequest) GetOffset

func (x *CompSearchRequest) GetOffset() int32

func (*CompSearchRequest) GetPackage

func (x *CompSearchRequest) GetPackage() string

func (*CompSearchRequest) GetSearch

func (x *CompSearchRequest) GetSearch() string

func (*CompSearchRequest) GetVendor

func (x *CompSearchRequest) GetVendor() string

func (*CompSearchRequest) ProtoMessage

func (*CompSearchRequest) ProtoMessage()

func (*CompSearchRequest) ProtoReflect

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

func (*CompSearchRequest) Reset

func (x *CompSearchRequest) Reset()

func (*CompSearchRequest) String

func (x *CompSearchRequest) String() string

type CompSearchResponse

type CompSearchResponse struct {

	// Component response details
	Components []*CompSearchResponse_Component `protobuf:"bytes,1,rep,name=components,proto3" json:"components,omitempty"`
	// Response status (required?)
	Status *commonv2.StatusResponse `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

Component Search response data (JSON payload)

func (*CompSearchResponse) Descriptor deprecated

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

Deprecated: Use CompSearchResponse.ProtoReflect.Descriptor instead.

func (*CompSearchResponse) GetComponents

func (x *CompSearchResponse) GetComponents() []*CompSearchResponse_Component

func (*CompSearchResponse) GetStatus

func (x *CompSearchResponse) GetStatus() *commonv2.StatusResponse

func (*CompSearchResponse) ProtoMessage

func (*CompSearchResponse) ProtoMessage()

func (*CompSearchResponse) ProtoReflect

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

func (*CompSearchResponse) Reset

func (x *CompSearchResponse) Reset()

func (*CompSearchResponse) String

func (x *CompSearchResponse) String() string

type CompSearchResponse_Component

type CompSearchResponse_Component struct {
	Component string `protobuf:"bytes,1,opt,name=component,proto3" json:"component,omitempty"`
	Purl      string `protobuf:"bytes,2,opt,name=purl,proto3" json:"purl,omitempty"`
	Url       string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

Component details

func (*CompSearchResponse_Component) Descriptor deprecated

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

Deprecated: Use CompSearchResponse_Component.ProtoReflect.Descriptor instead.

func (*CompSearchResponse_Component) GetComponent

func (x *CompSearchResponse_Component) GetComponent() string

func (*CompSearchResponse_Component) GetPurl

func (x *CompSearchResponse_Component) GetPurl() string

func (*CompSearchResponse_Component) GetUrl

func (*CompSearchResponse_Component) ProtoMessage

func (*CompSearchResponse_Component) ProtoMessage()

func (*CompSearchResponse_Component) ProtoReflect

func (*CompSearchResponse_Component) Reset

func (x *CompSearchResponse_Component) Reset()

func (*CompSearchResponse_Component) String

type CompStatistic added in v0.2.0

type CompStatistic struct {
	TotalSourceFiles int32                     `protobuf:"varint,1,opt,name=total_source_files,json=totalSourceFiles,proto3" json:"total_source_files,omitempty"`
	TotalLines       int32                     `protobuf:"varint,2,opt,name=total_lines,json=totalLines,proto3" json:"total_lines,omitempty"`
	TotalBlankLines  int32                     `protobuf:"varint,3,opt,name=total_blank_lines,json=totalBlankLines,proto3" json:"total_blank_lines,omitempty"`
	Languages        []*CompStatistic_Language `protobuf:"bytes,4,rep,name=languages,proto3" json:"languages,omitempty"`
	// contains filtered or unexported fields
}

func (*CompStatistic) Descriptor deprecated added in v0.2.0

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

Deprecated: Use CompStatistic.ProtoReflect.Descriptor instead.

func (*CompStatistic) GetLanguages added in v0.2.0

func (x *CompStatistic) GetLanguages() []*CompStatistic_Language

func (*CompStatistic) GetTotalBlankLines added in v0.2.0

func (x *CompStatistic) GetTotalBlankLines() int32

func (*CompStatistic) GetTotalLines added in v0.2.0

func (x *CompStatistic) GetTotalLines() int32

func (*CompStatistic) GetTotalSourceFiles added in v0.2.0

func (x *CompStatistic) GetTotalSourceFiles() int32

func (*CompStatistic) ProtoMessage added in v0.2.0

func (*CompStatistic) ProtoMessage()

func (*CompStatistic) ProtoReflect added in v0.2.0

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

func (*CompStatistic) Reset added in v0.2.0

func (x *CompStatistic) Reset()

func (*CompStatistic) String added in v0.2.0

func (x *CompStatistic) String() string

type CompStatisticResponse added in v0.2.0

type CompStatisticResponse struct {

	// Component statistic details
	Purls []*CompStatisticResponse_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 Statistics response data (JSON payload)

func (*CompStatisticResponse) Descriptor deprecated added in v0.2.0

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

Deprecated: Use CompStatisticResponse.ProtoReflect.Descriptor instead.

func (*CompStatisticResponse) GetPurls added in v0.2.0

func (*CompStatisticResponse) GetStatus added in v0.2.0

func (*CompStatisticResponse) ProtoMessage added in v0.2.0

func (*CompStatisticResponse) ProtoMessage()

func (*CompStatisticResponse) ProtoReflect added in v0.2.0

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

func (*CompStatisticResponse) Reset added in v0.2.0

func (x *CompStatisticResponse) Reset()

func (*CompStatisticResponse) String added in v0.2.0

func (x *CompStatisticResponse) String() string

type CompStatisticResponse_Purls added in v0.2.0

type CompStatisticResponse_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"`
	Statistics *CompStatistic `protobuf:"bytes,3,opt,name=statistics,proto3" json:"statistics,omitempty"`
	// contains filtered or unexported fields
}

func (*CompStatisticResponse_Purls) Descriptor deprecated added in v0.2.0

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

Deprecated: Use CompStatisticResponse_Purls.ProtoReflect.Descriptor instead.

func (*CompStatisticResponse_Purls) GetPurl added in v0.2.0

func (x *CompStatisticResponse_Purls) GetPurl() string

func (*CompStatisticResponse_Purls) GetStatistics added in v0.2.0

func (x *CompStatisticResponse_Purls) GetStatistics() *CompStatistic

func (*CompStatisticResponse_Purls) GetVersion added in v0.2.0

func (x *CompStatisticResponse_Purls) GetVersion() string

func (*CompStatisticResponse_Purls) ProtoMessage added in v0.2.0

func (*CompStatisticResponse_Purls) ProtoMessage()

func (*CompStatisticResponse_Purls) ProtoReflect added in v0.2.0

func (*CompStatisticResponse_Purls) Reset added in v0.2.0

func (x *CompStatisticResponse_Purls) Reset()

func (*CompStatisticResponse_Purls) String added in v0.2.0

func (x *CompStatisticResponse_Purls) String() string

type CompStatistic_Language added in v0.2.0

type CompStatistic_Language struct {
	Name  string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Files int32  `protobuf:"varint,2,opt,name=files,proto3" json:"files,omitempty"`
	// contains filtered or unexported fields
}

func (*CompStatistic_Language) Descriptor deprecated added in v0.2.0

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

Deprecated: Use CompStatistic_Language.ProtoReflect.Descriptor instead.

func (*CompStatistic_Language) GetFiles added in v0.2.0

func (x *CompStatistic_Language) GetFiles() int32

func (*CompStatistic_Language) GetName added in v0.2.0

func (x *CompStatistic_Language) GetName() string

func (*CompStatistic_Language) ProtoMessage added in v0.2.0

func (*CompStatistic_Language) ProtoMessage()

func (*CompStatistic_Language) ProtoReflect added in v0.2.0

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

func (*CompStatistic_Language) Reset added in v0.2.0

func (x *CompStatistic_Language) Reset()

func (*CompStatistic_Language) String added in v0.2.0

func (x *CompStatistic_Language) String() string

type CompVersionRequest

type CompVersionRequest struct {

	// Component to search for (purl)
	Purl string `protobuf:"bytes,1,opt,name=purl,proto3" json:"purl,omitempty"`
	// Number of versions to return - default 20
	Limit int32 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

Component Version request data (JSON payload)

func (*CompVersionRequest) Descriptor deprecated

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

Deprecated: Use CompVersionRequest.ProtoReflect.Descriptor instead.

func (*CompVersionRequest) GetLimit

func (x *CompVersionRequest) GetLimit() int32

func (*CompVersionRequest) GetPurl

func (x *CompVersionRequest) GetPurl() string

func (*CompVersionRequest) ProtoMessage

func (*CompVersionRequest) ProtoMessage()

func (*CompVersionRequest) ProtoReflect

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

func (*CompVersionRequest) Reset

func (x *CompVersionRequest) Reset()

func (*CompVersionRequest) String

func (x *CompVersionRequest) String() string

type CompVersionResponse

type CompVersionResponse struct {

	// Component response details
	Component *CompVersionResponse_Component `protobuf:"bytes,1,opt,name=component,proto3" json:"component,omitempty"`
	// Response status
	Status *commonv2.StatusResponse `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

Component Search response data (JSON payload)

func (*CompVersionResponse) Descriptor deprecated

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

Deprecated: Use CompVersionResponse.ProtoReflect.Descriptor instead.

func (*CompVersionResponse) GetComponent

func (*CompVersionResponse) GetStatus

func (*CompVersionResponse) ProtoMessage

func (*CompVersionResponse) ProtoMessage()

func (*CompVersionResponse) ProtoReflect

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

func (*CompVersionResponse) Reset

func (x *CompVersionResponse) Reset()

func (*CompVersionResponse) String

func (x *CompVersionResponse) String() string

type CompVersionResponse_Component

type CompVersionResponse_Component struct {
	Component string                         `protobuf:"bytes,1,opt,name=component,proto3" json:"component,omitempty"`
	Purl      string                         `protobuf:"bytes,2,opt,name=purl,proto3" json:"purl,omitempty"`
	Url       string                         `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
	Versions  []*CompVersionResponse_Version `protobuf:"bytes,4,rep,name=versions,proto3" json:"versions,omitempty"`
	// contains filtered or unexported fields
}

Component details (including versions)

func (*CompVersionResponse_Component) Descriptor deprecated

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

Deprecated: Use CompVersionResponse_Component.ProtoReflect.Descriptor instead.

func (*CompVersionResponse_Component) GetComponent

func (x *CompVersionResponse_Component) GetComponent() string

func (*CompVersionResponse_Component) GetPurl

func (*CompVersionResponse_Component) GetUrl

func (*CompVersionResponse_Component) GetVersions

func (*CompVersionResponse_Component) ProtoMessage

func (*CompVersionResponse_Component) ProtoMessage()

func (*CompVersionResponse_Component) ProtoReflect

func (*CompVersionResponse_Component) Reset

func (x *CompVersionResponse_Component) Reset()

func (*CompVersionResponse_Component) String

type CompVersionResponse_License

type CompVersionResponse_License struct {
	Name           string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	SpdxId         string `protobuf:"bytes,2,opt,name=spdx_id,json=spdxId,proto3" json:"spdx_id,omitempty"`
	IsSpdxApproved bool   `protobuf:"varint,3,opt,name=is_spdx_approved,json=isSpdxApproved,proto3" json:"is_spdx_approved,omitempty"`
	Url            string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"`
	// contains filtered or unexported fields
}

License details

func (*CompVersionResponse_License) Descriptor deprecated

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

Deprecated: Use CompVersionResponse_License.ProtoReflect.Descriptor instead.

func (*CompVersionResponse_License) GetIsSpdxApproved

func (x *CompVersionResponse_License) GetIsSpdxApproved() bool

func (*CompVersionResponse_License) GetName

func (x *CompVersionResponse_License) GetName() string

func (*CompVersionResponse_License) GetSpdxId

func (x *CompVersionResponse_License) GetSpdxId() string

func (*CompVersionResponse_License) GetUrl

func (x *CompVersionResponse_License) GetUrl() string

func (*CompVersionResponse_License) ProtoMessage

func (*CompVersionResponse_License) ProtoMessage()

func (*CompVersionResponse_License) ProtoReflect

func (*CompVersionResponse_License) Reset

func (x *CompVersionResponse_License) Reset()

func (*CompVersionResponse_License) String

func (x *CompVersionResponse_License) String() string

type CompVersionResponse_Version

type CompVersionResponse_Version struct {
	Version  string                         `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	Licenses []*CompVersionResponse_License `protobuf:"bytes,4,rep,name=licenses,proto3" json:"licenses,omitempty"`
	// contains filtered or unexported fields
}

Version details (including license)

func (*CompVersionResponse_Version) Descriptor deprecated

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

Deprecated: Use CompVersionResponse_Version.ProtoReflect.Descriptor instead.

func (*CompVersionResponse_Version) GetLicenses

func (*CompVersionResponse_Version) GetVersion

func (x *CompVersionResponse_Version) GetVersion() string

func (*CompVersionResponse_Version) ProtoMessage

func (*CompVersionResponse_Version) ProtoMessage()

func (*CompVersionResponse_Version) ProtoReflect

func (*CompVersionResponse_Version) Reset

func (x *CompVersionResponse_Version) Reset()

func (*CompVersionResponse_Version) String

func (x *CompVersionResponse_Version) String() string

type ComponentsClient

type ComponentsClient interface {
	// Standard echo
	Echo(ctx context.Context, in *commonv2.EchoRequest, opts ...grpc.CallOption) (*commonv2.EchoResponse, error)
	// Search for components
	SearchComponents(ctx context.Context, in *CompSearchRequest, opts ...grpc.CallOption) (*CompSearchResponse, error)
	// Get all version information for a specific component
	GetComponentVersions(ctx context.Context, in *CompVersionRequest, opts ...grpc.CallOption) (*CompVersionResponse, error)
	// Get the statistics for the specified components
	GetComponentStatistics(ctx context.Context, in *commonv2.PurlRequest, opts ...grpc.CallOption) (*CompStatisticResponse, error)
}

ComponentsClient is the client API for Components 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 NewComponentsClient

func NewComponentsClient(cc grpc.ClientConnInterface) ComponentsClient

type ComponentsServer

type ComponentsServer interface {
	// Standard echo
	Echo(context.Context, *commonv2.EchoRequest) (*commonv2.EchoResponse, error)
	// Search for components
	SearchComponents(context.Context, *CompSearchRequest) (*CompSearchResponse, error)
	// Get all version information for a specific component
	GetComponentVersions(context.Context, *CompVersionRequest) (*CompVersionResponse, error)
	// Get the statistics for the specified components
	GetComponentStatistics(context.Context, *commonv2.PurlRequest) (*CompStatisticResponse, error)
	// contains filtered or unexported methods
}

ComponentsServer is the server API for Components service. All implementations must embed UnimplementedComponentsServer for forward compatibility

type UnimplementedComponentsServer

type UnimplementedComponentsServer struct {
}

UnimplementedComponentsServer must be embedded to have forward compatible implementations.

func (UnimplementedComponentsServer) Echo

func (UnimplementedComponentsServer) GetComponentStatistics added in v0.2.0

func (UnimplementedComponentsServer) GetComponentVersions

func (UnimplementedComponentsServer) SearchComponents

type UnsafeComponentsServer

type UnsafeComponentsServer interface {
	// contains filtered or unexported methods
}

UnsafeComponentsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ComponentsServer will result in compilation errors.

Jump to

Keyboard shortcuts

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