cryptographyv2

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 cryptographyv2 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Cryptography_Echo_FullMethodName          = "/scanoss.api.cryptography.v2.Cryptography/Echo"
	Cryptography_GetAlgorithms_FullMethodName = "/scanoss.api.cryptography.v2.Cryptography/GetAlgorithms"
)

Variables

View Source
var Cryptography_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "scanoss.api.cryptography.v2.Cryptography",
	HandlerType: (*CryptographyServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Echo",
			Handler:    _Cryptography_Echo_Handler,
		},
		{
			MethodName: "GetAlgorithms",
			Handler:    _Cryptography_GetAlgorithms_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "scanoss/api/cryptography/v2/scanoss-cryptography.proto",
}

Cryptography_ServiceDesc is the grpc.ServiceDesc for Cryptography 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_cryptography_v2_scanoss_cryptography_proto protoreflect.FileDescriptor

Functions

func RegisterCryptographyHandler added in v0.1.0

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

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

func RegisterCryptographyHandlerClient added in v0.1.0

func RegisterCryptographyHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CryptographyClient) error

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

func RegisterCryptographyHandlerFromEndpoint added in v0.1.0

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

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

func RegisterCryptographyHandlerServer added in v0.1.0

func RegisterCryptographyHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CryptographyServer) error

RegisterCryptographyHandlerServer registers the http handlers for service Cryptography to "mux". UnaryRPC :call CryptographyServer 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 RegisterCryptographyHandlerFromEndpoint instead.

func RegisterCryptographyServer

func RegisterCryptographyServer(s grpc.ServiceRegistrar, srv CryptographyServer)

Types

type AlgorithmResponse added in v0.1.0

type AlgorithmResponse struct {

	// Cryptography details
	Purls []*AlgorithmResponse_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
}

Cryptography Algorithm response data (JSON payload)

func (*AlgorithmResponse) Descriptor deprecated added in v0.1.0

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

Deprecated: Use AlgorithmResponse.ProtoReflect.Descriptor instead.

func (*AlgorithmResponse) GetPurls added in v0.1.0

func (x *AlgorithmResponse) GetPurls() []*AlgorithmResponse_Purls

func (*AlgorithmResponse) GetStatus added in v0.1.0

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

func (*AlgorithmResponse) ProtoMessage added in v0.1.0

func (*AlgorithmResponse) ProtoMessage()

func (*AlgorithmResponse) ProtoReflect added in v0.1.0

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

func (*AlgorithmResponse) Reset added in v0.1.0

func (x *AlgorithmResponse) Reset()

func (*AlgorithmResponse) String added in v0.1.0

func (x *AlgorithmResponse) String() string

type AlgorithmResponse_Algorithms added in v0.1.0

type AlgorithmResponse_Algorithms struct {
	Algorithm string `protobuf:"bytes,1,opt,name=algorithm,proto3" json:"algorithm,omitempty"`
	Strength  string `protobuf:"bytes,2,opt,name=strength,proto3" json:"strength,omitempty"`
	// contains filtered or unexported fields
}

func (*AlgorithmResponse_Algorithms) Descriptor deprecated added in v0.1.0

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

Deprecated: Use AlgorithmResponse_Algorithms.ProtoReflect.Descriptor instead.

func (*AlgorithmResponse_Algorithms) GetAlgorithm added in v0.1.0

func (x *AlgorithmResponse_Algorithms) GetAlgorithm() string

func (*AlgorithmResponse_Algorithms) GetStrength added in v0.1.0

func (x *AlgorithmResponse_Algorithms) GetStrength() string

func (*AlgorithmResponse_Algorithms) ProtoMessage added in v0.1.0

func (*AlgorithmResponse_Algorithms) ProtoMessage()

func (*AlgorithmResponse_Algorithms) ProtoReflect added in v0.1.0

func (*AlgorithmResponse_Algorithms) Reset added in v0.1.0

func (x *AlgorithmResponse_Algorithms) Reset()

func (*AlgorithmResponse_Algorithms) String added in v0.1.0

type AlgorithmResponse_Purls added in v0.1.0

type AlgorithmResponse_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"`
	Algorithms []*AlgorithmResponse_Algorithms `protobuf:"bytes,3,rep,name=algorithms,proto3" json:"algorithms,omitempty"`
	// contains filtered or unexported fields
}

func (*AlgorithmResponse_Purls) Descriptor deprecated added in v0.1.0

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

Deprecated: Use AlgorithmResponse_Purls.ProtoReflect.Descriptor instead.

func (*AlgorithmResponse_Purls) GetAlgorithms added in v0.1.0

func (*AlgorithmResponse_Purls) GetPurl added in v0.1.0

func (x *AlgorithmResponse_Purls) GetPurl() string

func (*AlgorithmResponse_Purls) GetVersion added in v0.1.0

func (x *AlgorithmResponse_Purls) GetVersion() string

func (*AlgorithmResponse_Purls) ProtoMessage added in v0.1.0

func (*AlgorithmResponse_Purls) ProtoMessage()

func (*AlgorithmResponse_Purls) ProtoReflect added in v0.1.0

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

func (*AlgorithmResponse_Purls) Reset added in v0.1.0

func (x *AlgorithmResponse_Purls) Reset()

func (*AlgorithmResponse_Purls) String added in v0.1.0

func (x *AlgorithmResponse_Purls) String() string

type CryptographyClient

type CryptographyClient interface {
	// Standard echo
	Echo(ctx context.Context, in *commonv2.EchoRequest, opts ...grpc.CallOption) (*commonv2.EchoResponse, error)
	// Get Cryptographic algorithms associated with a list of PURLs
	GetAlgorithms(ctx context.Context, in *commonv2.PurlRequest, opts ...grpc.CallOption) (*AlgorithmResponse, error)
}

CryptographyClient is the client API for Cryptography 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.

type CryptographyServer

type CryptographyServer interface {
	// Standard echo
	Echo(context.Context, *commonv2.EchoRequest) (*commonv2.EchoResponse, error)
	// Get Cryptographic algorithms associated with a list of PURLs
	GetAlgorithms(context.Context, *commonv2.PurlRequest) (*AlgorithmResponse, error)
	// contains filtered or unexported methods
}

CryptographyServer is the server API for Cryptography service. All implementations must embed UnimplementedCryptographyServer for forward compatibility

type UnimplementedCryptographyServer

type UnimplementedCryptographyServer struct {
}

UnimplementedCryptographyServer must be embedded to have forward compatible implementations.

func (UnimplementedCryptographyServer) Echo

func (UnimplementedCryptographyServer) GetAlgorithms

type UnsafeCryptographyServer

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

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

Jump to

Keyboard shortcuts

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