config

package
v3.0.0-...-838862a Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseVerifierEndpoints

func ParseVerifierEndpoints(verifierURLs map[string]string) (map[DetectorID][]string, error)

ParseVerifierEndpoints parses a map of user supplied verifier URLs. The input keys are detector IDs and the values are a comma separated list of URLs. The URLs are validated as HTTPS endpoints.

Types

type Config

type Config struct {
	Detectors []detectors.Detector
}

Config holds user supplied configuration.

func NewYAML

func NewYAML(input []byte) (*Config, error)

NewYAML parses the given YAML data into a Config.

func Read

func Read(filename string) (*Config, error)

Read parses a given filename into a Config.

type DetectorID

type DetectorID struct {
	ID      dpb.DetectorType
	Version int
}

DetectorID identifies a detector type and version. This struct is used as a way for users to identify detectors, whether unique or not. A DetectorID with Version = 0 indicates all possible versions of a detector.

func GetDetectorID

func GetDetectorID(d detectors.Detector) DetectorID

GetDetectorID extracts the DetectorID from a Detector.

func ParseDetector

func ParseDetector(input string) (DetectorID, error)

ParseDetector parses a user supplied string into a single DetectorID. Input is case-insensitive and either the detector name or ID may be used.

func ParseDetectors

func ParseDetectors(input string) ([]DetectorID, error)

ParseDetectors parses user supplied string into a list of detectors types. "all" will return the list of all available detectors. The input is comma separated and may use the case-insensitive detector name defined in the protobuf, or the protobuf enum number. A range may be used as well in the form "start-end". Order is preserved and duplicates are ignored.

func (DetectorID) String

func (id DetectorID) String() string

Jump to

Keyboard shortcuts

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