testlists

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package testlists contains code to read/rewrite the test lists.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generator

func Generator(wg *sync.WaitGroup, testListsDir string, och chan<- *Entry)

Generator is a function that posts each entry within each file in the citizenlab/test-lists on the given channel. This function will close the och channel when it has finished reading all the test-lists. This function calls runtimex.PanicOnError in case an error occurs.

func Rewrite

func Rewrite(filename string, shouldKeep func(URL string) bool)

Rewrite rewrites a file in the test lists skipping all the records for which shouldKeep returns false.

Types

type Entry

type Entry struct {
	// File is the file from which we are reading.
	File string

	// Line is the line within the input file.
	Line int64

	// URL is the URL.
	URL string

	// CategoryCode is the category code.
	CategoryCode string

	// CategoryDescription describes the category.
	CategoryDescription string

	// DateAdded is when the entry was added.
	DateAdded string

	// Source is who added the entry.
	Source string

	// Notes contains free-form textual notes.
	Notes string
}

Entry is an entry of a test list.

Jump to

Keyboard shortcuts

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