Documentation
¶
Overview ¶
Package atscfg contains logic for generating Apache Traffic Server configuration files from ATC objects and concepts.
Index ¶
- Constants
- Variables
- func BoolOnOff(b bool) string
- func DeliveryServicesToSSLMultiCertDSes(dses []DeliveryService) (map[tc.DeliveryServiceName]sslMultiCertDS, []string)
- func FirstHeaderRewriteConfigFileName(dsName string) string
- func GetATSMajorVersionFromATSVersion(atsVersion string) (uint, error)
- func GetAllowedCIDRsForMid(server *Server, servers []Server, cacheGroups []tc.CacheGroupNullableV5, ...) ([]*net.IPNet, []*net.IPNet, []string, error)
- func GetAnyCastPartners(server *Server, servers []Server) map[string][]string
- func GetCoalesceMaskAndNumber(serverParams []tc.ParameterV5) (int, int, int, int, []string)
- func GetDSParameters(ds *DeliveryService, params []tc.ParameterV5) ([]tc.ParameterV5, error)
- func GetDSRequestFQDNs(ds *DeliveryService, regexes []tc.DeliveryServiceRegex, server *Server, ...) ([]string, error)
- func GetHostPortFromURI(uriStr string) (string, string)
- func GetPurgeIPs(serverParams []tc.ParameterV5) []string
- func GetSSLMultiCertDotConfigCertAndKeyName(dsName tc.DeliveryServiceName, ds sslMultiCertDS) (string, string)
- func GetSSLMultiCertDotConfigDeliveryServices(dses map[tc.DeliveryServiceName]sslMultiCertDS) map[tc.DeliveryServiceName]sslMultiCertDS
- func GetServerParameters(server *Server, params []tc.ParameterV5) ([]tc.ParameterV5, error)
- func InnerHeaderRewriteConfigFileName(dsName string) string
- func IsGoDirect(ds DeliveryService) bool
- func LastHeaderRewriteConfigFileName(dsName string) string
- func LayerProfiles(profileNames []string, tcParams []tc.ParameterV5) ([]tc.ParameterV5, error)
- func MakeDSRegexMap(regexes []tc.DeliveryServiceRegexes) map[tc.DeliveryServiceName][]tc.DeliveryServiceRegex
- func ParentAbstractionServiceParentsToParentDotConfigLine(parents []*ParentAbstractionServiceParent) string
- func ParentSelectParamQStringHandlingToBool(paramVal string) *bool
- func ParseRetryResponses(resp string) ([]int, error)
- func ProfilesMatch(pa []string, pb []string) bool
- func ServerProfilesMatch(sa *Server, sb *Server) bool
- func ToCDN(cdn tc.CDN) tc.CDNV5
- func ToCDNs(cdns []tc.CDN) []tc.CDNV5
- func ToCacheGroup(cacheGroup tc.CacheGroupNullable) tc.CacheGroupNullableV5
- func ToCacheGroups(cacheGroups []tc.CacheGroupNullable) []tc.CacheGroupNullableV5
- func ToTopologies(topologies []tc.Topology) []tc.TopologyV5
- func ToTopology(topology tc.Topology) tc.TopologyV5
- type AStatsDotConfigOpts
- type ATSDotRulesOpts
- type BGFetchDotConfigOpts
- type CacheDotConfigOpts
- type CacheGroupType
- type Cfg
- func Make12MFacts(server *Server, opt *Config12MFactsOpts) (Cfg, error)
- func MakeAStatsDotConfig(server *Server, serverParams []tc.ParameterV5, opt *AStatsDotConfigOpts) (Cfg, error)
- func MakeATSDotRules(server *Server, serverParams []tc.ParameterV5, opt *ATSDotRulesOpts) (Cfg, error)
- func MakeBGFetchDotConfig(server *Server, opt *BGFetchDotConfigOpts) (Cfg, error)
- func MakeCacheDotConfig(server *Server, servers []Server, deliveryServices []DeliveryService, ...) (Cfg, error)
- func MakeChkconfig(serverParams []tc.ParameterV5, opt *ChkconfigOpts) (Cfg, error)
- func MakeDropQStringDotConfig(server *Server, serverParams []tc.ParameterV5, opt *DropQStringDotConfigOpts) (Cfg, error)
- func MakeHeaderRewriteDotConfig(fileName string, deliveryServices []DeliveryService, ...) (Cfg, error)
- func MakeHostingDotConfig(server *Server, servers []Server, serverParams []tc.ParameterV5, ...) (Cfg, error)
- func MakeIPAllowDotConfig(serverParams []tc.ParameterV5, server *Server, servers []Server, ...) (Cfg, error)
- func MakeIPAllowDotYAML(serverParams []tc.ParameterV5, server *Server, servers []Server, ...) (Cfg, error)
- func MakeLoggingDotConfig(server *Server, serverParams []tc.ParameterV5, opt *LoggingDotConfigOpts) (Cfg, error)
- func MakeLoggingDotYAML(server *Server, serverParams []tc.ParameterV5, opt *LoggingDotYAMLOpts) (Cfg, error)
- func MakeLogsXMLDotConfig(server *Server, serverParams []tc.ParameterV5, opt *LogsXMLDotConfigOpts) (Cfg, error)deprecated
- func MakePackages(serverParams []tc.ParameterV5, opts *PackagesOpts) (Cfg, error)
- func MakeParentDotConfig(dses []DeliveryService, server *Server, servers []Server, ...) (Cfg, error)
- func MakePluginDotConfig(server *Server, serverParams []tc.ParameterV5, opt *PluginDotConfigOpts) (Cfg, error)
- func MakeRecordsDotConfig(server *Server, serverParams []tc.ParameterV5, opt *RecordsConfigOpts) (Cfg, error)
- func MakeRegexRemapDotConfig(fileName string, server *Server, deliveryServices []DeliveryService, ...) (Cfg, error)
- func MakeRegexRevalidateDotConfig(server *Server, deliveryServices []DeliveryService, ...) (Cfg, error)
- func MakeRemapDotConfig(server *Server, servers []Server, unfilteredDSes []DeliveryService, ...) (Cfg, error)
- func MakeSNIDotYAML(server *Server, servers []Server, dses []DeliveryService, ...) (Cfg, error)
- func MakeSSLMultiCertDotConfig(server *Server, deliveryServices []DeliveryService, ...) (Cfg, error)
- func MakeSSLServerNameYAML(server *Server, servers []Server, dses []DeliveryService, ...) (Cfg, error)
- func MakeServerUnknown(fileName string, server *Server, serverParams []tc.ParameterV5, ...) (Cfg, error)
- func MakeSetDSCPDotConfig(fileName string, server *Server, opt *SetDSCPDotConfigOpts) (Cfg, error)
- func MakeStorageDotConfig(server *Server, serverParams []tc.ParameterV5, opt *StorageDotConfigOpts) (Cfg, error)
- func MakeStrategiesDotYAML(dses []DeliveryService, server *Server, servers []Server, ...) (Cfg, error)
- func MakeSysCtlDotConf(server *Server, serverParams []tc.ParameterV5, opt *SysCtlDotConfOpts) (Cfg, error)
- func MakeURISigningConfig(fileName string, uriSigningKeys map[tc.DeliveryServiceName][]byte, ...) (Cfg, error)
- func MakeURLSigConfig(fileName string, server *Server, serverParams []tc.ParameterV5, ...) (Cfg, error)
- func MakeVolumeDotConfig(server *Server, serverParams []tc.ParameterV5, opt *VolumeDotConfigOpts) (Cfg, error)
- type CfgFile
- type CfgMeta
- type ChkconfigOpts
- type Config12MFactsOpts
- type ConfigFilesListOpts
- type DeliveryService
- type DeliveryServiceID
- type DeliveryServiceServer
- type DropQStringDotConfigOpts
- type HeaderRewriteDotConfigOpts
- type HostingDotConfigOpts
- type IPAllowDotConfigOpts
- type IPAllowDotYAMLOpts
- type InvalidationJob
- type LineTemplates
- type LoggingDotConfigOpts
- type LoggingDotYAMLOpts
- type LogsXMLDotConfigOpts
- type OriginFQDN
- type OriginHost
- type PackagesOpts
- type ParentAbstraction
- type ParentAbstractionService
- type ParentAbstractionServiceParent
- type ParentAbstractionServiceParentSecondaryMode
- type ParentAbstractionServiceRetryPolicy
- type ParentAbstractionServices
- type ParentConfigOpts
- type ParentConfigRetryKeys
- type PluginDotConfigOpts
- type ProfileDS
- type ProfileID
- type ProfileName
- type RecordsConfigOpts
- type RegexRemapDotConfigOpts
- type RegexRevalidateDotConfigOpts
- type RemapDotConfigOpts
- type RemapLines
- type RemapTags
- type RevalType
- type SNIDotYAMLOpts
- type SSLData
- type SSLMultiCertDotConfigOpts
- type SSLServerNameYAMLOpts
- type Server
- type ServerCapability
- type ServerID
- type ServerUnknownOpts
- type ServerUpdateStatus
- type SetDSCPDotConfigOpts
- type StorageDotConfigOpts
- type StrategiesYAMLOpts
- type SysCtlDotConfOpts
- type TLSVersion
- type TopologyCacheTier
- type TopologyNamedeprecated
- type TopologyPlacement
- type URISigningConfigOpts
- type URLSigConfigOpts
- type VolumeDotConfigOpts
Constants ¶
const ( TopologyCacheTierFirst = TopologyCacheTier("first") TopologyCacheTierInner = TopologyCacheTier("inner") TopologyCacheTierLast = TopologyCacheTier("last") TopologyCacheTierInvalid = TopologyCacheTier("") )
These are the allowed values for a TopologyCacheTier.
const ( // The format in API versions 4.0 and later. JobV4TimeFormat = time.RFC3339Nano // The format in API versions prior to 4.0. JobLegacyTimeFormat = "2006-01-02 15:04:05-07" )
These are the formats for the "lastUpdated" timestamps of Content Invalidation Jobs in different Traffic Ops API versions.
const ( JobLegacyRefetchSuffix = `##REFETCH##` JobLegacyRefreshSuffix = `##REFRESH##` )
These special suffixes when found on a rule override the default type of a Content Invalidation Job. Deprecated: these are no longer necessary in Traffic Ops API versions 4.0 and later.
const ( JobLegacyParamPrefix = "TTL:" JobLegacyParamSuffix = "h" JobLegacyKeyword = "PURGE" )
These strings are used to parse legacy representations of Content Invalidation Jobs. Deprecated: When the Traffic Ops API version 4.0 representation of Content Invalidation Jobs becomes standard (i.e. when 3.x API version support is dropped) these will have no meaning or purpose.
const ( // "ALL" has the special meaning "all HTTP Methods". MethodAll = "ALL" // MethodPush is a non-standard HTTP request method understood by Apache // Traffic Server used to directly insert content for the requested URI into // the cache. MethodPush = "PUSH" // MethodPurge is a non-standard HTTP request method understood by Apache // Traffic Server used to directly remove the requested URI from the cache. MethodPurge = "PURGE" MethodDelete = "DELETE" )
These are the ATS HTTP request methods that may be granted using ipallow configuration file rules.
const ( ParentAbstractionServiceParentSecondaryModeExhaust = ParentAbstractionServiceParentSecondaryMode("exhaust") ParentAbstractionServiceParentSecondaryModeAlternate = ParentAbstractionServiceParentSecondaryMode("alternate") ParentAbstractionServiceParentSecondaryModePeering = ParentAbstractionServiceParentSecondaryMode("peering") ParentAbstractionServiceParentSecondaryModeInvalid = ParentAbstractionServiceParentSecondaryMode("") )
The allowable values of a ParentAbstractionServiceParentSecondaryMode (with the exception of ParentAbstractionServiceParentSecondaryModeInvalid, which does not represent a valid ParentAbstractionServiceParentSecondaryMode).
const ( ParentAbstractionServiceRetryPolicyRoundRobinIP = ParentAbstractionServiceRetryPolicy("round_robin_ip") ParentAbstractionServiceRetryPolicyRoundRobinStrict = ParentAbstractionServiceRetryPolicy("round_robin_strict") ParentAbstractionServiceRetryPolicyFirst = ParentAbstractionServiceRetryPolicy("first") ParentAbstractionServiceRetryPolicyLatched = ParentAbstractionServiceRetryPolicy("latched") ParentAbstractionServiceRetryPolicyConsistentHash = ParentAbstractionServiceRetryPolicy("consistent_hash") ParentAbstractionServiceRetryPolicyInvalid = ParentAbstractionServiceRetryPolicy("") )
These are the valid value of a ParentAbstractionServiceRetryPolicy - with the exception of ParentAbstractionServiceRetryPolicyInvalid, which does not represent a valid ParentAbstractionServiceRetryPolicy.
const ( ParentConfigCacheParamWeight = "weight" ParentConfigCacheParamPort = "port" ParentConfigCacheParamUseIP = "use_ip_address" ParentConfigCacheParamRank = "rank" ParentConfigCacheParamNotAParent = "not_a_parent" )
These are the Names of Parameters that can affect cache server parentage in unknown ways.
TODO: determine/describe how these work.
const ATSDotRulesFileName = StorageFileName
ATSDotRulesFileName is the name of a "rules" configuration file.
TODO: This isn't actually correct. This is just the ConfigFile value that a cache server's Profile's Drive_Prefix, Drive_Letters, RAM_Drive_Prefix, and RAM_Drive_Letters Parameters must have for generation to be successful (in fact it seems to panic if those aren't found), but the actual name of the file for which MakeATSDotRules outputs content is '50-ats.rules'. Is this misleading? Maybe it just doesn't even need to be exported? Or exist at all?
const ActionAllow = "ip_allow"
ActionAllow specifies that IPs matching the line's pattern should be allowed to use the explicitly listed HTTP request methods.
const ActionDeny = "ip_deny"
ActionDeny specifies that IPs matching the line's pattern should NOT be allowed to use the explicitly listed HTTP request methods.
const AstatsFileName = "astats.config"
AstatsFileName is the name of the file used to contain configuration for the astats_over_http Traffic Server plugin.
const AstatsSeparator = "="
AstatsSeparator is the string used by astats.config to separate configuration option names from values.
const CacheUrlPrefix = "cacheurl_"
CacheUrlPrefix is an unused constant of unknown purpose.
Deprecated: It's likely that this is related to the removed "Cache URL" property of Delivery Services and the old "cacheurl" plugin for ATS which is not supported by any supported version of ATS.
const ChkconfigFileName = `chkconfig`
ChkconfigFileName is the name of the ckconfig configuration file.
const ChkconfigParamConfigFile = `chkconfig`
ChkconfigParamConfigFile is the ConfigFile value of Parameters that affect the generation of the chkconfig configuration file.
const ConfigSuffix = ".config"
ConfigSuffix is a suffix (or "file extension") appended to many configuration file names, most notably those for the Header Rewrite Traffic Server plugin.
TODO: Unexport? This is only used by the header rewrite configuration file generation functions, and doesn't have much practical purpose outside of that limited usage.
const ContentType12MFacts = ContentTypeTextASCII
ContentType12MFacts is the MIME type of the contents of a 12M_facts file.
const ContentTypeATSDotRules = ContentTypeTextASCII
ContentTypeATSDotRules is the MIME type of the contents of a 50-ats.rules file.
const ContentTypeAstatsDotConfig = ContentTypeTextASCII
ContentTypeAstatsDotConfig is the MIME type of the content of astats.config file.
const ContentTypeBGFetchDotConfig = ContentTypeTextASCII
ContentTypeBGFetchDotConfig is the MIME type of the contents of a bg_fetch.config file.
const ContentTypeCacheDotConfig = ContentTypeTextASCII
ContentTypeCacheDotConfig is the MIME type of the contents of a cache.config file.
const ContentTypeChkconfig = ContentTypeTextASCII
ContentTypeChkconfig is the MIME content type of the contents of the chkconfig configuration file.
Note that the GoDoc for MakeChkconfig says "This is a JSON object, and should be served with an 'application/json' Content-Type." but actually the file contents on disk are not JSON-encoded.
const ContentTypeDropQStringDotConfig = ContentTypeTextASCII
ContentTypeDropQStringDotConfig is the MIME type of the contents of a drop_qstring.config file.
const ContentTypeHeaderRewriteDotConfig = ContentTypeTextASCII
ContentTypeHeaderRewriteDotConfig is the MIME type of the contents of a configuration file for the Header Rewrite ATS plugin.
const ContentTypeHostingDotConfig = ContentTypeTextASCII
ContentTypeHostingDotConfig is the MIME type of the contents of a hosting.config file.
const ContentTypeIPAllowDotConfig = ContentTypeTextASCII
ContentTypeIPAllowDotConfig is the MIME type of the contents of an ip_allow.config file.
const ContentTypeIPAllowDotYAML = ContentTypeYAML
ContentTypeIPAllowDotYAML is the MIME type of the contents of an ip_allow.yaml file.
Note YAML has no IANA standard mime type. This is one of several common usages, and is likely to be the standardized value. If you're reading this, please check IANA to see if YAML has been added, and change this to the IANA definition if so. Also note we include 'charset=us-ascii' because YAML is commonly UTF-8, but ATS is likely to be unable to handle UTF.
const ContentTypeLoggingDotConfig = ContentTypeTextASCII
ContentTypeLoggingDotConfig is the MIME type of the contents of a logging configuration file used by ATS 7.1.x.
const ContentTypeLoggingDotYAML = ContentTypeYAML
ContentTypeLoggingDotYAML is the content type of the contents of a logging configuration file used by ATS version 8 and later.
Note YAML has no IANA standard mime type. This is one of several common usages, and is likely to be the standardized value. If you're reading this, please check IANA to see if YAML has been added, and change this to the IANA definition if so. Also note we include 'charset=us-ascii' because YAML is commonly UTF-8, but ATS is likely to be unable to handle UTF.
const ContentTypeLogsDotXML = `text/xml`
ContentTypeLogsDotXML is the MIME content type of the logging configuration file used by ATS version 6 and earlier.
Deprecated: The versions of ATS that use this file are not supported, either by ATC or the ATS project itself.
const ContentTypePackages = ContentTypeTextASCII
ContentTypePackages is a MIME type of unknown meaning and purpose.
Deprecated: Since the 'package' ConfigFile value is a "dummy" value used to indicate packages that should be installed through yum, there isn't a need for any definition of a content type for a file that doesn't exist, and this value is never used for anything anyway. The contents of the file as output by tc3-generate are actually encoded as JSON, so at best this is inaccurate.
const ContentTypeParentDotConfig = ContentTypeTextASCII
ContentTypeParentDotConfig is the MIME type of the contents of a parent.config file.
const ContentTypePluginDotConfig = ContentTypeTextASCII
ContentTypePluginDotConfig is the MIME type of the contents of a plugin.config ATS configuration file.
const ContentTypeRecordsDotConfig = ContentTypeTextASCII
ContentTypeRecordsDotConfig is the MIME type of the contents of a records.config ATS configuration file.
const ContentTypeRegexRemapDotConfig = ContentTypeTextASCII
ContentTypeRegexRemapDotConfig is the MIME type of the contents of a regex_remap.config ATS configuration file.
const ContentTypeRegexRevalidateDotConfig = ContentTypeTextASCII
ContentTypeRegexRevalidateDotConfig is the MIME content type of the contents of a regex_revalidate.config ATS configuration file.
const ContentTypeRemapDotConfig = ContentTypeTextASCII
ContentTypeRemapDotConfig is the MIME type of the contents of a remap.config ATS configuration file.
const ContentTypeSNIDotYAML = ContentTypeYAML
ContentTypeSNIDotYAML is the MIME type of the contents of an sni.yaml ATS configuration file.
const ContentTypeSSLMultiCertDotConfig = ContentTypeTextASCII
ContentTypeSSLMultiCertDotConfig is the MIME type of the contents of an ssl_multicert.config ATS configuration file.
const ContentTypeSSLServerNameYAML = ContentTypeYAML
ContentTypeSSLServerNameYAML is the MIME type of the contents of an ssl_server_name.yaml ATS configuration file.
const ContentTypeServerUnknownConfig = ContentTypeTextASCII
ContentTypeServerUnknownConfig is the MIME content type of the contents of an arbitrary file not handled specially by t3c.
Note that the actual grammar of such files is unknowable and may be more appropriately represented by some other MIME type, but treating it as this MIME type will never cause problems, since t3c is only capable of generating such files as regular text files.
const ContentTypeSetDSCPDotConfig = ContentTypeTextASCII
ContentTypeSetDSCPDotConfig is the MIME type of the contents of an ATS configuration file used to set the DSCP of IP packets.
const ContentTypeStorageDotConfig = ContentTypeTextASCII
ContentTypeStorageDotConfig is the MIME type of the contents of a storage.config ATS configuration file.
const ContentTypeStrategiesDotYAML = ContentTypeYAML
ContentTypeStrategiesDotYAML is the MIME type of the contents of a strategies.yaml ATS configuration file.
const ContentTypeSysctlDotConf = ContentTypeTextASCII
ContentTypeSysctlDotConf is the MIME type of the contents of a sysctl.conf ATS configuration file.
const ContentTypeTextASCII = `text/plain; charset=us-ascii`
ContentTypeTextASCII is the MIME type for plain text using an ASCII character set.
TODO: Move to lib/go-rfc package?
const ContentTypeURISigningDotConfig = `application/json; charset=us-ascii`
ContentTypeURISigningDotConfig is the MIME type of the contents of a uri_signing.config ATS configuration file.
const ContentTypeURLSig = ContentTypeTextASCII
ContentTypeURLSig is the MIME type of the contents of a url_sig.config ATS configuration file.
const ContentTypeVolumeDotConfig = ContentTypeTextASCII
ContentTypeVolumeDotConfig is the MIME type of the contents of a volume.config ATS configuration file.
const ContentTypeYAML = "application/yaml; charset=us-ascii"
ContentTypeYAML is the MIME type of YAML-format files and text.
Note YAML has no IANA standard mime type. This is one of several common usages, and is likely to be the standardized value. If you're reading this, please check IANA to see if YAML has been added, and change this to the IANA definition if so. Also note we include 'charset=us-ascii' because YAML is commonly UTF-8, but ATS is likely to be unable to handle UTF.
TODO: Move this into lib/go-rfc?
const DefaultATSVersion = "5"
DefaultATSVersion is the version of Traffic Server assumed when one is not directly specified in a server's Parameters.
TODO: Emulates Perl; change to 6? ATC no longer officially supports ATS 5.
const DefaultCoalesceMaskLenV4 = 24
DefaultCoalesceMaskLenV4 is the value that will be used for the mask length for IPv4 network specifications used to coalesce groups of addresses in an ip_allow.config file, if a value is not given by a Parameter.
TODO: unexport? This is only used in this package.
const DefaultCoalesceMaskLenV6 = 48
DefaultCoalesceMaskLenV6 is the value that will be used for the mask length for IPv6 network specifications used to coalesce groups of addresses in an ip_allow.config file, if a value is not given by a Parameter.
TODO: unexport? This is only used in this package.
const DefaultCoalesceNumberV4 = 5
DefaultCoalesceNumberV4 is the value that will be used for the minimum number of IPv4 addresses in an ip_allow.config file that must be covered by a mask in order to allow coalescing them, if a value is not given by a Parameter.
TODO: unexport? This is only used in this package.
const DefaultCoalesceNumberV6 = 5
DefaultCoalesceNumberV6 is the value that will be used for the minimum number of IPv6 addresses in an ip_allow.config file that must be covered by a mask in order to allow coalescing them, if a value is not given by a Parameter.
TODO: unexport? This is only used in this package.
const DefaultDefaultEnableH2 = false
DefaultDefaultEnableH2 is whether Delivery Services will have HTTP/2 enabled by default if they don't have an explicit Parameter, and no Opt is passed to the Make func. We disable by default, to prevent potentially enabling broken clients.
const DefaultFirstRemapConfigTemplateString = `` /* 191-byte string literal not displayed */
const DefaultIgnoreQueryStringInParentSelection = false
DefaultIgnoreQueryStringInParentSelection is used to decide whether a request's query string should be used or dropped during selecting a parent when that behavior is not explicitly configured.
const DefaultInnerRemapConfigTemplateString = DefaultLastRemapConfigTemplateString
const DefaultLastRemapConfigTemplateString = `map {{{Source}}} {{{Destination}}} {{{Strategy}}} {{{HeaderRewrite}}} {{{Cachekey}}} {{{RangeRequests}}} {{{RawText}}}`
const DefaultMaxRevalDurationDays = 90
DefaultMaxRevalDurationDays is the maximum duration (in days) of Content Invalidation Requests if not overridden by a Parameter.
const DefaultParentAbstractionServiceRetryPolicy = ParentAbstractionServiceRetryPolicyConsistentHash
DefaultParentAbstractionServiceRetryPolicy is the "retry policy" that will be used by Delivery Service parenting if one is not explicitly configured.
const DefaultParentWeight = 0.999
DefaultParentWeight is the weight given to a parent if one isn't explicitly configured - *or* in the case that the parent has a Parameter set for the weight, but its Value cannot be parsed.
const DropQStringDotConfigFileName = "drop_qstring.config"
DropQStringDotConfigFileName is the name of the drop_qstring.config file - this is also the ConfigFile value of Parameters that are able to affect the contents of this file.
const DropQStringDotConfigParamName = "content"
DropQStringDotConfigParamName is the Name a Parameter must have to dictate the contents of drop_qstring.config - Parameters by other Names (even in the correct ConfigFile) are ignored.
const HeaderCommentDateFormat = "Mon Jan 2 15:04:05 MST 2006"
HeaderCommentDateFormat is an unused format for dates and times.
TODO: Remove this, it's unused.
const HeaderRewriteFirstPrefix = HeaderRewritePrefix + "first_"
HeaderRewriteFirstPrefix is a prefix on filenames of configuration files for the Header Rewrite ATS plugin for cache servers at the first (or "edge") tier of a Topology. The rest of the filename is dependent on the Delivery Service for which the file contains rewrite rules.
const HeaderRewriteInnerPrefix = HeaderRewritePrefix + "inner_"
HeaderRewriteInnerPrefix is a prefix on filenames of configuration files for the Header Rewrite ATS plugin for cache servers at any tier between the first and last tier of a Topology. The rest of the filename is dependent on the Delivery Service for which the file contains rewrite rules.
const HeaderRewriteLastPrefix = HeaderRewritePrefix + "last_"
HeaderRewriteLastPrefix is a prefix on filenames of configuration files for the Header Rewrite ATS plugin for cache servers at the last tier of a Topology. The rest of the filename is dependent on the Delivery Service for which the file contains rewrite rules.
const HeaderRewriteMidPrefix = "hdr_rw_mid_"
HeaderRewriteMidPrefix is a prefix on filenames of configuration files for the Header Rewrite ATS plugin for mid-tier cache servers. The rest of the filename is dependent on the Delivery Service for which the file contains rewrite rules.
const HeaderRewritePrefix = "hdr_rw_"
HeaderRewritePrefix is a prefix on filenames of configuration files for the Header Rewrite ATS plugin for edge-tier cache servers. The rest of the filename is dependent on the Delivery Service for which the file contains rewrite rules.
const HostingConfigFileName = `hosting.config`
HostingConfigFileName is the file name of a hosting.config file.
TODO: Remove? This is unused, even internally in this package.
const HostingConfigParamConfigFile = `storage.config`
HostingConfigParamConfigFile is the ConfigFile value of Parameters which can affect the contents of hosting.config files.
const IPAllowConfigFileName = `ip_allow.config`
IPAllowConfigFileName is both the file name of ip_allow.config files and the ConfigFile value of Parameters that can affect its contents.
const IPAllowYamlFileName = `ip_allow.yaml`
IPAllowYamlFileName is the name of the configuration file that controls IP address-restricted access to various request methods.
TODO: Replace instances of 'ip_allow.yaml' with this currently unused constant.
const InvalidID = -1
InvalidID is used as a placeholder value when determining the ID of a parent Cache Group.
This is not strictly invalid; when a Cache Group's Parent's ID is "detected" as this value, then it may simply mean that the Cache Group is "top-level", and has no parent.
TODO: unexport this? It's highly specific to this package, and isn't used anywhere else.
const JobKeywordPurge = "PURGE"
JobKeywordPurge is the "keyword" of "jobs" that determines if a "job" represents a Content Invalidation Job - "jobs" with other "keywords" are ignored.
TODO: Figure out if this can be deprecated/removed, along with the check for it; all "jobs" created through the API have this "keyword", and the notion of generic-purpose "jobs" has been abandoned.
const LineComment12MFacts = LineCommentHash
LineComment12MFacts is the string that signifies the start of a line comment in the grammar of a 12M_facts file.
const LineCommentATSDotRules = LineCommentHash
LineCommentATSDotRules is the string used by parsers of 50-ats.rules to determine that the rest of the current line's content is a comment.
const LineCommentAstatsDotConfig = LineCommentHash
LineCommentAstatsDotConfig is the string used to mark the beginning of a line comment as understood by parsers of astats.config files.
const LineCommentBGFetchDotConfig = LineCommentHash
LineCommentBGFetchDotConfig is the string understood by parsers of bg_fetch.config files to be the beginning of a line comment.
const LineCommentCacheDotConfig = LineCommentHash
LineCommentCacheDotConfig is the string that signifies the beginning of a line comment in the grammar of a cache.config file.
const LineCommentChkconfig = LineCommentHash
LineCommentChkconfig is the string that signifies the start of a line comment in the grammar of a chkconfig configuration file.
const LineCommentDropQStringDotConfig = LineCommentHash
LineCommentDropQStringDotConfig is the string that signifies the start of a line comment in the grammar of a drop_qstring.config file.
const LineCommentHash = "#"
LineCommentHash is the string that denotes the beginning of a line comment, for grammars that use the number sign for line comments.
TODO: Unexport? This is only used, it seems, to group multiple usages into a single symbol not used outside this package. It's conceivable to want to know the line comment string for a given grammar, but it's unlikely that anyone importing this package would find an alias for "#" itself helpful, with no other attached semantics.
const LineCommentHeaderRewriteDotConfig = LineCommentHash
LineCommentHeaderRewriteDotConfig is the string used to signify the beginning of a line comment in the grammar of configuration files for the Header Rewrite ATS plugin.
const LineCommentHostingDotConfig = LineCommentHash
LineCommentHostingDotConfig is the string used to indicate the beginning of a line comment in the grammar of a hosting.config file.
const LineCommentIPAllowDotConfig = LineCommentHash
LineCommentIPAllowDotConfig is the string that signifies the start of a line comment in the grammar of an ip_allow.config file.
const LineCommentIPAllowDotYAML = LineCommentHash
LineCommentIPAllowDotYAML is the string used to signify the beginning of a line comment in the grammar of an ip_allow.yaml file.
const LineCommentLoggingDotConfig = LineCommentHash
LineCommentLoggingDotConfig is the string used to indicate the start of a line comment in the grammar of the logging configuration files used by ATS 7.1.x.
TODO: Is this true? According to the ATS docs, the contents of logging.config are a Lua script, which uses "--" for comments, not "#".
const LineCommentLoggingDotYAML = LineCommentHash
LineCommentLoggingDotYAML is the string used to indicate the beginning of a line comment in the grammar of a logging configuration file used by ATS version 8 and later.
const LineCommentLogsDotXML = `<!--`
LineCommentLogsDotXML is the string used in the grammar of a logging configuration file used by ATS version 6 and earlier to indicate the beginning of a comment node.
Note that XML does not have "line" comments, only comment nodes - which MUST have the associated closing tag (-->).
Deprecated: The versions of ATS that use this file are not supported, either by ATC or the ATS project itself.
const LineCommentPackages = ""
LineCommentPackages is used only to convey the idea that since "package Parameters" don't define file contents they don't have comments and therefore no string signifies the beginning of a comment for this non-existent grammar.
Deprecated: This constant expresses a concept that by its own definition has no meaning.
const LineCommentParentDotConfig = LineCommentHash
LineCommentParentDotConfig is the string used to begin a line comment in the grammar of a parent.config file.
const LineCommentPluginDotConfig = LineCommentHash
LineCommentPluginDotConfig is the string that denotes the start of a line comment in the grammar of a plugin.config ATS configuration file.
const LineCommentRecordsDotConfig = LineCommentHash
LineCommentRecordsDotConfig is the string that indicates the beginning of a line comment in the grammar of a records.config ATS configuration file.
const LineCommentRegexRemapDotConfig = LineCommentHash
LineCommentRegexRemapDotConfig is the string used to indicate the start of a line comment in the grammar of a regex_remap.config ATS configuration file.
const LineCommentRegexRevalidateDotConfig = LineCommentHash
LineCommentRegexRevalidateDotConfig is the string that indicates the beginning of a line comment in the grammar of a regex_revalidate.config ATS configuration file.
const LineCommentRemapDotConfig = LineCommentHash
LineCommentRemapDotConfig is the string used to signal the beginning of a line comment in the grammar of a remap.config ATS configuration file.
const LineCommentSNIDotYAML = LineCommentYAML
LineCommentSNIDotYAML is the string used by the grammar of an sni.yaml file to indicate the start of a line comment.
const LineCommentSSLMultiCertDotConfig = LineCommentHash
LineCommentSSLMultiCertDotConfig is the string used to indicate the start of a line comment in the grammar of an ssl_multicert.config ATS configuration file.
const LineCommentSSLServerNameYAML = LineCommentYAML
LineCommentSSLServerNameYAML is the string used to indicate the start of a line comment in the grammar of an ssl_server_name.yaml ATS configuration file.
const LineCommentSetDSCPDotConfig = LineCommentHash
LineCommentSetDSCPDotConfig is the string that, in the grammar of an ATS configuration file used to set the DSCP of IP packets, indicates that the rest of the line is a comment.
const LineCommentStorageDotConfig = LineCommentHash
LineCommentStorageDotConfig is the string used to indicate in the grammar of a storage.config ATS configuration file that the rest of the line is a comment.
const LineCommentStrategiesDotYAML = LineCommentHash
LineCommentStrategiesDotYAML is the string used to signal the beginning of a line comment in the grammar of a strategies.yaml ATS configuration file.
const LineCommentSysctlDotConf = LineCommentHash
LineCommentSysctlDotConf is the string understood by parses of sysctl.conf to be the beginning of a line comment.
const LineCommentURISigningDotConfig = ""
LineCommentURISigningDotConfig is the string used to indicate the start of a line comment in the grammar of a uri_signing.config ATS configuration file.
Note that uri_signing.config is a JSON-encoded object, and as such comments are not allowed in that file, because the JSON lexicon has no comment token.
const LineCommentURLSig = LineCommentHash
LineCommentURLSig is the string used to indicate the start of a line comment in the grammar of a url_sig.config ATS configuration file.
const LineCommentVolumeDotConfig = LineCommentHash
LineCommentVolumeDotConfig is the string used to indicate the beginning of a line comment in the grammar of a volume.config ATS configuration file.
const LineCommentYAML = LineCommentHash
LineCommentYAML is the string used to start a line comment in YAML syntax.
const LoggingFileName = "logging.config"
LoggingFileName is the name of the logging configuration file used by ATS 7.1.x. This is also the ConfigFile value of Parameters that can affect ATS logging configuration - regardless of the actual name of the configuration file used by the ATS version installed on the cache server.
const LoggingYAMLFileName = "logging.yaml"
LoggingYAMLFileName is the name of a logging configuration file used by ATS version 8 and later.
const LogsXMLFileName = "logs_xml.config"
LogsXMLFileName is the name of a logging configuration file used by ATS version 6 and earlier.
Deprecated: The versions of ATS that use this file are not supported, either by ATC or the ATS project itself.
const MaxLogObjects = 10
MaxLogObjects is the maximum number of "Log Objects" that can be defined in a logging configuration file for ATS (logging.config, logging.yaml, logs_xml.config).
See the ATS documentatio for logging configuration for details: https://docs.trafficserver.apache.org/en/8.1.x/admin-guide/files/logging.yaml.en.html ... although documentation for unsupported ATS versions may be more helpful: https://docs.trafficserver.apache.org/en/6.1.x/admin-guide/files/logs_xml.config.en.html Note that it's not possible to select this version of the documentation from the version footer in the sidebar at https://docs.trafficserver.apache.org/ anymore at the time of this writing, and may be removed entirely by the time of reading.
const MaxOriginConnectionsNoMax = 0 // 0 indicates no limit on origin connections
MaxOriginConnectionsNoMax is a value specially interpreted by ATS to mean "no maximum origin connections".
TODO: Remove this? It's not used anywhere, not even internally in this package.
const MethodSeparator = `|`
MethodSeparator is the string used as an infix operator in ipallow.config ATS configuration files to express a union of allowed HTTP request methods.
const PackagesFileName = `packages`
PackagesFileName is an unused constant of unknown purpose.
Deprecated: Since the 'package' ConfigFile value is a "dummy" value used to indicate packages that should be installed through yum, there isn't a need for any definition of a file name, and the Parameter ConfigFile value is already exported as PackagesParamConfigFile.
const PackagesParamConfigFile = `package`
PackagesParamConfigFile is the ConfigFile value of Parameters that define system packages to be installed on a cache server.
const ParamCoalesceMaskLenV4 = "coalesce_masklen_v4"
ParamCoalesceMaskLenV4 is the Name of a Parameter which can be used to set the mask length for IPv4 network specifications used to coalesce groups of addresses in an ip_allow.config file.
TODO: unexport? This is only used in this package.
const ParamCoalesceMaskLenV6 = "coalesce_masklen_v6"
ParamCoalesceMaskLenV6 is the Name of a Parameter which can be used to set the mask length for IPv6 network specifications used to coalesce groups of addresses in an ip_allow.config file.
TODO: unexport? This is only used in this package.
const ParamCoalesceNumberV4 = "coalesce_number_v4"
ParamCoalesceNumberV4 is the Name of a Parameter that can be used to set the minimum number of IPv4 addresses in an ip_allow.config file that must be covered by a mask in order to allow coalescing them.
TODO: unexport? This is only used in this package.
const ParamCoalesceNumberV6 = "coalesce_number_v6"
ParamCoalesceNumberV6 is the Name of a Parameter that can be used to set the minimum number of IPv6 addresses in an ip_allow.config file that must be covered by a mask in order to allow coalescing them.
TODO: unexport? This is only used in this package.
const ParamDrivePrefix = "Drive_Prefix"
ParamDrivePrefix is the Name of the Parameter that determines the path prefix for disk storage caching block devices.
const ParamPurgeAllowIP = "purge_allow_ip"
ParamPurgeAllowIP is the Name of Parameters which can specify an IP address to be allowed ALL methods on the cache server (not just PURGE).
TODO: replace instances of "purge_allow_ip" with this currently-unused constant. TODO: unexport? This is only used in this package.
const ParamRAMDrivePrefix = "RAM_Drive_Prefix"
ParamRAMDrivePrefix is the Name of the Parameter that determines the path prefix for RAM caching block devices.
const ParentAbstractionServiceParentSecondaryModeDefault = ParentAbstractionServiceParentSecondaryModeAlternate
ParentAbstractionServiceParentSecondaryModeDefault is the "secondary parent mode" that is used in parenting abstraction if one is not explicitly configured.
const ParentConfigDSParamDefaultMSOAlgorithm = ParentAbstractionServiceRetryPolicyConsistentHash
ParentConfigDSParamDefaultMSOAlgorithm is the parent selection algorithm used by cache servers when not overridden by any Parameters.
const ParentConfigDSParamDefaultMSOParentRetry = "both"
ParentConfigDSParamDefaultMSOParentRetry is the argument to a parent_retry directive in a line in a parent.config ATS configuration file that is used by cache servers when not overridden by any Parameters.
ParentConfigDSParamDefaultMSOUnavailableServerRetryResponses is the argument passed to a directive used to set the HTTP response codes that will trigger a cache server to retry its parent and mark it unavailable, in parent.config lines that are generated for MSO Delivery Services.
const ParentConfigDSParamDefaultMaxSimpleRetries = 1
ParentConfigDSParamDefaultMaxSimpleRetries is the maximum number of "simple" retries a cache server will attempt when its parent is unavailable, if not overridden by Parameters.
ParentConfigDSParamDefaultMaxUnavailableServerRetries is the maximum number of retries a cache server will attempt when its parent is unavailable, if not overridden by Parameters.
const ParentConfigFileName = "parent.config"
ParentConfigFileName is the name of an ATS parent.config configuration file, as well as the ConfigFile value of Parameters that can affect its contents.
TODO: Replace instances of "parent.config" in t3c with this constant.
const ParentConfigGoDirectEdge = ParentConfigGoDirectParam + ".edge"
const ParentConfigGoDirectFirst = ParentConfigGoDirectParam + ".first"
const ParentConfigGoDirectInner = ParentConfigGoDirectParam + ".inner"
const ParentConfigGoDirectLast = ParentConfigGoDirectParam + ".last"
const ParentConfigGoDirectMid = ParentConfigGoDirectParam + ".mid"
const ParentConfigGoDirectParam = "go_direct"
const ParentConfigParamAlgorithm = "algorithm"
ParentConfigParamAlgorithm is the Name of a Parameter that can be used to set the parent selection algorithm for cache servers that use Origin Shields.
const ParentConfigParamMSOAlgorithm = "mso.algorithm"
ParentConfigParamMSOAlgorithm is the Name of a Parameter that can be used to set the parent selection algorithm for Delivery Services that use MSO, if found in their Profile.
This has no known effect if found in a server Profile.
const ParentConfigParamMSOMaxSimpleRetries = "mso.max_simple_retries"
ParentConfigParamMSOMaxSimpleRetries is the Name of a Parameter that can be used to set the maximum number of "simple" retries a cache server will attempt when its parent is unavailable, if found in the Profile of an MSO Delivery Service.
Refer to ATS Documentation for the difference between this and ParentConfigParamMSOMaxUnavailableServerRetries.
ParentConfigParamMSOMaxUnavailableServerRetries is the Name of a Parameter that can be used to set the maximum number of retries a cache server will attempt when its parent is unavailable, if found in the Profile of an MSO Delivery Service.
Refer to ATS Documentation for the difference between this and ParentConfigParamMSOMaxSimpleRetries.
const ParentConfigParamMSOParentRetry = "mso.parent_retry"
ParentConfigParamMSOParentRetry is the Name of a Parameter that can be used to set the retry behavior of cache servers trying to reach a parent for an MSO Delivery Service, if found in the Profile of said Delivery Service.
ParentConfigParamMSOUnavailableServerRetryResponses is the Name of a Parameter that can be used to set the HTTP response codes that a cache server will consider indicative of its parent being unavailable, if found in the Profile of an MSO Delivery Service.
The format is defined by the grammar of the parent.config ATS configuration file.
const ParentConfigParamMaxSimpleRetries = "max_simple_retries"
ParentConfigParamMaxSimpleRetries is the Name of a Parameter that can be used to set the maximum number of "simple" retries a cache server will attempt when its parent is unavailable, if found in the Profile of a non-MSO Delivery Service.
Refer to ATS Documentation for the difference between this and ParentConfigParamMaxUnavailableServerRetries.
ParentConfigParamMaxUnavailableServerRetries is the Name of a Parameter that can be used to set the maximum number of retries a cache server will attempt when its parent is unavailable, if found in the Profile of a non-MSO Delivery Service.
Refer to ATS Documentation for the difference between this and ParentConfigParamMaxSimpleRetries.
const ParentConfigParamMergeGroups = "merge_parent_groups"
ParentConfigParamMergeGroups is the Name of a Parameter on Delivery Service Profiles that is used to specify a list of Cache Group names that should merge their secondary parents into their set of primary parents when servicing content for said Delivery Service.
const ParentConfigParamParentRetry = "parent_retry"
ParentConfigParamParentRetry is the Name of a Parameter which can be used to directly set the argument to the parent_retry directive in a line in a parent.config ATS configuration file, if found in the Profile of the Delivery Service represented by that line.
const ParentConfigParamQString = "qstring"
ParentConfigParamQString is the Name of a Parameter that can be used to set the query string handling behavior for the default destination for non-top-level cache servers.
const ParentConfigParamQStringHandling = "psel.qstring_handling"
ParentConfigParamQStringHandling is the Name of a Parameter in the ConfigFile parent.config that will override the text of the argument 'qstring' in a line in parent.config for ALL Delivery Services if found in the Profile of the server for which parent.config is being generated, or ALL servers for the Delivery Service if found in the Profile of a Delivery Service.
Server Profiles have priority when conflicts arise.
const ParentConfigParamSecondaryMode = "try_all_primaries_before_secondary"
ParentConfigParamSecondaryMode is the Name of a Parameter that, if it is found on a server's Profile, will cause the cache server to try all primary parents before resorting to a secondary parent (which presumably differs from the default behavior in some way).
The Value of these Parameters have no meaning; the Parameter's existence is all of the information it conveys.
ParentConfigParamUnavailableServerRetryResponses is the Name of a Parameter that can be used to set the HTTP response codes that a cache server will consider indicative of its parent being unavailable, if found in the Profile of a non-MSO Delivery Service.
The format is defined by the grammar of the parent.config ATS configuration file.
const ParentDotConfigParentSeparator = `;`
ParentDotConfigParentSeparator is the string used to delimit multiple parents on a line in a parent.config Apache Traffic Server configuration file.
const PluginFileName = "plugin.config"
PluginFileName is the name of the configuration file used by ATS to configure its plugins, as well as the ConfigFile value of Parameters that can affect the contents of this file.
const PluginSeparator = " "
PluginSeparator is the string used to separate Parameter Names from their Values for lines in plugin.config configuration files.
const RecordsFileName = "records.config"
RecordsFileName is the name of the configuration file used by ATS to configure various miscellaneous options, as well as the ConfigFile value of Parameters that can affect the contents of this file.
const RecordsSeparator = " "
RecordsSeparator is the string used to separate Parameter Names from their Values for lines in records.config configuration files.
const RefetchSuffix = "##REFETCH##"
RefetchSuffix is a special suffix which, if present at the end of an asset URL for a Content Invalidation Job, will cause ATS to treat matching URIs as cache "misses" - effectively this forces ATS to fetch the asset anew from an upstream cache server or origin.
const RefreshSuffix = "##REFRESH##"
RefreshSuffix is a special suffix which, if present at the end of an asset URL for a Content Invalidation Job, will cause ATS to treat matching URIs as "stale" - effectively this forces ATS to retrieve confirmation from an upstream cache server or origin that the cached content is still valid, and according to their response either fetch the content anew or update its age and caching validity markers (ETag, If-Unmodified-Since etc.).
const RegexRemapPrefix = "regex_remap_"
RegexRemapPrefix is a prefix applied to regex_remap.config ATS configuration files for a sepecific Delivery Service. The rest of the name is made up of the Delivery Service's XMLID, followed by '.config' as a suffix (or "file extension").
const RegexRevalidateFileName = "regex_revalidate.config"
RegexRevalidateFileName is the name of a configuration file used by ATS to revalidate or invalidate cached contents based on regular expression matches. This is also the ConfigFile value of GLOBAL Parameters that modify how content invalidation is handled.
const RegexRevalidateMaxRevalDurationDaysParamName = "maxRevalDurationDays"
RegexRevalidateMaxRevalDurationDaysParamName is the Name of a GLOBAL Parameter that can be used to set the maximum duration (in days) of Content Invalidation Requests.
const RegexRevalidateMinTTL = time.Hour
RegexRevalidateMinTTL is a time.Duration that specifies the minimum duration for which Content Invalidation Jobs will remain active. Content Invalidation Jobs with TTLs less than this will use this duration instead.
const RemapConfigCachekeyDirective = `__CACHEKEY_DIRECTIVE__`
RemapConfigCachekeyDirective is a special string which, if found in a Delivery Service's Raw Remap Text, will be replaced by t3c during configuration generation with the parts of a remap.config file line that call the 'cachekey.so' ATS plugin.
const RemapConfigDropQstringConfigFile = `drop_qstring.config`
RemapConfigDropQstringConfigFile is the configuration file for the `drop_qstring` plugin used in remap.config files.
const RemapConfigRangeDirective = `__RANGE_DIRECTIVE__`
RemapConfigRangeDirective is a special string which, if found in a Delivery Service's Raw Remap Text, will be replaced by t3c during configuration generation with the parts of a remap.config file line that are necessary to implement said Delivery Service's declared Range Request Handling.
const RemapConfigRegexRemapDirective = `__REGEX_REMAP_DIRECTIVE__`
RemapConfigRegexRemapDirective is a special string which, if found in a Delivery Service's Raw Remap Text, will be replaced by t3c during configuration generation with the parts of a remap.config file line that call the 'regex_remap.so' ATS plugin.
const RemapConfigTemplateFirst = `template.first`
const RemapConfigTemplateInner = `template.inner`
const RemapConfigTemplateLast = `template.last`
const RemapFile = "remap.config"
RemapFile is the name of a configuration file used by ATS to map client requests.
TODO: replace instances of "remap.config" with this constant.
const RevalTypeDefault = RevalTypeStale
RevalTypeDefault is the type of revalidation that will be performed by default, if not otherwise specified.
const RevalTypeMiss = RevalType("MISS")
RevalTypeMiss represents the caching condition where the asset requested could not be found in cache.
const RevalTypeStale = RevalType("STALE")
RevalTypeStale represents the caching condition where the asset requested is in cache, but it has expired and must be revalidated upstream.
const SNIDotYAMLFileName = "sni.yaml"
SNIDotYAMLFileName is an unused constant that probably defines either the name on disk of an sni.yaml ATS configuration file, the ConfigFile value of Parameters that may influence the generation of such files, or both.
TODO: replace instances of sni.yaml with this constant.
const SSLMultiCertConfigFileName = `ssl_multicert.config`
SSLMultiCertConfigFileName is the name of an ATS configuration file which contains information on the locations of one or more SSL key and certificate pairs.
const SSLServerNameYAMLFileName = "ssl_server_name.yaml"
SSLServerNameYAMLFileName is an unused constant that probably refers to the name of an ATS ssl_server_name.yaml file on disk, the ConfigFile value of Parameters that can affect the generation of such a file, or both.
const SSLServerNameYAMLParamEnableH2 = "enable_h2"
SSLServerNameYAMLParamEnableH2 is the Name of a Parameter which, if found on the Profile of a Delivery Service and having the ConfigFile value "parent.config" - NOT ssl_server_name.yaml, which would cause it to be ignored - will enable the use of the HTTP/2 protocol for Delivery Services if its value begins with 'T', 't', 'Y', or 'y'.
Examples of Values for these Parameters that would cause HTTP/2 to be enabled are:
true TrUe Yes yno yFalse tFalse talse ts"<>an177otehucau$%*(@YDU)
Examples of Values for these Parameters that would cause HTTP/2 to be disabled are:
false No off on use enable 1 affirmative I wish to use this feature frue nYes s"<>an177otehucau$%*(@YDU)
const SSLServerNameYAMLParamTLSVersions = "tls_versions"
SSLServerNameYAMLParamTLSVersions is the Name of a Parameter which, if found on the Profile of a Delivery Service and having the ConfigFile value "parent.config" - NOT ssl_server_name.yaml, which would cause it to be ignored - will set the explicitly allowed TLS versions for communication with edge-tier cache servers.
The Value of such Parameters should be a list of TLS versions, which may be separated by spaces, new lines, semicolons, or commas (but only one thereof, and only consistently a single of those delimeters, not a mixture).
Deprecated: Now that Delivery Services support setting TLS versions to be explicitly allowed directly on their configuration, that feature should be used rather than this Parameter.
const ServerCacheDotConfigIncludeInactiveDSes = false
ServerCacheDotConfigIncludeInactiveDSes is the definition of whether or not inactive Delivery Services should be considered when generating the contents of a cache.config ATS configuration file.
const ServerHostingDotConfigEdgeIncludeInactive = true
ServerHostingDotConfigEdgeIncludeInactive controls whether or not to include configurations for inactive Delivery Services in hosting.config for edge-tier cache servers.
const ServerHostingDotConfigMidIncludeInactive = false
ServerHostingDotConfigMidIncludeInactive controls whether or not to include configurations for inactive Delivery Services in hosting.config for mid-tier cache servers.
const ServiceCategoryHeader = "@CDN-SVC"
ServiceCategoryHeader is the internal service category header for logging the service category. Note this is internal, and will never be set in an HTTP Request or Response by ATS.
const StorageFileName = "storage.config"
StorageFileName is the ConfigFile of Parameters which, if found on a server's Profile, will affect the generation of its storage.config ATS configuration file.
const StrategyConfigUsePeering = "use_peering"
StrategyConfigUsePeering is the Name of a Parameter which, if it exists on a Delivery Service's Profile and has the Value of exactly "true", causes cache servers assigned to service that Delivery Service's content to use "peering" mode for secondary parent selection. Note that this is not (yet?) implemented in strategies.yaml generation.
const SysctlFileName = "sysctl.conf"
SysctlFileName is the ConfigFile of Parameters which, if found on a server's Profile, specify lines in the sysctl.conf ATS configuration file.
const SysctlSeparator = " = "
SysctlSeparator is the string used to separate Parameter Names from their Values on lines of a sysctl.conf ATS configuration file.
const TLSVersionInvalid = TLSVersion("")
TLSVersionInvalid is used to represent an unrecognized or unsupported TLS version.
const TsDefaultRequestHeaderMaxSize = 131072
TsDefaultRequestHeaderMaxSize is the default maximum request header size that will be allowed by ATS unless otherwise specified on a server's Profile.
For more information, refer to the ATS documentation for the reconds.config configuration option 'proxy.config.http.request_header_max_size'.
const VolumeFileName = StorageFileName
VolumeFileName is the ConfigFile of Parameters which can influence the generation of a volume.config ATS configuration file, if found on the Profile of the server for which generation is taking place.
const YAMLActionAllow = "allow"
YAMLActionAllow specifies that the block to which it belongs specifies that matching IP addresses should be explicitly allowed to use the associated HTTP request methods.
const YAMLActionDeny = "deny"
YAMLActionDeny specifies that the block to which it belongs specifies that matching IP addresses should be explicitly NOT allowed to use the associated HTTP request methods.
const YAMLDocumentEnd = "..."
YAMLDocumentEnd is the symbol used in the YAML grammar to indicate the end of the "document", which simultaneously constitutes the beginning of the zero or more "directives" (again).
const YAMLDocumentStart = "---"
YAMLDocumentStart is the symbol used in the YAML grammar to indicate the end of "directives", which simultaneously constitutes the beginning of the "document".
const YAMLMethodAll = "ALL"
YAMLMethodAll is a possible HTTP request method that may be given/denied to IP addresses in ipallow.yaml configuration files, which has the special meaning "all HTTP request methods".
Variables ¶
var ( ParentConfigRetryKeysFirst = MakeParentConfigRetryKeysWithPrefix("first.") ParentConfigRetryKeysInner = MakeParentConfigRetryKeysWithPrefix("inner.") ParentConfigRetryKeysLast = MakeParentConfigRetryKeysWithPrefix("last.") ParentConfigRetryKeysMSO = MakeParentConfigRetryKeysWithPrefix("mso.") ParentConfigRetryKeysDefault = MakeParentConfigRetryKeysWithPrefix("") )
These are the standard prefixes for different kinds of Delivery Service retry rules.
var DefaultDefaultTLSVersions = []TLSVersion{ TLSVersion1p0, TLSVersion1p1, TLSVersion1p2, TLSVersion1p3, }
DefaultDefaultTLSVersions is the list of TLS versions to enable by default, if no Parameter exists and no Opt is passed to the Make func. By default, we enable all, even insecure versions. As a CDN, Traffic Control assumes it should not break clients, and it's the client's responsibility to use secure protocols. Note this enables certain downgrade attacks. Operators or tenants concerned about these attacks should disable older TLS versions.
var DefaultSimpleRetryCodes = []int{404}
DefaultSimpleRetryCodes is the set of HTTP response codes that are used to indicate a parent should be "retried" if none are explicitly configured.
DefaultUnavailableServerRetryCodes is the set of HTTP response codes that are used to indicate a parent is "unavailable" and should be "retried" if none are explicitly configured.
var RemapLineTemplates = LineTemplates{}
Functions ¶
func BoolOnOff ¶
BoolOnOff returns 'on' if b, else 'off'. This is a helper func for some ATS config files that use "on" and "off" for boolean values.
func DeliveryServicesToSSLMultiCertDSes ¶
func DeliveryServicesToSSLMultiCertDSes(dses []DeliveryService) (map[tc.DeliveryServiceName]sslMultiCertDS, []string)
DeliveryServicesToSSLMultiCertDSes returns the "SSLMultiCertDS" map, and any warnings.
func FirstHeaderRewriteConfigFileName ¶
FirstHeaderRewriteConfigFileName returns the full name of a configuration file for the Header Rewrite ATS plugin for a cache server at the first tier of a Topology.
The dsName passed in should NOT be the Delivery Service's Display Name, it should be its "XMLID".
func GetATSMajorVersionFromATSVersion ¶
GetATSMajorVersionFromATSVersion returns the major version of the given profile's package trafficserver parameter. The atsVersion is typically a Parameter on the Server's Profile, with the configFile "package" name "trafficserver". Returns an error if atsVersion is empty or does not start with an unsigned integer followed by a period or nothing.
func GetAllowedCIDRsForMid ¶
func GetAllowedCIDRsForMid( server *Server, servers []Server, cacheGroups []tc.CacheGroupNullableV5, topologies []tc.TopologyV5, coalesceNumberV4 int, coalesceMaskLenV4 int, coalesceNumberV6 int, coalesceMaskLenV6 int, ) ([]*net.IPNet, []*net.IPNet, []string, error)
GetAllowedCIDRsForMid returns CIDRs allowed for all methods other than Push and Purge to mid servers.
func GetAnyCastPartners ¶
func GetCoalesceMaskAndNumber ¶
GetCoalesceMaskAndNumber returns coalesce mask length and number for ipv4 and ipv6.
func GetDSParameters ¶
func GetDSParameters( ds *DeliveryService, params []tc.ParameterV5, ) ([]tc.ParameterV5, error)
GetDSParameters returns the parameters for the given Delivery Service.
func GetDSRequestFQDNs ¶
func GetDSRequestFQDNs(ds *DeliveryService, regexes []tc.DeliveryServiceRegex, server *Server, anyCastPartners map[string][]string, cdnDomain string) ([]string, error)
GetDSRequestFQDNs returns the FQDNs that clients will request from the edge.
func GetHostPortFromURI ¶
GetHostPortFromURI strips HTTP(s) scheme and path and return host with port (if found).
func GetPurgeIPs ¶
func GetPurgeIPs(serverParams []tc.ParameterV5) []string
GetPurgeIPs returns IPs allowed for PURGE requests.
func GetSSLMultiCertDotConfigCertAndKeyName ¶
func GetSSLMultiCertDotConfigCertAndKeyName(dsName tc.DeliveryServiceName, ds sslMultiCertDS) (string, string)
GetSSLMultiCertDotConfigCertAndKeyName returns the cert file name and key file name for the given delivery service.
func GetSSLMultiCertDotConfigDeliveryServices ¶
func GetSSLMultiCertDotConfigDeliveryServices(dses map[tc.DeliveryServiceName]sslMultiCertDS) map[tc.DeliveryServiceName]sslMultiCertDS
GetSSLMultiCertDotConfigDeliveryServices takes a list of delivery services, and returns the delivery services which will be inserted into the config by MakeSSLMultiCertDotConfig. This is public, so users can see which Delivery Services are used, without parsing the config file. For example, this is useful to determine which certificates are needed.
func GetServerParameters ¶
GetServerParameters returns the parameters for the given Server, per the Layered Profiles feature. See LayerProfiles.
func InnerHeaderRewriteConfigFileName ¶
InnerHeaderRewriteConfigFileName returns the full name of a configuration file for the Header Rewrite ATS plugin for a cache server at the first tier of a Topology.
The dsName passed in should NOT be the Delivery Service's Display Name, it should be its "XMLID".
func IsGoDirect ¶
func IsGoDirect(ds DeliveryService) bool
IsGoDirect checks if this ds type is edge only.
func LastHeaderRewriteConfigFileName ¶
LastHeaderRewriteConfigFileName returns the full name of a configuration file for the Header Rewrite ATS plugin for a cache server at the first tier of a Topology.
The dsName passed in should NOT be the Delivery Service's Display Name, it should be its "XMLID".
func LayerProfiles ¶
LayerProfiles takes an ordered list of profile names (presumably from a Server or Delivery Service), and the Parameters from Traffic Ops (which includes Profile-Parameters data), and layers the parameters according to the ordered list of profiles.
Returns the appropriate parameters for the Server, Delivery Service, or other object containing an ordered list of profiles.
func MakeDSRegexMap ¶
func MakeDSRegexMap(regexes []tc.DeliveryServiceRegexes) map[tc.DeliveryServiceName][]tc.DeliveryServiceRegex
func ParentAbstractionServiceParentsToParentDotConfigLine ¶
func ParentAbstractionServiceParentsToParentDotConfigLine(parents []*ParentAbstractionServiceParent) string
ParentAbstractionServiceParentsToParentDotConfigLine creates a line in the parent.config implementation of a parenting configuration file given the set of parents it should configure.
func ParentSelectParamQStringHandlingToBool ¶
ParentSelectParamQStringHandlingToBool returns whether the param is to use the query string in the parent select algorithm or not. If the parameter value is not valid, returns nil.
func ParseRetryResponses ¶
ParseRetryResponses parses a raw Parameter Value containing HTTP response codes for scenarios when parents should be "retried" into a list of the actual numeric codes.
func ProfilesMatch ¶
ProfilesMatch takes two ordered lists of profile names (such as from Servers or Delivery Services) and returns whether they contain the same profiles in the same order, and thus whether they will contain the same Parameters.
func ServerProfilesMatch ¶
ServerProfilesMatch returns whether both servers have the same Profiles in the same order, and thus will have the same Parameters.
func ToCacheGroup ¶
func ToCacheGroup(cacheGroup tc.CacheGroupNullable) tc.CacheGroupNullableV5
func ToCacheGroups ¶
func ToCacheGroups(cacheGroups []tc.CacheGroupNullable) []tc.CacheGroupNullableV5
func ToTopologies ¶
func ToTopologies(topologies []tc.Topology) []tc.TopologyV5
func ToTopology ¶
func ToTopology(topology tc.Topology) tc.TopologyV5
Types ¶
type AStatsDotConfigOpts ¶
type AStatsDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
AStatsDotConfigOpts contains settings to configure generation options.
type ATSDotRulesOpts ¶
type ATSDotRulesOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
ATSDotRulesOpts contains settings to configure generation options.
type BGFetchDotConfigOpts ¶
type BGFetchDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
BGFetchDotConfigOpts contains settings to configure generation options.
type CacheDotConfigOpts ¶
type CacheDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
CacheDotConfigOpts contains settings to configure generation options.
type CacheGroupType ¶
type CacheGroupType string
CacheGroupType is used internally to represent the Name of the Type of a Cache Group.
TODO: Unexport? This isn't used outside of this package. Alternatively: remove? lib/go-tc and cache-config/* use strings, so all this is doing is causing spurious casting back and forth.
type Cfg ¶
Cfg is the data and metadata for an ATS Config File.
This includes the text, the content type (which is necessary for HTTP, multipart, and other things), and the line comment syntax if any.
This is what is generated by the lib/go-atscfg library. Note it does not include the file name or path, which this library doesn't have enough information to return and is not part of generation. That information should be fetched from Traffic Ops, along with the data used to generate config files, or else generated from the machine. See CfgFile.
func Make12MFacts ¶
func Make12MFacts( server *Server, opt *Config12MFactsOpts, ) (Cfg, error)
Make12MFacts constructs a 12M_facts file for the given server with the given header comment contents.
func MakeAStatsDotConfig ¶
func MakeAStatsDotConfig( server *Server, serverParams []tc.ParameterV5, opt *AStatsDotConfigOpts, ) (Cfg, error)
MakeAStatsDotConfig constructs an astats.config file for the given server with the given Parameters and header comment content.
TODO: Rename to 'MakeAstatsDotConfig' for consistency with other exported symbols?
func MakeATSDotRules ¶
func MakeATSDotRules( server *Server, serverParams []tc.ParameterV5, opt *ATSDotRulesOpts, ) (Cfg, error)
MakeATSDotRules constructs a '50-ats.rules' file for the given server with the given parameters and header comment content.
func MakeBGFetchDotConfig ¶
func MakeBGFetchDotConfig( server *Server, opt *BGFetchDotConfigOpts, ) (Cfg, error)
MakeBGFetchDotConfig constructs a 'bg_fetch.config' file for the given server with the given header comment content.
func MakeCacheDotConfig ¶
func MakeCacheDotConfig( server *Server, servers []Server, deliveryServices []DeliveryService, deliveryServiceServers []DeliveryServiceServer, opt *CacheDotConfigOpts, ) (Cfg, error)
MakeCacheDotConfig makes the ATS cache.config config file.
func MakeChkconfig ¶
func MakeChkconfig( serverParams []tc.ParameterV5, opt *ChkconfigOpts, ) (Cfg, error)
MakeChkconfig returns the 'chkconfig' ATS config file endpoint.
This is a JSON object, and should be served with an 'application/json' Content-Type.
TODO: rename/rework? We systemd now, after all. Also, this may be unused as t3c now generates the contents of the file specially without calling into this function, possibly.
func MakeDropQStringDotConfig ¶
func MakeDropQStringDotConfig( server *Server, serverParams []tc.ParameterV5, opt *DropQStringDotConfigOpts, ) (Cfg, error)
MakeDropQStringDotConfig constructs a drop_qstring.config file for the given server with the given Parameters and header comment content.
func MakeHeaderRewriteDotConfig ¶
func MakeHeaderRewriteDotConfig( fileName string, deliveryServices []DeliveryService, deliveryServiceServers []DeliveryServiceServer, server *Server, servers []Server, cacheGroupsArr []tc.CacheGroupNullableV5, tcServerParams []tc.ParameterV5, serverCapabilities map[int]map[ServerCapability]struct{}, requiredCapabilities map[int]map[ServerCapability]struct{}, topologiesArr []tc.TopologyV5, opt *HeaderRewriteDotConfigOpts, ) (Cfg, error)
MakeHeaderRewriteDotConfig makes the header rewrite file for an Edge hdr_rw_ or Mid hdr_rw_mid_ or Topology hdr_rw_{first,inner,last} file, as generated by MakeMetaConfigFilesList.
func MakeHostingDotConfig ¶
func MakeHostingDotConfig( server *Server, servers []Server, serverParams []tc.ParameterV5, deliveryServices []DeliveryService, deliveryServiceServers []DeliveryServiceServer, topologies []tc.TopologyV5, opt *HostingDotConfigOpts, ) (Cfg, error)
MakeHostingDotConfig generates a hosting.config file for a server.
func MakeIPAllowDotConfig ¶
func MakeIPAllowDotConfig( serverParams []tc.ParameterV5, server *Server, servers []Server, cacheGroups []tc.CacheGroupNullableV5, topologies []tc.TopologyV5, opt *IPAllowDotConfigOpts, ) (Cfg, error)
MakeIPAllowDotConfig creates the ip_allow.config ATS config file. The childServers is a list of servers which are children for this Mid-tier server. This should be empty for Edge servers. More specifically, it should be the list of edges whose cachegroup's parent_cachegroup or secondary_parent_cachegroup is the cachegroup of this Mid server.
func MakeIPAllowDotYAML ¶
func MakeIPAllowDotYAML( serverParams []tc.ParameterV5, server *Server, servers []Server, cacheGroups []tc.CacheGroupNullableV5, topologies []tc.TopologyV5, opt *IPAllowDotYAMLOpts, ) (Cfg, error)
MakeIPAllowDotYAML creates the ip_allow.yaml ATS 9+ config file.
func MakeLoggingDotConfig ¶
func MakeLoggingDotConfig( server *Server, serverParams []tc.ParameterV5, opt *LoggingDotConfigOpts, ) (Cfg, error)
MakeLoggingDotConfig creates a logging.config for a given ATS Profile.
serverParams is expected to be the map of Parameter Names to Values of all Parameters assigned to the given Profile, that have the ConfigFile "logging.config". That is, they must already be filtered BEFORE being passed in here.
func MakeLoggingDotYAML ¶
func MakeLoggingDotYAML( server *Server, serverParams []tc.ParameterV5, opt *LoggingDotYAMLOpts, ) (Cfg, error)
MakeLoggingDotYAML creates a logging.yaml for a given ATS Profile.
serverParams is expected to be the map of Parameter Names to Values of all Parameters assigned to the given Profile, that have the ConfigFile "logging.config". That is, they must already be filtered BEFORE being passed in here.
func MakeLogsXMLDotConfig
deprecated
func MakeLogsXMLDotConfig( server *Server, serverParams []tc.ParameterV5, opt *LogsXMLDotConfigOpts, ) (Cfg, error)
MakeLogsXMLDotConfig constructs a logging configuration file used by ATS version 6 and earlier for the given server.
serverParams is expected to be the map of Parameter Names to Values of all Parameters assigned to the given Profile, that have the ConfigFile "logging.config". That is, they must already be filtered BEFORE being passed in here.
Deprecated: The versions of ATS that use this file are not supported, either by ATC or the ATS project itself.
func MakePackages ¶
func MakePackages( serverParams []tc.ParameterV5, opts *PackagesOpts, ) (Cfg, error)
MakePackages returns the 'packages' ATS config file endpoint. This is a JSON object, and should be served with an 'application/json' Content-Type.
func MakeParentDotConfig ¶
func MakeParentDotConfig( dses []DeliveryService, server *Server, servers []Server, topologies []tc.TopologyV5, tcServerParams []tc.ParameterV5, tcParentConfigParams []tc.ParameterV5, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, cacheGroupArr []tc.CacheGroupNullableV5, dss []DeliveryServiceServer, cdn *tc.CDNV5, opt *ParentConfigOpts, ) (Cfg, error)
MakeParentDotConfig constructs a parent.config file for a cache server.
dses should be ALL of the Delivery Services in the same CDN as the cache server in question, NOT just those to which the server is itself assigned. tcServerParams shsould be ALL of the server's Profile's Parameters, and tcParentConfigParams must be pre-filtered as the Parameters in the server's Profile that have the ConfigFile value "parent.config".
func MakePluginDotConfig ¶
func MakePluginDotConfig( server *Server, serverParams []tc.ParameterV5, opt *PluginDotConfigOpts, ) (Cfg, error)
MakePluginDotConfig constructs a plugin.config configuration file for the given server with the given Parameters and the given header comment content.
func MakeRecordsDotConfig ¶
func MakeRecordsDotConfig( server *Server, serverParams []tc.ParameterV5, opt *RecordsConfigOpts, ) (Cfg, error)
MakeRecordsDotConfig constructs a records.config ATS configuration file for the given server with the given Parameters and header comment content, as well as any customization options.
func MakeRegexRemapDotConfig ¶
func MakeRegexRemapDotConfig( fileName string, server *Server, deliveryServices []DeliveryService, opt *RegexRemapDotConfigOpts, ) (Cfg, error)
MakeRegexRemapDotConfig constructs a regex_remap.config file (specifically the name is given by 'fileName') for a cache server.
func MakeRegexRevalidateDotConfig ¶
func MakeRegexRevalidateDotConfig( server *Server, deliveryServices []DeliveryService, globalParams []tc.ParameterV5, jobs []InvalidationJob, opt *RegexRevalidateDotConfigOpts, ) (Cfg, error)
MakeRegexRevalidateDotConfig constructs a regex_revalidate.config file for the given server, which is responsible for serving content for the given Delivery Services, with the given set of "global" Parameters (NOT server or Delivery Service Profile Parameters), and the given set of Content Invalidation Jobs.
func MakeRemapDotConfig ¶
func MakeRemapDotConfig( server *Server, servers []Server, unfilteredDSes []DeliveryService, dss []DeliveryServiceServer, dsRegexArr []tc.DeliveryServiceRegexes, serverParams []tc.ParameterV5, cdn *tc.CDNV5, remapConfigParams []tc.ParameterV5, topologies []tc.TopologyV5, cacheGroupArr []tc.CacheGroupNullableV5, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, configDir string, opt *RemapDotConfigOpts, ) (Cfg, error)
MakeRemapDotConfig constructs a remap.config ATS configuration file.
func MakeSNIDotYAML ¶
func MakeSNIDotYAML( server *Server, servers []Server, dses []DeliveryService, dss []DeliveryServiceServer, dsRegexArr []tc.DeliveryServiceRegexes, tcParentConfigParams []tc.ParameterV5, cdn *tc.CDNV5, topologies []tc.TopologyV5, cacheGroupArr []tc.CacheGroupNullableV5, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, opt *SNIDotYAMLOpts, ) (Cfg, error)
MakeSNIDotYAML constructs an sni.yaml ATS configuration file.
func MakeSSLMultiCertDotConfig ¶
func MakeSSLMultiCertDotConfig( server *Server, deliveryServices []DeliveryService, opt *SSLMultiCertDotConfigOpts, ) (Cfg, error)
MakeSSLMultiCertDotConfig constructs an ssl_multicert.config ATS configuration file for the given server.
func MakeSSLServerNameYAML ¶
func MakeSSLServerNameYAML( server *Server, servers []Server, dses []DeliveryService, dss []DeliveryServiceServer, dsRegexArr []tc.DeliveryServiceRegexes, tcParentConfigParams []tc.ParameterV5, cdn *tc.CDNV5, topologies []tc.TopologyV5, cacheGroupArr []tc.CacheGroupNullableV5, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, opt *SSLServerNameYAMLOpts, ) (Cfg, error)
MakeSSLServerNameYAML constructs an ssl_server_name.yaml ATS configuration file.
func MakeServerUnknown ¶
func MakeServerUnknown( fileName string, server *Server, serverParams []tc.ParameterV5, opt *ServerUnknownOpts, ) (Cfg, error)
MakeServerUnknown constructs an arbitrary file for a server that is not handled specially and has no known (or knowable) semantics.
func MakeSetDSCPDotConfig ¶
func MakeSetDSCPDotConfig( fileName string, server *Server, opt *SetDSCPDotConfigOpts, ) (Cfg, error)
MakeSetDSCPDotConfig constructs a configuration file for setting the DSCP of IP packets with ATS.
func MakeStorageDotConfig ¶
func MakeStorageDotConfig( server *Server, serverParams []tc.ParameterV5, opt *StorageDotConfigOpts, ) (Cfg, error)
MakeStorageDotConfig creates storage.config for a given ATS Profile. The paramData is the map of parameter names to values, for all parameters assigned to the given profile, with the config_file "storage.config".
func MakeStrategiesDotYAML ¶
func MakeStrategiesDotYAML( dses []DeliveryService, server *Server, servers []Server, topologies []tc.TopologyV5, tcServerParams []tc.ParameterV5, tcParentConfigParams []tc.ParameterV5, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, cacheGroupArr []tc.CacheGroupNullableV5, dss []DeliveryServiceServer, cdn *tc.CDNV5, opt *StrategiesYAMLOpts, ) (Cfg, error)
MakeStrategiesDotYAML constructs a strategies.yaml ATS configuration file.
func MakeSysCtlDotConf ¶
func MakeSysCtlDotConf( server *Server, serverParams []tc.ParameterV5, opt *SysCtlDotConfOpts, ) (Cfg, error)
MakeSysCtlDotConf generates a sysctl.conf ATS configuration file for the given server with the given Parameters.
func MakeURISigningConfig ¶
func MakeURISigningConfig( fileName string, uriSigningKeys map[tc.DeliveryServiceName][]byte, opt *URISigningConfigOpts, ) (Cfg, error)
MakeURISigningConfig constructs a uri_signing.config ATS configuration file with the given mapping of Delivery Service XMLIDs to URI Signing keys.
func MakeURLSigConfig ¶
func MakeURLSigConfig( fileName string, server *Server, serverParams []tc.ParameterV5, allURLSigKeys map[tc.DeliveryServiceName]tc.URLSigKeys, opt *URLSigConfigOpts, ) (Cfg, error)
MakeURLSigConfig constructs a url_sig.config ATS configuration file for the given server that has the given Parameters.
func MakeVolumeDotConfig ¶
func MakeVolumeDotConfig( server *Server, serverParams []tc.ParameterV5, opt *VolumeDotConfigOpts, ) (Cfg, error)
MakeVolumeDotConfig creates volume.config for a given ATS Profile. The paramData is the map of parameter names to values, for all parameters assigned to the given profile, with the config_file "storage.config".
type CfgFile ¶
CfgFile is all the information necessary to create an ATS config file, including the file name, path, data, and metadata. This is provided as a convenience and unified structure for users. The lib/go-atscfg library doesn't actually use or return this. See ATSConfigFileData.
type CfgMeta ¶
type CfgMeta struct {
// Name is the basename of the file itself.
Name string
// Path is the absolute path to the directory containing the file.
Path string
}
CfgMeta is a definition of the location of an arbitrary configuration file.
func MakeConfigFilesList ¶
func MakeConfigFilesList( configDir string, server *Server, serverParams []tc.ParameterV5, deliveryServices []DeliveryService, deliveryServiceServers []DeliveryServiceServer, globalParams []tc.ParameterV5, cacheGroupArr []tc.CacheGroupNullableV5, topologies []tc.TopologyV5, opt *ConfigFilesListOpts, ) ([]CfgMeta, []string, error)
MakeConfigFilesList returns the list of configuration files that need to be generated for the given server, any warnings, and any error.
type ChkconfigOpts ¶
type ChkconfigOpts struct {
}
ChkconfigOpts contains settings to configure generation options.
type Config12MFactsOpts ¶
type Config12MFactsOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
Config12MFactsOpts contains settings to configure generation options.
type ConfigFilesListOpts ¶
type ConfigFilesListOpts struct {
// ATSMajorVersion is the integral major version of Apache Traffic server,
// used to generate the proper config for the proper version.
//
// If omitted or 0, the major version will be read from the Server's Profile Parameter config file 'package' name 'trafficserver'. If no such Parameter exists, the ATS version will default to 5.
// This was the old Traffic Control behavior, before the version was specifiable externally.
//
ATSMajorVersion uint
}
ConfigFilesListOpts contains settings to configure generation options.
type DeliveryService ¶
type DeliveryService tc.DeliveryServiceV5
DeliveryService is a tc.DeliveryService for the latest lib/go-tc and traffic_ops/vx-client type. This allows atscfg to not have to change the type everywhere it's used, every time ATC changes the base type, but to only have to change it here, and the places where breaking symbol changes were made.
func ToDeliveryServices ¶
func ToDeliveryServices(dses []tc.DeliveryServiceV5) []DeliveryService
ToDeliveryServices converts a slice of the latest lib/go-tc and traffic_ops/vx-client type to the local alias.
func V5ToDeliveryServices ¶
func V5ToDeliveryServices(dses []tc.DeliveryServiceV5) []DeliveryService
V50ToDeliveryServices converts a slice of the traffic_ops/v5-client type to the local alias.
type DeliveryServiceID ¶
type DeliveryServiceID int
DeliveryServiceID is used internally to represent a Delivery Service ID.
TODO: Unexport? This isn't used outside of this package. Alternatively: remove? lib/go-tc and cache-config/* use ints, so all this is doing is causing spurious casting back and forth.
type DeliveryServiceServer ¶
DeliveryServiceServer is a compact version of DeliveryServiceServer. The Delivery Service Servers is massive on large CDNs not using Topologies, compacting it in JSON and dropping the timestamp drastically reduces the size. The t3c apps will also drop any DSS from Traffic Ops with null values, which are invalid and useless, to avoid pointers and further reduce size.
type DropQStringDotConfigOpts ¶
type DropQStringDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
DropQStringDotConfigOpts contains settings to configure generation options.
type HeaderRewriteDotConfigOpts ¶
type HeaderRewriteDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
// ATSMajorVersion is the integral major version of Apache Traffic server,
// used to generate the proper config for the proper version.
//
// If omitted or 0, the major version will be read from the Server's Profile Parameter config file 'package' name 'trafficserver'. If no such Parameter exists, the ATS version will default to 5.
// This was the old Traffic Control behavior, before the version was specifiable externally.
//
ATSMajorVersion uint
}
HeaderRewriteDotConfigOpts contains settings to configure generation options.
type HostingDotConfigOpts ¶
type HostingDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
HostingDotConfigOpts contains settings to configure generation options.
type IPAllowDotConfigOpts ¶
type IPAllowDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
IPAllowDotConfigOpts contains settings to configure generation options.
type IPAllowDotYAMLOpts ¶
type IPAllowDotYAMLOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
IPAllowDotYAMLOpts contains settings to configure generation options.
type InvalidationJob ¶
type InvalidationJob tc.InvalidationJobV4
InvalidationJob is a tc.InvalidationJob for the latest lib/go-tc and traffic_ops/vx-client type. This allows atscfg to not have to change the type everywhere it's used, every time ATC changes the base type, but to only have to change it here, and the places where breaking symbol changes were made.
func JobToInvalidationJob ¶
func JobToInvalidationJob(jb tc.Job) (InvalidationJob, error)
JobToInvalidationJob converts a tc.Job to an InvalidationJob. If the conversion fails, an error is returned.
func JobsToInvalidationJobs ¶
func JobsToInvalidationJobs(oldJobs []tc.Job) ([]InvalidationJob, error)
JobsToInvalidationJobs converts a set of tc.Job structures into their equivalent InvalidationJob structures, by calling JobToInvalidationJob on each of them in turn.
This will bail on the first error encountered when converting, so other jobs afterward may also have problems, but they won't be reported.
func ToInvalidationJobs ¶
func ToInvalidationJobs(jobs []tc.InvalidationJobV4) []InvalidationJob
ToInvalidationJobs converts a slice of the latest lib/go-tc and traffic_ops/vx-client type to the local alias.
type LineTemplates ¶
type LoggingDotConfigOpts ¶
type LoggingDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
LoggingDotConfigOpts contains settings to configure generation options.
type LoggingDotYAMLOpts ¶
type LoggingDotYAMLOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
// ATSMajorVersion is the integral major version of Apache Traffic server,
// used to generate the proper config for the proper version.
//
// If omitted or 0, the major version will be read from the Server's Profile Parameter config file 'package' name 'trafficserver'. If no such Parameter exists, the ATS version will default to 5.
// This was the old Traffic Control behavior, before the version was specifiable externally.
//
ATSMajorVersion uint
}
LoggingDotYAMLOpts contains settings to configure generation options.
type LogsXMLDotConfigOpts ¶
type LogsXMLDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
LogsXMLDotConfigOpts contains settings to configure generation options.
type OriginFQDN ¶
type OriginFQDN string
OriginFQDN is an unused type alias of unknown purpose.
TODO: remove this?
type OriginHost ¶
type OriginHost string
OriginHost is the (short) hostname of an Origin server. It has no other attached semantics.
type PackagesOpts ¶
type PackagesOpts struct {
}
PackagesOpts contains settings to configure generation options.
type ParentAbstraction ¶
type ParentAbstraction struct {
Services []*ParentAbstractionService
// Peers is the list of peer proxy caches to be used in a strategy peering group.
// a cache will only have one set of peers for potential use in all delivery services.
Peers []*ParentAbstractionServiceParent
}
ParentAbstraction contains all the data necessary to build either parent.config or strategies.yaml.
func MakeParentDotConfigData ¶
func MakeParentDotConfigData( dses []DeliveryService, server *Server, servers []Server, topologies []tc.TopologyV5, tcServerParams []tc.ParameterV5, tcParentConfigParams []tc.ParameterV5, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, cacheGroupArr []tc.CacheGroupNullableV5, dss []DeliveryServiceServer, cdn *tc.CDNV5, opt *ParentConfigOpts, atsMajorVersion uint, ) (*ParentAbstraction, []string, error)
type ParentAbstractionService ¶
type ParentAbstractionService struct {
// Name is a unique name for the service.
// It can be anything unique, but should probably be the Traffic ops Delivery Service name.
Name string
// Comment is a text comment about the service, not including the comment syntax (e.g. # or //).
// Should be empty if !opt.AddComments.
Comment string
// DestDomain is the FQDN of the remap.config target.
// Becomes parent.config dest_domain directive
// Becomes strategies.yaml TODO
DestDomain string
// Port is the port of the remap.config target,
// which MUST be valid, and is implicitly 80 for http targets and 443 for https targets.
// Becomes parent.config port directive
// Becomes strategies.yaml TODO
Port int
// Parents is the list of parents, either parent proxy caches or origins.
// This is a sorted array. Parents will be inserted into the config file in the order they appear.
// Becomes parent.config parent= directive members
// Becomes strategies.yaml TODO
Parents []*ParentAbstractionServiceParent
// Parents is the list of secondary parents, either parent proxy caches or origins,
// to be used if the primary parents fail. See SecondaryMode.
// Becomes parent.config secondary_parent= directive members
// Becomes strategies.yaml TODO
SecondaryParents []*ParentAbstractionServiceParent
// SecondaryMode is how to try SecondaryParents if primary Parents fail.
// Becomes parent.config secondary_mode directive
// Becomes strategies.yaml TODO
SecondaryMode ParentAbstractionServiceParentSecondaryMode
// CachePeerResult is used only when the RetryPolicy is set to
// 'consistent_hash' and the SecondaryMode is set to 'peering'.
// In the case that it's used and set to 'true', query results
// from peer caches will not be cached locally.
CachePeerResult bool
// GoDirect is whether to go direct to parents via normal HTTP requests.
// False means to make proxy requests to the parents.
// Becomes parent.config go_direct and parent_is_proxy directives
// Becomes strategies.yaml TODO
GoDirect bool
// ParentIsProxy A boolean value which indicates if the groups of hosts are proxy caches or origins.
// true (default) means all the hosts used are Traffic Server caches.
// false means the hosts are origins.
// Becomes parent_is_proxy directive.
// Becomes strategies.yaml TODO
ParentIsProxy bool
// IgnoreQueryStringInParentSelection is whether to use the query string of the request
// when selecting a parent, e.g. via Consistent Hash.
// Becomes parent.config qstring directive
// Becomes strategies.yaml TODO
IgnoreQueryStringInParentSelection bool
// MarkdownResponseCodes is the list of HTTP response codes from the parent
// to consider as errors and mark the parent as unhealthy. Typically 5xx codes.
// Becomes parent.config unavailable_server_retry_responses directive
// Becomes strategies.yaml TODO
MarkdownResponseCodes []int
// ErrorResponseCodes is the list of HTTP response codes from the parent
// to consider as errors, but NOT mark the parent unhealthy. Typically 4xx codes.
// Becomes parent.config unavailable_server_retry_responses directive
// Becomes strategies.yaml TODO
ErrorResponseCodes []int
// MaxSimpleRetries is the maximum number of non-markdown errors to attempt
// before returning the error to the client. See ErrorResponseCodes
// Becomes parent.config max_simple_retries
// Becomes strategies.yaml TODO
MaxSimpleRetries int
// MaxMarkdownRetries is the maximum number of markdown errors to attempt
// before returning the error to the client. See MarkdownResponseCodes
// Becomes parent.config max_unavailable_server_retries
// Becomes strategies.yaml TODO
MaxMarkdownRetries int
// RetryPolicy is how to retry primary versus secondary parents.
// Becomes parent.config round_robin directive
// Becomes strategies.yaml TODO
RetryPolicy ParentAbstractionServiceRetryPolicy
// Weight is the weight of this parent relative to other parents in consistent hash (and potentially other non-sequential) parent selection. The default is 0.999
// Becomes parent.config weight directive
// Becomes strategies.yaml TODO
Weight float64
// DS is the delivery service associated with the service
DS DeliveryService
}
ParentAbstractionService represents a single delivery service's parent data. For parent.config, this becomes a single dest_domain= line. For strategies, this becomes a strategy along with its corresponding groups and hosts.
func (*ParentAbstractionService) ToParentDotConfigLine ¶
func (svc *ParentAbstractionService) ToParentDotConfigLine(opt *ParentConfigOpts, atsMajorVersion uint) (string, []string, error)
ToParentDotConfigLine constructs a line in the parent.config Apache Traffic Server configuration file for the abstraction with the given options and for the given major version of Apache Traffic Server. It returns the line, any warnings to be issued, and any error that occurred during generation.
type ParentAbstractionServiceParent ¶
type ParentAbstractionServiceParent struct {
// FQDN is the parent FQDN that ATS will use. Note this may be an IP.
FQDN string
Port int
Weight float64
}
ParentAbstractionServiceParent represents a single "parent" as an abstracted concept.
func RemoveParentDuplicates ¶
func RemoveParentDuplicates(inputs []*ParentAbstractionServiceParent, seens map[string]struct{}) ([]*ParentAbstractionServiceParent, map[string]struct{})
RemoveParentDuplicates returns all values in the input list that have unique outputs for their Key method. Earlier duplicates are used while later occurrences of degenerate "Key"s are discarded.
func (ParentAbstractionServiceParent) Key ¶
func (sp ParentAbstractionServiceParent) Key() string
Key returns a unique key that can be used to compare parents for equality.
func (*ParentAbstractionServiceParent) ToParentDotConfigFormat ¶
func (pa *ParentAbstractionServiceParent) ToParentDotConfigFormat() string
ToParentDotConfigFormat converts the abstracted parent into a concrete piece of a configuration file line for the parent.config parent configuration implementation.
type ParentAbstractionServiceParentSecondaryMode ¶
type ParentAbstractionServiceParentSecondaryMode string
ParentAbstractionServiceParentSecondaryMode is the "secondary parent mode" of a Delivery Service parenting abstraction. Only certain values are allowed.
func (ParentAbstractionServiceParentSecondaryMode) ToParentDotConfigVal ¶
func (mo ParentAbstractionServiceParentSecondaryMode) ToParentDotConfigVal() string
ToParentDotConfigVal returns the ATS parent.config secondary_mode= value for the enum. If the mode is invalid, ParentAbstractionServiceParentSecondaryModeDefault is returned without error.
type ParentAbstractionServiceRetryPolicy ¶
type ParentAbstractionServiceRetryPolicy string
A ParentAbstractionServiceRetryPolicy is a "retry policy" that will be used by Delivery Service parenting.
func ParentSelectAlgorithmToParentAbstractionServiceRetryPolicy ¶
func ParentSelectAlgorithmToParentAbstractionServiceRetryPolicy(alg string) ParentAbstractionServiceRetryPolicy
ParentSelectAlgorithmToParentAbstractionServiceRetryPolicy converts a parent selection algorithm Parameter Value to a generic ParentAbstractionServiceRetryPolicy.
func (ParentAbstractionServiceRetryPolicy) ToParentDotConfigFormat ¶
func (po ParentAbstractionServiceRetryPolicy) ToParentDotConfigFormat() string
ToParentDotConfigFormat returns the ATS parent.config round_robin= value for the policy. If the policy is invalid, the default is returned without error.
type ParentAbstractionServices ¶
type ParentAbstractionServices []*ParentAbstractionService
ParentAbstractionServices implements sort.Interface.
func (ParentAbstractionServices) Len ¶
func (ps ParentAbstractionServices) Len() int
Len implements part of sort.Interface.
func (ParentAbstractionServices) Less ¶
func (ps ParentAbstractionServices) Less(i, j int) bool
Less implements part of sort.Interface.
func (ParentAbstractionServices) Swap ¶
func (ps ParentAbstractionServices) Swap(i, j int)
Swap implements part of sort.Interface.
type ParentConfigOpts ¶
type ParentConfigOpts struct {
// AddComments is whether to add informative comments to the generated file, about what was generated and why.
// Note this does not include the header comment, which is configured separately with HdrComment.
// These comments are human-readable and not guaranteed to be consistent between versions. Automating anything based on them is strongly discouraged.
AddComments bool
// GoDirect is set with a command line argument default is true.
// This value can be overridden by a delivery serivce parameter go_direct [true|false]
GoDirect string
// ParentIsProxy A boolean value which indicates if the groups of hosts are proxy caches or origins.
// true (default) means all the hosts used are Traffic Server caches.
// false means the hosts are origins.
ParentIsProxy bool
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
// ATSMajorVersion is the integral major version of Apache Traffic server,
// used to generate the proper config for the proper version.
//
// If omitted or 0, the major version will be read from the Server's Profile Parameter config file 'package' name 'trafficserver'. If no such Parameter exists, the ATS version will default to 5.
// This was the old Traffic Control behavior, before the version was specifiable externally.
//
ATSMajorVersion uint
}
ParentConfigOpts contains settings to configure parent.config generation options.
type ParentConfigRetryKeys ¶
type ParentConfigRetryKeys struct {
Algorithm string
SecondaryMode string
ParentRetry string
MaxSimpleRetries string
SimpleRetryResponses string
}
ParentConfigRetryKeys is a collection of the directives on a `parent.config` line that can affect the behavior of retrying requests in the event of failures; both the conditions that result in a retry as well as the mechanism used for retrying.
func MakeParentConfigRetryKeysWithPrefix ¶
func MakeParentConfigRetryKeysWithPrefix(prefix string) ParentConfigRetryKeys
MakeParentConfigRetryKeysWithPrefix creates a new ParentConfigRetryKeys by prepending each default directive name with the given prefix. If a "." is desired as a part of the prefix (almost always), it **must** be included in the prefix, as this will not add it for you!
type PluginDotConfigOpts ¶
type PluginDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
PluginDotConfigOpts contains settings to configure generation options.
type ProfileDS ¶
ProfileDS struct for filtered delivery services.
func GetProfileDSes ¶
func GetProfileDSes(server *Server, servers []Server, deliveryServices []DeliveryService, deliveryServiceServers []DeliveryServiceServer, ) ([]ProfileDS, []string)
GetProfileDSes filters delivery services and return delivery services with valid type and non-empty FQDN.
type ProfileID ¶
type ProfileID int
ProfileID is used internally to represent a Profile ID.
TODO: Unexport? This isn't used outside of this package. Alternatively: remove? lib/go-tc and cache-config/* use ints, so all this is doing is causing spurious casting back and forth.
type ProfileName ¶
type ProfileName string
ProfileName is used internally to represent a Profile Name.
type RecordsConfigOpts ¶
type RecordsConfigOpts struct {
// ReleaseViaStr is whether or not we replace the via and server strings in ATS
// responses to be the Release value from the rpm package. This can be a user
// defined build hash (or whatever the user wants) type value to give more
// specific info as well as obfuscating the real ATS version from prying eyes
ReleaseViaStr bool
// DNSLocalBindServiceAddr is whether to set the server's service addresses
// as the records.config proxy.config.dns.local_ipv* settings.
DNSLocalBindServiceAddr bool
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
// NoOutgoingIP is whether to omit adding a records.config entry for
// proxy.local.outgoing_ip_to_bind set to the server's IP addresses (V4 and V6).
// By default, this entry is added, unless it already exists in records.config
// (probably from a Parameter).
//
// The default, setting the IP to bind, is usually the right solution, unless
// the server's addresses are unusual or not public, such as NAT.
NoOutgoingIP bool
}
RecordsConfigOpts are options that may be passed to MakeRecordsDotConfig to affect generation of the records.config ATS configuration file.
type RegexRemapDotConfigOpts ¶
type RegexRemapDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
RegexRemapDotConfigOpts contains settings to configure generation options.
type RegexRevalidateDotConfigOpts ¶
type RegexRevalidateDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
RegexRevalidateDotConfigOpts contains settings to configure generation options.
type RemapDotConfigOpts ¶
type RemapDotConfigOpts struct {
// VerboseComments is whether to add informative comments to the generated file, about what was generated and why.
// Note this does not include the header comment, which is configured separately with HdrComment.
// These comments are human-readable and not guaranteed to be consistent between versions. Automating anything based on them is strongly discouraged.
VerboseComments bool
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
// UseStrategies is whether to use strategies.yaml rather than parent.config.
UseStrategies bool
// UseCoreStrategies is whether to use the ATS core strategies, rather than the parent_select plugin.
// This has no effect if UseStrategies is false.
UseStrategiesCore bool
// ATSMajorVersion is the integral major version of Apache Traffic server,
// used to generate the proper config for the proper version.
//
// If omitted or 0, the major version will be read from the Server's Profile Parameter config file 'package' name 'trafficserver'. If no such Parameter exists, the ATS version will default to 5.
// This was the old Traffic Control behavior, before the version was specifiable externally.
//
ATSMajorVersion uint
}
RemapDotConfigOpts contains settings to configure generation options.
type RemapLines ¶
type RemapLines struct {
// Pre contains lines to appear before the "main" text of a Delivery
// Service's remap.config content.
Pre []string
// Text contains the "main" text of a Delivery Service's remap.config
// content.
Text string
// Post contains lines to appear after the "main" text of a Delivery
// Service's remap.config content.
Post []string
}
RemapLines represents the contents of a remap.config Apache Traffic Server configuration file for a given Delivery Service.
type RemapTags ¶
type RemapTags struct {
Source string
Destination string
Strategy string
Dscp string
HeaderRewrite string
DropQstring string
Signing string
RegexRemap string
Cachekey string
Pacing string
RangeRequests string
RawText string
}
RemapTags contains the mustache template fillers.
func (*RemapTags) AnyMidOptionsSet ¶
type RevalType ¶
type RevalType string
A RevalType describes the type of revalidation to be performed by a content invalidation job.
type SNIDotYAMLOpts ¶
type SNIDotYAMLOpts struct {
// VerboseComments is whether to add informative comments to the generated file, about what was generated and why.
// Note this does not include the header comment, which is configured separately with HdrComment.
// These comments are human-readable and not guaranteed to be consistent between versions. Automating anything based on them is strongly discouraged.
VerboseComments bool
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
// DefaultTLSVersions is the list of TLS versions to enable on delivery services with no Parameter.
DefaultTLSVersions []TLSVersion
// DefaultEnableH2 is whether to disable H2 on delivery services with no Parameter.
DefaultEnableH2 bool
}
SNIDotYAMLOpts contains settings to configure sni.yaml generation options.
type SSLData ¶
type SSLData struct {
DSName string
RequestFQDNs []string
EnableH2 bool
TLSVersions []TLSVersion
}
SSLData has the DS data needed for both sni.yaml (ATS 9+) and ssl_server_name.yaml (ATS 8).
func GetServerSSLData ¶
func GetServerSSLData( server *Server, servers []Server, dses []DeliveryService, dss []DeliveryServiceServer, dsRegexArr []tc.DeliveryServiceRegexes, tcParentConfigParams []tc.ParameterV5, cdn *tc.CDNV5, topologies []tc.TopologyV5, cacheGroupArr []tc.CacheGroupNullableV5, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, defaultTLSVersions []TLSVersion, defaultEnableH2 bool, ) ([]SSLData, []string, error)
GetServerSSLData gets the SSLData for all Delivery Services assigned to the given Server, any warnings, and any error.
type SSLMultiCertDotConfigOpts ¶
type SSLMultiCertDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
SSLMultiCertDotConfigOpts contains settings to configure generation options.
type SSLServerNameYAMLOpts ¶
type SSLServerNameYAMLOpts struct {
// VerboseComments is whether to add informative comments to the generated file, about what was generated and why.
// Note this does not include the header comment, which is configured separately with HdrComment.
// These comments are human-readable and not guaranteed to be consistent between versions. Automating anything based on them is strongly discouraged.
VerboseComments bool
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
// DefaultTLSVersions is the list of TLS versions to enable on delivery services with no Parameter.
DefaultTLSVersions []TLSVersion
// DefaultEnableH2 is whether to disable H2 on delivery services with no Parameter.
DefaultEnableH2 bool
}
SSLServerNameYAMLOpts contains settings to configure ssl_server_name.yaml generation options.
type Server ¶
type Server tc.ServerV5
Server is a tc.Server for the latest lib/go-tc and traffic_ops/vx-client type. This allows atscfg to not have to change the type everywhere it's used, every time ATC changes the base type, but to only have to change it here, and the places where breaking symbol changes were made.
func FilterServers ¶
FilterServers returns the servers for which filter returns true.
type ServerCapability ¶
type ServerCapability string
ServerCapability is used to represent the Name of a Capability that a server has OR that a Delivery Service requires.
type ServerID ¶
type ServerID int
ServerID is used internally to represent a server ID.
TODO: Unexport? This isn't used outside of this package. Alternatively: remove? lib/go-tc and cache-config/* use ints, so all this is doing is causing spurious casting back and forth.
type ServerUnknownOpts ¶
type ServerUnknownOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
ServerUnknownOpts contains settings to configure generation options.
type ServerUpdateStatus ¶
type ServerUpdateStatus tc.ServerUpdateStatusV5
ServerUpdateStatus is a tc.ServerUpdateStatus for the latest lib/go-tc and traffic_ops/vx-client type. This allows atscfg to not have to change the type everywhere it's used, every time ATC changes the base type, but to only have to change it here, and the places where breaking symbol changes were made.
func ToServerUpdateStatuses ¶
func ToServerUpdateStatuses(statuses []tc.ServerUpdateStatusV50) []ServerUpdateStatus
ToServerUpdateStatuses converts a slice of the latest lib/go-tc and traffic_ops/vx-client type to the local alias.
type SetDSCPDotConfigOpts ¶
type SetDSCPDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
SetDSCPDotConfigOpts contains settings to configure generation options.
type StorageDotConfigOpts ¶
type StorageDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
StorageDotConfigOpts contains settings to configure generation options.
type StrategiesYAMLOpts ¶
type StrategiesYAMLOpts struct {
// VerboseComments is whether to add informative comments to the generated file, about what was generated and why.
// Note this does not include the header comment, which is configured separately with HdrComment.
// These comments are human-readable and not guaranteed to be consistent between versions. Automating anything based on them is strongly discouraged.
VerboseComments bool
// GoDirect is set with a command line argument default is true.
// This value can be overridden by a delivery serivce parameter go_direct [true|false]
GoDirect string
// ParentIsProxy A boolean value which indicates if the groups of hosts are proxy caches or origins.
// true (default) means all the hosts used are Traffic Server caches.
// false means the hosts are origins.
ParentIsProxy bool
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
// ATSMajorVersion is the integral major version of Apache Traffic server,
// used to generate the proper config for the proper version.
//
// If omitted or 0, the major version will be read from the Server's Profile Parameter config file 'package' name 'trafficserver'. If no such Parameter exists, the ATS version will default to 5.
// This was the old Traffic Control behavior, before the version was specifiable externally.
//
ATSMajorVersion uint
}
StrategiesYAMLOpts contains settings to configure strategies.config generation options.
type SysCtlDotConfOpts ¶
type SysCtlDotConfOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
SysCtlDotConfOpts contains settings to configure generation options.
type TLSVersion ¶
type TLSVersion string
A TLSVersion is a version of the TLS protocol.
TODO: consolidate with the lib/go-tc TLS version constants.
const ( TLSVersion1p0 TLSVersion = "1.0" TLSVersion1p1 TLSVersion = "1.1" TLSVersion1p2 TLSVersion = "1.2" TLSVersion1p3 TLSVersion = "1.3" )
These are valid, recognized versions of TLS.
func StringToTLSVersion ¶
func StringToTLSVersion(st string) TLSVersion
StringToTLSVersion returns the TLSVersion or TLSVersionInvalid if the string is not a TLS Version enum.
type TopologyCacheTier ¶
type TopologyCacheTier string
TopologyCacheTier is the position of a cache in the topology. Note this is the cache tier itself, notwithstanding MSO. So for an MSO service, Caches immediately before the origin are the TopologyCacheTierLast, even for MSO.
type TopologyName
deprecated
type TopologyName string
TopologyName is used internally to represent a Topology Name.
Deprecated: github.com/apache/trafficcontrol/lib/go-tc provides the an identical type by the same name, but that is the type actually used by the Go client and Traffic Ops. Therefore, new code should use that type instead of this one.
type TopologyPlacement ¶
type TopologyPlacement struct {
// InTopology is whether the server is in the topology at all.
InTopology bool
// IsFirstCacheTier is whether the server is the first cache tier. Note if the server is the only tier, both IsFirstCacheTier and IsLastCacheTier may be true.
IsFirstCacheTier bool
// IsInnerCacheTier is whether the server is an inner cache tier. This will never be true if IsFirstCacheTier or IsLstCacheTier are true.
IsInnerCacheTier bool
// IsLastCacheTier is whether the server is the last cache tier. Note if the server is the only tier, both IsFirstCacheTier and IsLastCacheTier may be true.
// Note this is distinct from IsLastTier, which will be false for the last cache tier of MSO.
IsLastCacheTier bool
// IsLastTier is whether the server is the last tier in the topology.
// Note this is different than IsLastCacheTier for MSO vs non-MSO. For MSO, the last tier is the Origin. For non-MSO, the last tier is the last cache tier.
IsLastTier bool
}
TopologyPlacement contains data about the placement of a server in a topology.
type URISigningConfigOpts ¶
type URISigningConfigOpts struct {
}
URISigningConfigOpts contains settings to configure generation options.
type URLSigConfigOpts ¶
type URLSigConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
URLSigConfigOpts contains settings to configure generation options.
type VolumeDotConfigOpts ¶
type VolumeDotConfigOpts struct {
// HdrComment is the header comment to include at the beginning of the file.
// This should be the text desired, without comment syntax (like # or //). The file's comment syntax will be added.
// To omit the header comment, pass the empty string.
HdrComment string
}
VolumeDotConfigOpts contains settings to configure generation options.
Source Files
¶
- astatsdotconfig.go
- atscfg.go
- atsdotrules.go
- bgfetchdotconfig.go
- cachedotconfig.go
- chkconfig.go
- doc.go
- dropqstringdotconfig.go
- facts.go
- headerrewritedotconfig.go
- hostingdotconfig.go
- ipallowdotconfig.go
- ipallowdotyaml.go
- loggingdotconfig.go
- loggingdotyaml.go
- logsdotxml.go
- meta.go
- packages.go
- parentabstraction.go
- parentdotconfig.go
- plugindotconfig.go
- recordsdotconfig.go
- regexremapdotconfig.go
- regexrevalidatedotconfig.go
- remapdotconfig.go
- servercachedotconfig.go
- serverunknown.go
- setdscpdotconfig.go
- snidotyaml.go
- sslmulticertdotconfig.go
- sslservernamedotyaml.go
- storagedotconfig.go
- strategiesdotconfig.go
- sysctldotconf.go
- urisigningconfig.go
- urlsigconfig.go
- volumedotconfig.go