Documentation ¶
Index ¶
- Constants
- func DeliveryServicesToSSLMultiCertDSes(dses []DeliveryService) (map[tc.DeliveryServiceName]sslMultiCertDS, []string)
- func FirstHeaderRewriteConfigFileName(dsName string) string
- func GetSSLMultiCertDotConfigCertAndKeyName(dsName tc.DeliveryServiceName, ds sslMultiCertDS) (string, string)
- func GetSSLMultiCertDotConfigDeliveryServices(dses map[tc.DeliveryServiceName]sslMultiCertDS) map[tc.DeliveryServiceName]sslMultiCertDS
- func InnerHeaderRewriteConfigFileName(dsName string) string
- func LastHeaderRewriteConfigFileName(dsName string) string
- type CacheGroupType
- type Cfg
- func Make12MFacts(server *Server, hdrComment string) (Cfg, error)
- func MakeAStatsDotConfig(server *Server, serverParams []tc.Parameter, hdrComment string) (Cfg, error)
- func MakeATSDotRules(server *Server, serverParams []tc.Parameter, hdrComment string) (Cfg, error)
- func MakeBGFetchDotConfig(server *Server, hdrComment string) (Cfg, error)
- func MakeCacheDotConfig(server *Server, servers []Server, deliveryServices []DeliveryService, ...) (Cfg, error)
- func MakeCacheURLDotConfig(fileName string, server *Server, deliveryServices []DeliveryService, ...) (Cfg, error)
- func MakeChkconfig(serverParams []tc.Parameter) (Cfg, error)
- func MakeDropQStringDotConfig(server *Server, serverParams []tc.Parameter, hdrComment string) (Cfg, error)
- func MakeHeaderRewriteDotConfig(fileName string, deliveryServices []DeliveryService, ...) (Cfg, error)
- func MakeHeaderRewriteMidDotConfig(fileName string, deliveryServices []DeliveryService, ...) (Cfg, error)
- func MakeHostingDotConfig(server *Server, servers []Server, serverParams []tc.Parameter, ...) (Cfg, error)
- func MakeIPAllowDotConfig(serverParams []tc.Parameter, server *Server, servers []Server, ...) (Cfg, error)
- func MakeLoggingDotConfig(server *Server, serverParams []tc.Parameter, hdrCommentTxt string) (Cfg, error)
- func MakeLoggingDotYAML(server *Server, serverParams []tc.Parameter, hdrComment string) (Cfg, error)
- func MakeLogsXMLDotConfig(server *Server, serverParams []tc.Parameter, hdrCommentTxt string) (Cfg, error)
- func MakePackages(serverParams []tc.Parameter) (Cfg, error)
- func MakeParentDotConfig(dses []DeliveryService, server *Server, servers []Server, ...) (Cfg, error)
- func MakePluginDotConfig(server *Server, serverParams []tc.Parameter, hdrComment string) (Cfg, error)
- func MakeRecordsDotConfig(server *Server, serverParams []tc.Parameter, hdrComment string) (Cfg, error)
- func MakeRegexRemapDotConfig(fileName string, server *Server, deliveryServices []DeliveryService, ...) (Cfg, error)
- func MakeRegexRevalidateDotConfig(server *Server, deliveryServices []DeliveryService, ...) (Cfg, error)
- func MakeRemapDotConfig(server *Server, unfilteredDSes []DeliveryService, ...) (Cfg, error)
- func MakeSSLMultiCertDotConfig(server *Server, deliveryServices []DeliveryService, hdrComment string) (Cfg, error)
- func MakeServerUnknown(fileName string, server *Server, serverParams []tc.Parameter, ...) (Cfg, error)
- func MakeSetDSCPDotConfig(fileName string, server *Server, hdrComment string) (Cfg, error)
- func MakeStorageDotConfig(server *Server, serverParams []tc.Parameter, hdrComment string) (Cfg, error)
- func MakeSysCtlDotConf(server *Server, serverParams []tc.Parameter, hdrComment string) (Cfg, error)
- func MakeTopologyHeaderRewriteDotConfig(fileName string, server *Server, servers []Server, ...) (Cfg, error)
- func MakeURISigningConfig(fileName string, uriSigningKeys map[tc.DeliveryServiceName][]byte) (Cfg, error)
- func MakeURLSigConfig(fileName string, server *Server, serverParams []tc.Parameter, ...) (Cfg, error)
- func MakeVolumeDotConfig(server *Server, serverParams []tc.Parameter, hdrComment string) (Cfg, error)
- type CfgFile
- type CfgMeta
- type DeliveryService
- type DeliveryServiceID
- type OriginFQDN
- type OriginHost
- type ParentConfigOpts
- type ProfileID
- type Server
- type ServerCapability
- type ServerID
- type TopologyCacheTier
- type TopologyName
- type TopologyPlacement
Constants ¶
const ( TopologyCacheTierFirst = TopologyCacheTier("first") TopologyCacheTierInner = TopologyCacheTier("inner") TopologyCacheTierLast = TopologyCacheTier("last") TopologyCacheTierInvalid = TopologyCacheTier("") )
const ATSDotRulesFileName = StorageFileName
const AstatsFileName = "astats.config"
const AstatsSeparator = "="
const CacheKeyParameterConfigFile = "cachekey.config"
const CacheURLParameterConfigFile = "cacheurl.config"
const CacheUrlPrefix = "cacheurl_"
const ChkconfigFileName = `chkconfig`
const ChkconfigParamConfigFile = `chkconfig`
const ConfigSuffix = ".config"
const ContentType12MFacts = ContentTypeTextASCII
const ContentTypeATSDotRules = ContentTypeTextASCII
const ContentTypeAstatsDotConfig = ContentTypeTextASCII
const ContentTypeBGFetchDotConfig = ContentTypeTextASCII
const ContentTypeCacheDotConfig = ContentTypeTextASCII
const ContentTypeCacheURLDotConfig = ContentTypeTextASCII
const ContentTypeChkconfig = ContentTypeTextASCII
const ContentTypeDropQStringDotConfig = ContentTypeTextASCII
const ContentTypeHeaderRewriteDotConfig = ContentTypeTextASCII
const ContentTypeHostingDotConfig = ContentTypeTextASCII
const ContentTypeIPAllowDotConfig = ContentTypeTextASCII
const ContentTypeLoggingDotConfig = ContentTypeTextASCII
const ContentTypeLoggingDotYAML = "application/yaml; charset=us-ascii" // 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`
const ContentTypePackages = ContentTypeTextASCII
const ContentTypeParentDotConfig = ContentTypeTextASCII
const ContentTypePluginDotConfig = ContentTypeTextASCII
const ContentTypeRecordsDotConfig = ContentTypeTextASCII
const ContentTypeRegexRemapDotConfig = ContentTypeTextASCII
const ContentTypeRegexRevalidateDotConfig = ContentTypeTextASCII
const ContentTypeRemapDotConfig = ContentTypeTextASCII
const ContentTypeSSLMultiCertDotConfig = ContentTypeTextASCII
const ContentTypeServerUnknownConfig = ContentTypeTextASCII
const ContentTypeSetDSCPDotConfig = ContentTypeTextASCII
const ContentTypeStorageDotConfig = ContentTypeTextASCII
const ContentTypeSysctlDotConf = ContentTypeTextASCII
const ContentTypeTextASCII = `text/plain; charset=us-ascii`
const ContentTypeURISigningDotConfig = `application/json; charset=us-ascii`
const ContentTypeURLSig = ContentTypeTextASCII
const ContentTypeVolumeDotConfig = ContentTypeTextASCII
const DefaultATSVersion = "5" // TODO Emulates Perl; change to 6? ATC no longer officially supports ATS 5.
const DefaultCoalesceMaskLenV4 = 24
const DefaultCoalesceMaskLenV6 = 48
const DefaultCoalesceNumberV4 = 5
const DefaultCoalesceNumberV6 = 5
const DefaultMaxRevalDurationDays = 90
const DropQStringDotConfigFileName = "drop_qstring.config"
const DropQStringDotConfigParamName = "content"
const HeaderCommentDateFormat = "Mon Jan 2 15:04:05 MST 2006"
todo also unused
const HeaderRewriteFirstPrefix = HeaderRewritePrefix + "first_"
const HeaderRewriteInnerPrefix = HeaderRewritePrefix + "inner_"
const HeaderRewriteLastPrefix = HeaderRewritePrefix + "last_"
const HeaderRewriteMidPrefix = "hdr_rw_mid_"
const HeaderRewritePrefix = "hdr_rw_"
const HostingConfigFileName = `hosting.config`
const HostingConfigParamConfigFile = `storage.config`
const IPAllowConfigFileName = `ip_allow.config`
const InvalidID = -1
const JobKeywordPurge = "PURGE"
const LineComment12MFacts = LineCommentHash
const LineCommentATSDotRules = LineCommentHash
const LineCommentAstatsDotConfig = LineCommentHash
const LineCommentBGFetchDotConfig = LineCommentHash
const LineCommentCacheDotConfig = LineCommentHash
const LineCommentCacheURLDotConfig = LineCommentHash
const LineCommentChkconfig = LineCommentHash
const LineCommentDropQStringDotConfig = LineCommentHash
const LineCommentHash = "#"
const LineCommentHeaderRewriteDotConfig = LineCommentHash
const LineCommentHostingDotConfig = LineCommentHash
const LineCommentIPAllowDotConfig = LineCommentHash
const LineCommentLoggingDotConfig = LineCommentHash
const LineCommentLoggingDotYAML = LineCommentHash
const LineCommentLogsDotXML = `<!--`
const LineCommentPackages = ""
const LineCommentParentDotConfig = LineCommentHash
const LineCommentPluginDotConfig = LineCommentHash
const LineCommentRecordsDotConfig = LineCommentHash
const LineCommentRegexRemapDotConfig = LineCommentHash
const LineCommentRegexRevalidateDotConfig = LineCommentHash
const LineCommentRemapDotConfig = LineCommentHash
const LineCommentSSLMultiCertDotConfig = LineCommentHash
const LineCommentSetDSCPDotConfig = LineCommentHash
const LineCommentStorageDotConfig = LineCommentHash
const LineCommentSysctlDotConf = LineCommentHash
const LineCommentURISigningDotConfig = ""
const LineCommentURLSig = LineCommentHash
const LineCommentVolumeDotConfig = LineCommentHash
const LoggingFileName = "logging.config"
const LoggingYAMLFileName = "logging.yaml"
const LogsXMLFileName = "logs_xml.config"
const MaxLogObjects = 10
const MaxOriginConnectionsNoMax = 0 // 0 indicates no limit on origin connections
const PackagesFileName = `packages`
const PackagesParamConfigFile = `package`
const ParamCoalesceMaskLenV4 = "coalesce_masklen_v4"
const ParamCoalesceMaskLenV6 = "coalesce_masklen_v6"
const ParamCoalesceNumberV4 = "coalesce_number_v4"
const ParamCoalesceNumberV6 = "coalesce_number_v6"
const ParamDrivePrefix = "Drive_Prefix"
const ParamPurgeAllowIP = "purge_allow_ip"
const ParamRAMDrivePrefix = "RAM_Drive_Prefix"
const ParentConfigCacheParamNotAParent = "not_a_parent"
const ParentConfigCacheParamPort = "port"
const ParentConfigCacheParamRank = "rank"
const ParentConfigCacheParamUseIP = "use_ip_address"
const ParentConfigCacheParamWeight = "weight"
const ParentConfigDSParamDefaultMSOAlgorithm = "consistent_hash"
const ParentConfigDSParamDefaultMSOParentRetry = "both"
const ParentConfigDSParamDefaultMaxSimpleRetries = "1"
const ParentConfigFileName = "parent.config"
const ParentConfigParamAlgorithm = "algorithm"
const ParentConfigParamMSOAlgorithm = "mso.algorithm"
const ParentConfigParamMSOMaxSimpleRetries = "mso.max_simple_retries"
const ParentConfigParamMSOParentRetry = "mso.parent_retry"
const ParentConfigParamMaxSimpleRetries = "max_simple_retries"
const ParentConfigParamParentRetry = "parent_retry"
const ParentConfigParamQString = "qstring"
const ParentConfigParamQStringHandling = "psel.qstring_handling"
const ParentConfigParamSecondaryMode = "try_all_primaries_before_secondary"
const PluginFileName = "plugin.config"
const PluginSeparator = " "
const RecordsFileName = "records.config"
const RecordsSeparator = " "
const RegexRemapPrefix = "regex_remap_"
const RegexRevalidateFileName = "regex_revalidate.config"
const RegexRevalidateMaxRevalDurationDaysParamName = "maxRevalDurationDays"
const RegexRevalidateMinTTL = time.Hour
const RemapConfigRangeDirective = `__RANGE_DIRECTIVE__`
const RemapFile = "remap.config"
const SSLMultiCertConfigFileName = `ssl_multicert.config`
const ServerCacheDotConfigIncludeInactiveDSes = false
const ServerHostingDotConfigEdgeIncludeInactive = true
const ServerHostingDotConfigMidIncludeInactive = false
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"
const SysctlFileName = "sysctl.conf"
const SysctlSeparator = " = "
const VolumeFileName = StorageFileName
Variables ¶
This section is empty.
Functions ¶
func DeliveryServicesToSSLMultiCertDSes ¶
func DeliveryServicesToSSLMultiCertDSes(dses []DeliveryService) (map[tc.DeliveryServiceName]sslMultiCertDS, []string)
deliveryServicesToSSLMultiCertDSes returns the "SSLMultiCertDS" map, and any warnings.
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.
Types ¶
type CacheGroupType ¶
type CacheGroupType string
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 MakeAStatsDotConfig ¶
func MakeATSDotRules ¶
func MakeBGFetchDotConfig ¶
func MakeCacheDotConfig ¶
func MakeCacheDotConfig( server *Server, servers []Server, deliveryServices []DeliveryService, deliveryServiceServers []tc.DeliveryServiceServer, hdrComment string, ) (Cfg, error)
MakeCacheDotConfig makes the ATS cache.config config file.
func MakeCacheURLDotConfig ¶
func MakeChkconfig ¶
MakeChkconfig returns the 'chkconfig' ATS config file endpoint. This is a JSON object, and should be served with an 'application/json' Content-Type.
func MakeHostingDotConfig ¶
func MakeIPAllowDotConfig ¶
func MakeIPAllowDotConfig( serverParams []tc.Parameter, server *Server, servers []Server, cacheGroups []tc.CacheGroupNullable, topologies []tc.Topology, hdrComment string, ) (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 MakeLoggingDotConfig ¶
func MakeLoggingDotConfig( server *Server, serverParams []tc.Parameter, hdrCommentTxt string, ) (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 MakeLoggingDotYAML ¶
func MakeLogsXMLDotConfig ¶
func MakePackages ¶
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.Topology, tcServerParams []tc.Parameter, tcParentConfigParams []tc.Parameter, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, cacheGroupArr []tc.CacheGroupNullable, dss []tc.DeliveryServiceServer, cdn *tc.CDN, opt ParentConfigOpts, ) (Cfg, error)
func MakePluginDotConfig ¶
func MakeRecordsDotConfig ¶
func MakeRegexRemapDotConfig ¶
func MakeRegexRevalidateDotConfig ¶
func MakeRegexRevalidateDotConfig( server *Server, deliveryServices []DeliveryService, globalParams []tc.Parameter, jobs []tc.Job, hdrComment string, ) (Cfg, error)
func MakeRemapDotConfig ¶
func MakeRemapDotConfig( server *Server, unfilteredDSes []DeliveryService, dss []tc.DeliveryServiceServer, dsRegexArr []tc.DeliveryServiceRegexes, serverParams []tc.Parameter, cdn *tc.CDN, cacheKeyParams []tc.Parameter, topologies []tc.Topology, cacheGroupArr []tc.CacheGroupNullable, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, hdrComment string, ) (Cfg, error)
func MakeSSLMultiCertDotConfig ¶
func MakeSSLMultiCertDotConfig( server *Server, deliveryServices []DeliveryService, hdrComment string, ) (Cfg, error)
func MakeServerUnknown ¶
func MakeSetDSCPDotConfig ¶
func MakeStorageDotConfig ¶
func MakeStorageDotConfig( server *Server, serverParams []tc.Parameter, hdrComment string, ) (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 MakeSysCtlDotConf ¶
func MakeTopologyHeaderRewriteDotConfig ¶
func MakeTopologyHeaderRewriteDotConfig( fileName string, server *Server, servers []Server, deliveryServices []DeliveryService, topologies []tc.Topology, serverCapabilities map[int]map[ServerCapability]struct{}, requiredCapabilities map[int]map[ServerCapability]struct{}, hdrComment string, ) (Cfg, error)
func MakeURISigningConfig ¶
func MakeURLSigConfig ¶
func MakeVolumeDotConfig ¶
func MakeVolumeDotConfig( server *Server, serverParams []tc.Parameter, hdrComment string, ) (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 ¶
func MakeConfigFilesList ¶
func MakeConfigFilesList( configDir string, server *Server, serverParams []tc.Parameter, deliveryServices []DeliveryService, deliveryServiceServers []tc.DeliveryServiceServer, globalParams []tc.Parameter, cacheGroupArr []tc.CacheGroupNullable, topologies []tc.Topology, ) ([]CfgMeta, []string, error)
MakeMetaObj returns the list of config files, any warnings, and any errors.
type DeliveryService ¶
type DeliveryService tc.DeliveryServiceNullableV30
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 OldToDeliveryServices ¶
func OldToDeliveryServices(dses []tc.DeliveryServiceNullable) []DeliveryService
OldToDeliveryServices converts a slice of the old traffic_ops/client type to the local alias.
func ToDeliveryServices ¶
func ToDeliveryServices(dses []tc.DeliveryServiceNullableV30) []DeliveryService
ToDeliveryServices converts a slice of the latest lib/go-tc and traffic_ops/vx-client type to the local alias.
type DeliveryServiceID ¶
type DeliveryServiceID int
type OriginFQDN ¶
type OriginFQDN string
type OriginHost ¶
type OriginHost string
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 guarnateed to be consistent between versions. Automating anything based on them is strongly discouraged. AddComments 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 }
ParentConfigOpts contains settings to configure parent.config generation options.
type Server ¶
type Server tc.ServerV30
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.
type ServerCapability ¶
type ServerCapability string
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 ¶
type TopologyName string
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.
Source Files ¶
- astatsdotconfig.go
- atscfg.go
- atsdotrules.go
- bgfetchdotconfig.go
- cachedotconfig.go
- cacheurldotconfig.go
- chkconfig.go
- dropqstringdotconfig.go
- facts.go
- headerrewritedotconfig.go
- headerrewritemiddotconfig.go
- hostingdotconfig.go
- ipallowdotconfig.go
- loggingdotconfig.go
- loggingdotyaml.go
- logsdotxml.go
- meta.go
- packages.go
- parentdotconfig.go
- plugindotconfig.go
- recordsdotconfig.go
- regexremapdotconfig.go
- regexrevalidatedotconfig.go
- remapdotconfig.go
- servercachedotconfig.go
- serverunknown.go
- setdscpdotconfig.go
- sslmulticertdotconfig.go
- storagedotconfig.go
- sysctldotconf.go
- topologyheaderrewritedotconfig.go
- urisigningconfig.go
- urlsigconfig.go
- volumedotconfig.go