Documentation
¶
Overview ¶
Package fakeserver contains test helpers for serving OSVs in zip files
Index ¶
- func ComputeCRC32CHash(t *testing.T, data []byte) string
- func CreateZipServer(t *testing.T, handler http.HandlerFunc) *httptest.Server
- func WriteOSVsZip(t *testing.T, w http.ResponseWriter, osvs map[string]*osvpb.Vulnerability) (int, error)
- func ZipOSVs(t *testing.T, osvs map[string]*osvpb.Vulnerability) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeCRC32CHash ¶
ComputeCRC32CHash computes the CRC32 hash for the given data
func CreateZipServer ¶
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
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.