Documentation ¶
Index ¶
- Constants
- Variables
- func BoolOnOff(b bool) string
- func DeliveryServicesToSSLMultiCertDSes(dses []DeliveryService) (map[tc.DeliveryServiceName]sslMultiCertDS, []string)
- func FirstHeaderRewriteConfigFileName(dsName string) string
- func GetDSParameters(ds *DeliveryService, params []tc.Parameter) ([]tc.Parameter, error)
- 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.Parameter) ([]tc.Parameter, error)
- func InnerHeaderRewriteConfigFileName(dsName string) string
- func LastHeaderRewriteConfigFileName(dsName string) string
- func LayerProfiles(profileNames []string, tcParams []tc.Parameter) ([]tc.Parameter, error)
- 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
- 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.Parameter, opt *AStatsDotConfigOpts) (Cfg, error)
- func MakeATSDotRules(server *Server, serverParams []tc.Parameter, 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.Parameter, opt *ChkconfigOpts) (Cfg, error)
- func MakeDropQStringDotConfig(server *Server, serverParams []tc.Parameter, opt *DropQStringDotConfigOpts) (Cfg, error)
- func MakeHeaderRewriteDotConfig(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 MakeIPAllowDotYAML(serverParams []tc.Parameter, server *Server, servers []Server, ...) (Cfg, error)
- func MakeLoggingDotConfig(server *Server, serverParams []tc.Parameter, opt *LoggingDotConfigOpts) (Cfg, error)
- func MakeLoggingDotYAML(server *Server, serverParams []tc.Parameter, opts *LoggingDotYAMLOpts) (Cfg, error)
- func MakeLogsXMLDotConfig(server *Server, serverParams []tc.Parameter, opt *LogsXMLDotConfigOpts) (Cfg, error)
- func MakePackages(serverParams []tc.Parameter, opts *PackagesOpts) (Cfg, error)
- func MakeParentDotConfig(dses []DeliveryService, server *Server, servers []Server, ...) (Cfg, error)
- func MakePluginDotConfig(server *Server, serverParams []tc.Parameter, opt *PluginDotConfigOpts) (Cfg, error)
- func MakeRecordsDotConfig(server *Server, serverParams []tc.Parameter, 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, unfilteredDSes []DeliveryService, dss []DeliveryServiceServer, ...) (Cfg, error)
- func MakeSNIDotYAML(server *Server, dses []DeliveryService, dss []DeliveryServiceServer, ...) (Cfg, error)
- func MakeSSLMultiCertDotConfig(server *Server, deliveryServices []DeliveryService, ...) (Cfg, error)
- func MakeSSLServerNameYAML(server *Server, dses []DeliveryService, dss []DeliveryServiceServer, ...) (Cfg, error)
- func MakeServerUnknown(fileName string, server *Server, serverParams []tc.Parameter, ...) (Cfg, error)
- func MakeSetDSCPDotConfig(fileName string, server *Server, opt *SetDSCPDotConfigOpts) (Cfg, error)
- func MakeStorageDotConfig(server *Server, serverParams []tc.Parameter, opt *StorageDotConfigOpts) (Cfg, error)
- func MakeStrategiesDotYAML(dses []DeliveryService, server *Server, servers []Server, ...) (Cfg, error)
- func MakeSysCtlDotConf(server *Server, serverParams []tc.Parameter, opt *SysCtlDotConfOpts) (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, 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 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 PluginDotConfigOpts
- type ProfileID
- type ProfileName
- type RecordsConfigOpts
- type RegexRemapDotConfigOpts
- type RegexRevalidateDotConfigOpts
- type RemapDotConfigOpts
- type RemapLines
- 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 TopologyName
- type TopologyPlacement
- type URISigningConfigOpts
- type URLSigConfigOpts
- type VolumeDotConfigOpts
Constants ¶
const ( TopologyCacheTierFirst = TopologyCacheTier("first") TopologyCacheTierInner = TopologyCacheTier("inner") TopologyCacheTierLast = TopologyCacheTier("last") TopologyCacheTierInvalid = TopologyCacheTier("") )
const ATSDotRulesFileName = StorageFileName
const ActionAllow = "ip_allow"
const ActionDeny = "ip_deny"
const AstatsFileName = "astats.config"
const AstatsSeparator = "="
const CacheKeyParameterConfigFile = "cachekey.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 ContentTypeChkconfig = ContentTypeTextASCII
const ContentTypeDropQStringDotConfig = ContentTypeTextASCII
const ContentTypeHeaderRewriteDotConfig = ContentTypeTextASCII
const ContentTypeHostingDotConfig = ContentTypeTextASCII
const ContentTypeIPAllowDotConfig = ContentTypeTextASCII
const ContentTypeIPAllowDotYAML = ContentTypeYAML
const ContentTypeLoggingDotConfig = ContentTypeTextASCII
const ContentTypeLoggingDotYAML = ContentTypeYAML
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 ContentTypeSNIDotYAML = ContentTypeYAML
const ContentTypeSSLMultiCertDotConfig = ContentTypeTextASCII
const ContentTypeSSLServerNameYAML = ContentTypeYAML
const ContentTypeServerUnknownConfig = ContentTypeTextASCII
const ContentTypeSetDSCPDotConfig = ContentTypeTextASCII
const ContentTypeStorageDotConfig = ContentTypeTextASCII
const ContentTypeStrategiesDotYAML = ContentTypeYAML
const ContentTypeSysctlDotConf = ContentTypeTextASCII
const ContentTypeTextASCII = `text/plain; charset=us-ascii`
const ContentTypeURISigningDotConfig = `application/json; charset=us-ascii`
const ContentTypeURLSig = ContentTypeTextASCII
const ContentTypeVolumeDotConfig = ContentTypeTextASCII
const ContentTypeYAML = "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 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 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 DefaultIgnoreQueryStringInParentSelection = false
const DefaultMaxRevalDurationDays = 90
const DefaultParentAbstractionServiceRetryPolicy = ParentAbstractionServiceRetryPolicyConsistentHash
const DefaultParentWeight = 0.999
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 IPAllowYamlFileName = `ip_allow.yaml`
const InvalidID = -1
const JobKeywordPurge = "PURGE"
const JobLegacyKeyword = "PURGE"
const JobLegacyParamPrefix = "TTL:"
const JobLegacyParamSuffix = "h"
const JobLegacyRefetchSuffix = `##REFETCH##`
const JobLegacyRefreshSuffix = `##REFRESH##`
const JobLegacyTimeFormat = "2006-01-02 15:04:05-07"
const JobV4TimeFormat = time.RFC3339Nano
const LineComment12MFacts = LineCommentHash
const LineCommentATSDotRules = LineCommentHash
const LineCommentAstatsDotConfig = LineCommentHash
const LineCommentBGFetchDotConfig = LineCommentHash
const LineCommentCacheDotConfig = LineCommentHash
const LineCommentChkconfig = LineCommentHash
const LineCommentDropQStringDotConfig = LineCommentHash
const LineCommentHash = "#"
const LineCommentHeaderRewriteDotConfig = LineCommentHash
const LineCommentHostingDotConfig = LineCommentHash
const LineCommentIPAllowDotConfig = LineCommentHash
const LineCommentIPAllowDotYAML = 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 LineCommentSNIDotYAML = LineCommentYAML
const LineCommentSSLMultiCertDotConfig = LineCommentHash
const LineCommentSSLServerNameYAML = LineCommentYAML
const LineCommentSetDSCPDotConfig = LineCommentHash
const LineCommentStorageDotConfig = LineCommentHash
const LineCommentStrategiesDotYAML = LineCommentHash
const LineCommentSysctlDotConf = LineCommentHash
const LineCommentURISigningDotConfig = ""
const LineCommentURLSig = LineCommentHash
const LineCommentVolumeDotConfig = LineCommentHash
const LineCommentYAML = 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 MethodAll = "ALL"
const MethodDelete = "DELETE"
const MethodPurge = "PURGE"
const MethodPush = "PUSH"
const MethodSeparator = `|`
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 ParentAbstractionServiceParentSecondaryModeAlternate = ParentAbstractionServiceParentSecondaryMode("alternate")
const ParentAbstractionServiceParentSecondaryModeDefault = ParentAbstractionServiceParentSecondaryModeAlternate
const ParentAbstractionServiceParentSecondaryModeExhaust = ParentAbstractionServiceParentSecondaryMode("exhaust")
const ParentAbstractionServiceParentSecondaryModeInvalid = ParentAbstractionServiceParentSecondaryMode("")
const ParentAbstractionServiceParentSecondaryModePeering = ParentAbstractionServiceParentSecondaryMode("peering")
const ParentAbstractionServiceRetryPolicyConsistentHash = ParentAbstractionServiceRetryPolicy("consistent_hash")
const ParentAbstractionServiceRetryPolicyFirst = ParentAbstractionServiceRetryPolicy("first")
const ParentAbstractionServiceRetryPolicyInvalid = ParentAbstractionServiceRetryPolicy("")
const ParentAbstractionServiceRetryPolicyLatched = ParentAbstractionServiceRetryPolicy("latched")
const ParentAbstractionServiceRetryPolicyRoundRobinIP = ParentAbstractionServiceRetryPolicy("round_robin_ip")
const ParentAbstractionServiceRetryPolicyRoundRobinStrict = ParentAbstractionServiceRetryPolicy("round_robin_strict")
const ParentConfigCacheParamNotAParent = "not_a_parent"
const ParentConfigCacheParamPort = "port"
const ParentConfigCacheParamRank = "rank"
const ParentConfigCacheParamUseIP = "use_ip_address"
const ParentConfigCacheParamWeight = "weight"
const ParentConfigDSParamDefaultMSOAlgorithm = ParentAbstractionServiceRetryPolicyConsistentHash
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 ParentConfigParamMergeGroups = "merge_parent_groups"
const ParentConfigParamParentRetry = "parent_retry"
const ParentConfigParamQString = "qstring"
const ParentConfigParamQStringHandling = "psel.qstring_handling"
const ParentConfigParamSecondaryMode = "try_all_primaries_before_secondary"
const ParentDotConfigParentSeparator = `;`
const PluginFileName = "plugin.config"
const PluginSeparator = " "
const RecordsFileName = "records.config"
const RecordsSeparator = " "
const RefetchSuffix = "##REFETCH##"
const RefreshSuffix = "##REFRESH##"
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 RevalTypeDefault = RevalTypeStale
const RevalTypeMiss = RevalType("MISS")
const RevalTypeStale = RevalType("STALE")
const SNIDotYAMLFileName = "sni.yaml"
const SSLMultiCertConfigFileName = `ssl_multicert.config`
const SSLServerNameYAMLFileName = "ssl_server_name.yaml"
const SSLServerNameYAMLParamEnableH2 = "enable_h2"
const SSLServerNameYAMLParamTLSVersions = "tls_versions"
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 StrategyConfigUsePeering = "use_peering"
const SysctlFileName = "sysctl.conf"
const SysctlSeparator = " = "
const TLSVersion1p0 = TLSVersion("1.0")
const TLSVersion1p1 = TLSVersion("1.1")
const TLSVersion1p2 = TLSVersion("1.2")
const TLSVersion1p3 = TLSVersion("1.3")
const TLSVersionInvalid = TLSVersion("")
const TsDefaultRequestHeaderMaxSize = 131072
const VolumeFileName = StorageFileName
const YAMLActionAllow = "allow"
const YAMLActionDeny = "deny"
const YAMLDocumentEnd = "..."
const YAMLDocumentStart = "---"
YAMLDocumentStart is the YAML document start directive
const YAMLMethodAll = "ALL"
Variables ¶
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}
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 GetDSParameters ¶
func GetDSParameters( ds *DeliveryService, params []tc.Parameter, ) ([]tc.Parameter, error)
GetDSParameters returns the parameters for the given Delivery Service.
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 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 ParentAbstractionServiceParentsToParentDotConfigLine ¶
func ParentAbstractionServiceParentsToParentDotConfigLine(parents []*ParentAbstractionServiceParent) string
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 ¶
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.
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
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)
func MakeAStatsDotConfig ¶
func MakeAStatsDotConfig( server *Server, serverParams []tc.Parameter, opt *AStatsDotConfigOpts, ) (Cfg, error)
func MakeATSDotRules ¶
func MakeATSDotRules( server *Server, serverParams []tc.Parameter, opt *ATSDotRulesOpts, ) (Cfg, error)
func MakeBGFetchDotConfig ¶
func MakeBGFetchDotConfig( server *Server, opt *BGFetchDotConfigOpts, ) (Cfg, error)
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.Parameter, 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.
func MakeDropQStringDotConfig ¶
func MakeDropQStringDotConfig( server *Server, serverParams []tc.Parameter, opt *DropQStringDotConfigOpts, ) (Cfg, error)
func MakeHeaderRewriteDotConfig ¶
func MakeHeaderRewriteDotConfig( fileName string, deliveryServices []DeliveryService, deliveryServiceServers []DeliveryServiceServer, server *Server, servers []Server, cacheGroupsArr []tc.CacheGroupNullable, tcServerParams []tc.Parameter, serverCapabilities map[int]map[ServerCapability]struct{}, requiredCapabilities map[int]map[ServerCapability]struct{}, topologiesArr []tc.Topology, 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.Parameter, deliveryServices []DeliveryService, deliveryServiceServers []DeliveryServiceServer, topologies []tc.Topology, opt *HostingDotConfigOpts, ) (Cfg, error)
func MakeIPAllowDotConfig ¶
func MakeIPAllowDotConfig( serverParams []tc.Parameter, server *Server, servers []Server, cacheGroups []tc.CacheGroupNullable, topologies []tc.Topology, 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.Parameter, server *Server, servers []Server, cacheGroups []tc.CacheGroupNullable, topologies []tc.Topology, opt *IPAllowDotYAMLOpts, ) (Cfg, error)
MakeIPAllowDotYAML creates the ip_allow.yaml ATS 9+ config file.
func MakeLoggingDotConfig ¶
func MakeLoggingDotConfig( server *Server, serverParams []tc.Parameter, opt *LoggingDotConfigOpts, ) (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 MakeLoggingDotYAML( server *Server, serverParams []tc.Parameter, opts *LoggingDotYAMLOpts, ) (Cfg, error)
func MakeLogsXMLDotConfig ¶
func MakeLogsXMLDotConfig( server *Server, serverParams []tc.Parameter, opt *LogsXMLDotConfigOpts, ) (Cfg, error)
func MakePackages ¶
func MakePackages( serverParams []tc.Parameter, 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.Topology, tcServerParams []tc.Parameter, tcParentConfigParams []tc.Parameter, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, cacheGroupArr []tc.CacheGroupNullable, dss []DeliveryServiceServer, cdn *tc.CDN, opt *ParentConfigOpts, ) (Cfg, error)
func MakePluginDotConfig ¶
func MakePluginDotConfig( server *Server, serverParams []tc.Parameter, opt *PluginDotConfigOpts, ) (Cfg, error)
func MakeRecordsDotConfig ¶
func MakeRecordsDotConfig( server *Server, serverParams []tc.Parameter, opt *RecordsConfigOpts, ) (Cfg, error)
func MakeRegexRemapDotConfig ¶
func MakeRegexRemapDotConfig( fileName string, server *Server, deliveryServices []DeliveryService, opt *RegexRemapDotConfigOpts, ) (Cfg, error)
func MakeRegexRevalidateDotConfig ¶
func MakeRegexRevalidateDotConfig( server *Server, deliveryServices []DeliveryService, globalParams []tc.Parameter, jobs []InvalidationJob, opt *RegexRevalidateDotConfigOpts, ) (Cfg, error)
func MakeRemapDotConfig ¶
func MakeRemapDotConfig( server *Server, unfilteredDSes []DeliveryService, dss []DeliveryServiceServer, dsRegexArr []tc.DeliveryServiceRegexes, serverParams []tc.Parameter, cdn *tc.CDN, remapConfigParams []tc.Parameter, topologies []tc.Topology, cacheGroupArr []tc.CacheGroupNullable, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, configDir string, opt *RemapDotConfigOpts, ) (Cfg, error)
func MakeSNIDotYAML ¶
func MakeSNIDotYAML( server *Server, dses []DeliveryService, dss []DeliveryServiceServer, dsRegexArr []tc.DeliveryServiceRegexes, tcParentConfigParams []tc.Parameter, cdn *tc.CDN, topologies []tc.Topology, cacheGroupArr []tc.CacheGroupNullable, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, opt *SNIDotYAMLOpts, ) (Cfg, error)
func MakeSSLMultiCertDotConfig ¶
func MakeSSLMultiCertDotConfig( server *Server, deliveryServices []DeliveryService, opt *SSLMultiCertDotConfigOpts, ) (Cfg, error)
func MakeSSLServerNameYAML ¶
func MakeSSLServerNameYAML( server *Server, dses []DeliveryService, dss []DeliveryServiceServer, dsRegexArr []tc.DeliveryServiceRegexes, tcParentConfigParams []tc.Parameter, cdn *tc.CDN, topologies []tc.Topology, cacheGroupArr []tc.CacheGroupNullable, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, opt *SSLServerNameYAMLOpts, ) (Cfg, error)
func MakeServerUnknown ¶
func MakeServerUnknown( fileName string, server *Server, serverParams []tc.Parameter, opt *ServerUnknownOpts, ) (Cfg, error)
func MakeSetDSCPDotConfig ¶
func MakeSetDSCPDotConfig( fileName string, server *Server, opt *SetDSCPDotConfigOpts, ) (Cfg, error)
func MakeStorageDotConfig ¶
func MakeStorageDotConfig( server *Server, serverParams []tc.Parameter, 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.Topology, tcServerParams []tc.Parameter, tcParentConfigParams []tc.Parameter, serverCapabilities map[int]map[ServerCapability]struct{}, dsRequiredCapabilities map[int]map[ServerCapability]struct{}, cacheGroupArr []tc.CacheGroupNullable, dss []DeliveryServiceServer, cdn *tc.CDN, opt *StrategiesYAMLOpts, ) (Cfg, error)
func MakeSysCtlDotConf ¶
func MakeSysCtlDotConf( server *Server, serverParams []tc.Parameter, opt *SysCtlDotConfOpts, ) (Cfg, error)
func MakeURISigningConfig ¶
func MakeURISigningConfig( fileName string, uriSigningKeys map[tc.DeliveryServiceName][]byte, opt *URISigningConfigOpts, ) (Cfg, error)
func MakeURLSigConfig ¶
func MakeURLSigConfig( fileName string, server *Server, serverParams []tc.Parameter, allURLSigKeys map[tc.DeliveryServiceName]tc.URLSigKeys, opt *URLSigConfigOpts, ) (Cfg, error)
func MakeVolumeDotConfig ¶
func MakeVolumeDotConfig( server *Server, serverParams []tc.Parameter, 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 ¶
func MakeConfigFilesList ¶
func MakeConfigFilesList( configDir string, server *Server, serverParams []tc.Parameter, deliveryServices []DeliveryService, deliveryServiceServers []DeliveryServiceServer, globalParams []tc.Parameter, cacheGroupArr []tc.CacheGroupNullable, topologies []tc.Topology, opt *ConfigFilesListOpts, ) ([]CfgMeta, []string, error)
MakeMetaObj returns the list of config files, any warnings, and any errors.
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 { }
ConfigFilesListOpts contains settings to configure generation options.
type DeliveryService ¶
type DeliveryService tc.DeliveryServiceV40
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.DeliveryServiceV40) []DeliveryService
ToDeliveryServices converts a slice of the latest lib/go-tc and traffic_ops/vx-client type to the local alias.
func V40ToDeliveryServices ¶
func V40ToDeliveryServices(dses []tc.DeliveryServiceV40) []DeliveryService
V40ToDeliveryServices converts a slice of the old traffic_ops/v4-client type to the local alias.
type DeliveryServiceID ¶
type DeliveryServiceID int
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 }
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 }
AStatsDotConfigOpts 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)
func JobsToInvalidationJobs ¶
func JobsToInvalidationJobs(oldJobs []tc.Job) ([]InvalidationJob, error)
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 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 }
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
type OriginHost ¶
type OriginHost string
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.
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 // 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 }
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 int) (string, []string, error)
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 }
func RemoveParentDuplicates ¶
func RemoveParentDuplicates(inputs []*ParentAbstractionServiceParent, seens map[string]struct{}) ([]*ParentAbstractionServiceParent, map[string]struct{})
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
type ParentAbstractionServiceParentSecondaryMode ¶
type ParentAbstractionServiceParentSecondaryMode string
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
func ParentSelectAlgorithmToParentAbstractionServiceRetryPolicy ¶
func ParentSelectAlgorithmToParentAbstractionServiceRetryPolicy(alg string) 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
func (ParentAbstractionServices) Less ¶
func (ps ParentAbstractionServices) Less(i, j int) bool
func (ParentAbstractionServices) Swap ¶
func (ps ParentAbstractionServices) Swap(i, j int)
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 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 ProfileName ¶
type ProfileName string
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 }
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 guarnateed 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 }
RemapDotConfigOpts contains settings to configure generation options.
type RemapLines ¶
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, dses []DeliveryService, dss []DeliveryServiceServer, dsRegexArr []tc.DeliveryServiceRegexes, tcParentConfigParams []tc.Parameter, cdn *tc.CDN, topologies []tc.Topology, cacheGroupArr []tc.CacheGroupNullable, 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.ServerV40
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
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.ServerUpdateStatusV4
ServerUdpateStatus is a tc.ServerUdpateStatus 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.ServerUpdateStatusV40) []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 guarnateed 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 }
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
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 ¶
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.
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
- 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