cfgfile

package
v5.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const HdrConfigFilePath = "Path"
View Source
const HdrLineComment = "Line-Comment"
View Source
const TrafficOpsProxyParameterName = `tm.rev_proxy.url`

Variables

This section is empty.

Functions

func FilterDSS

func FilterDSS(dsses []tc.DeliveryServiceServer, dsIDs map[int]struct{}, serverIDs map[int]struct{}) []tc.DeliveryServiceServer

func FilterParams

func FilterParams(params []tc.Parameter, configFile string, name string, value string, omitName string) []tc.Parameter

FilterParams filters params and returns only the parameters which match configFile, name, and value. If configFile, name, or value is the empty string, it is not filtered. Returns a slice of parameters.

func GetAllConfigs

func GetAllConfigs(
	toData *config.TOData,
	revalOnly bool,
	dir string,
	appVersion string,
	toURL string,
	toIPs []net.Addr,
) ([]config.ATSConfigFile, error)

GetAllConfigs gets all config files for cfg.CacheHostName.

func GetConfigFile

func GetConfigFile(toData *config.TOData, fileInfo atscfg.CfgMeta, hdrCommentTxt string) (string, string, string, error)

GetConfigFile returns the text of the generated config file, the MIME Content Type of the config file, and any error.

func GetSSLCertsAndKeyFiles

func GetSSLCertsAndKeyFiles(toData *config.TOData) ([]config.ATSConfigFile, error)

func GetTOData

func GetTOData(cfg config.TCCfg) (*config.TOData, []net.Addr, error)

GetTOData gets all the data from Traffic Ops needed to generate config. Returns the data, the addresses of all Traffic Ops' requested, and any error.

func Make12MFacts

func Make12MFacts(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeATSDotRules

func MakeATSDotRules(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeAstatsDotConfig

func MakeAstatsDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeBGFetchDotConfig

func MakeBGFetchDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeCacheDotConfig

func MakeCacheDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeCacheURL

func MakeCacheURL(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeCacheURLPlain

func MakeCacheURLPlain(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeChkconfig

func MakeChkconfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeConfigFilesList

func MakeConfigFilesList(toData *config.TOData, dir string) ([]atscfg.CfgMeta, []string, error)

MakeConfigFilesList returns the list of config files, any warnings, and any error.

func MakeDropQStringDotConfig

func MakeDropQStringDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeHeaderRewrite

func MakeHeaderRewrite(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeHeaderRewriteMid

func MakeHeaderRewriteMid(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeHostingDotConfig

func MakeHostingDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeIPAllowDotConfig

func MakeIPAllowDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeLoggingDotConfig

func MakeLoggingDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeLoggingDotYAML

func MakeLoggingDotYAML(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeLogsXMLDotConfig

func MakeLogsXMLDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakePackages

func MakePackages(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeParentDotConfig

func MakeParentDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakePluginDotConfig

func MakePluginDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeRecordsDotConfig

func MakeRecordsDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeRegexRemap

func MakeRegexRemap(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeRegexRevalidateDotConfig

func MakeRegexRevalidateDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeRemapDotConfig

func MakeRemapDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeSSLMultiCertDotConfig

func MakeSSLMultiCertDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeSetDSCP

func MakeSetDSCP(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeStorageDotConfig

func MakeStorageDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeSysCtlDotConf

func MakeSysCtlDotConf(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeTopologyHeaderRewrite

func MakeTopologyHeaderRewrite(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeURISigningConfig

func MakeURISigningConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeURLSigConfig

func MakeURLSigConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeUnknownConfig

func MakeUnknownConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func MakeVolumeDotConfig

func MakeVolumeDotConfig(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

func ParamsToMap

func ParamsToMap(params []tc.Parameter) map[string]string

ParamsToMap converts a []tc.Parameter to a map[paramName]paramValue. If multiple params have the same value, the first one in params will be used an an error will be logged. See ParamArrToMultiMap.

func ParamsToMultiMap

func ParamsToMultiMap(params []tc.Parameter) map[string][]string

ParamArrToMultiMap converts a []tc.Parameter to a map[paramName][]paramValue.

func PreprocessConfigFile

func PreprocessConfigFile(server *atscfg.Server, cfgFile string) string

PreprocessConfigFile does global preprocessing on the given config file cfgFile. This is mostly string replacements of __X__ directives. See the code for the full list of replacements. These things were formerly done by ORT, but need to be processed by atstccfg now, because ORT no longer has the metadata necessary.

func WriteConfigs

func WriteConfigs(configs []config.ATSConfigFile, output io.Writer) error

WriteConfigs writes the given configs as a RFC2046§5.1 MIME multipart/mixed message.

Types

type ATSConfigFiles

type ATSConfigFiles []config.ATSConfigFile

ATSConfigFiles implements sort.Interface to sort by path.

func (ATSConfigFiles) Len

func (p ATSConfigFiles) Len() int

func (ATSConfigFiles) Less

func (p ATSConfigFiles) Less(i, j int) bool

func (ATSConfigFiles) Swap

func (p ATSConfigFiles) Swap(i, j int)

type ConfigFileFunc

type ConfigFileFunc func(toData *config.TOData, fileName string, hdrCommentTxt string) (atscfg.Cfg, error)

type ConfigFileLiteralFunc

type ConfigFileLiteralFunc struct {
	Name string
	Func ConfigFileFunc
}

type ConfigFilePrefixSuffixFunc

type ConfigFilePrefixSuffixFunc struct {
	Prefix string
	Suffix string
	Func   ConfigFileFunc
}

Jump to

Keyboard shortcuts

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