crconfigregex

package
v1.0.2-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Regexes

type Regexes struct {
	DirectMatches                      map[string]tc.DeliveryServiceName
	DotStartSlashDotFooSlashDotDotStar map[string]tc.DeliveryServiceName
	RegexMatch                         map[*regexp.Regexp]tc.DeliveryServiceName
}

Regexes maps Delivery Service Regular Expressions to delivery services. For performance, we categorize Regular Expressions into 3 categories: 1. Direct string matches, with no regular expression matching characters 2. .*\.foo\..* expressions, where foo is a direct string match with no regular expression matching characters 3. Everything else This allows us to do a cheap match on 1 and 2, and only regex match the uncommon case.

func Get

func Get(crc *tc.CRConfig) (Regexes, error)

getDeliveryServiceRegexes gets the regexes of each delivery service, for the given CDN, from Traffic Ops. Returns a map[deliveryService][]regex.

func (Regexes) DeliveryService

func (d Regexes) DeliveryService(domain, subdomain, subsubdomain string) (tc.DeliveryServiceName, bool)

DeliveryService returns the delivery service which matches the given fqdn, or false.

type Ths

type Ths struct {
	// contains filtered or unexported fields
}

Ths provides threadsafe access to a ThsT pointer. Note the object itself is not safe for multiple access, and must not be mutated, either by the original owner after calling Set, or by future users who call Get. If you need to mutate, perform a deep copy.

func NewThs

func NewThs() Ths

func (Ths) Get

func (t Ths) Get() ThsT

func (Ths) Set

func (t Ths) Set(v ThsT)

type ThsT

type ThsT *Regexes

Jump to

Keyboard shortcuts

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