fakeserver

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0, BSD-3-Clause, MIT Imports: 10 Imported by: 0

Documentation

Overview

Package fakeserver contains test helpers for serving OSVs in zip files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeCRC32CHash

func ComputeCRC32CHash(t *testing.T, data []byte) string

ComputeCRC32CHash computes the CRC32 hash for the given data

func CreateZipServer

func CreateZipServer(t *testing.T, handler http.HandlerFunc) *httptest.Server

CreateZipServer setups up a new httptest.Server

func WriteOSVsZip

func WriteOSVsZip(t *testing.T, w http.ResponseWriter, osvs map[string]*osvpb.Vulnerability) (int, error)

WriteOSVsZip writes a zipfile containing the given OVSs to the response writer, along with setting the x-goog-hash with the crc32 hash of the file

func ZipOSVs

func ZipOSVs(t *testing.T, osvs map[string]*osvpb.Vulnerability) []byte

ZipOSVs creates a new in-memory zip file containing the given osvs

Types

This section is empty.

Jump to

Keyboard shortcuts

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