Documentation ¶
Index ¶
- Constants
- func GetSnapshot(tx *sql.Tx, cdn string) (string, bool, error)
- func GetSnapshotMonitoring(tx *sql.Tx, cdn string) (string, bool, error)
- func Handler(w http.ResponseWriter, r *http.Request)
- func Make(tx *sql.Tx, cdn, user, toHost, reqPath, toVersion string, ...) (*tc.CRConfig, error)
- func Snapshot(tx *sql.Tx, crc *tc.CRConfig, monitoringJSON *monitoring.Monitoring) error
- func SnapshotGetHandler(w http.ResponseWriter, r *http.Request)
- func SnapshotGetMonitoringHandler(w http.ResponseWriter, r *http.Request)
- func SnapshotGetMonitoringLegacyHandler(w http.ResponseWriter, r *http.Request)
- func SnapshotHandler(w http.ResponseWriter, r *http.Request)
- func SnapshotHandlerDeprecated(w http.ResponseWriter, r *http.Request)
- func SnapshotOldGUIHandler(w http.ResponseWriter, r *http.Request)
- func SnapshotOldGetHandler(w http.ResponseWriter, r *http.Request)
- type CRConfigConfigMaxmindDefaultOverride
- type CRConfigConfigParameter
- type DSRouteInfo
- type ServerAndHost
- type ServerParams
- type ServerUnion
Constants ¶
const CDNSOAAdmin = "traffic_ops"
const CDNSOAExpire = 604800 * time.Second
const CDNSOAMinimum = 30 * time.Second
const CDNSOARefresh = 28800 * time.Second
const CDNSOARetry = 7200 * time.Second
const DefaultTLDTTLNS = 3600 * time.Second
const DefaultTLDTTLSOA = 86400 * time.Second
const DefaultWeight = 0.999
const DefaultWeightMultiplier = 1000.0
const EdgeTypePrefix = "EDGE"
const GeoProviderMaxmindStr = "maxmindGeolocationService"
const GeoProviderNeustarStr = "neustarGeolocationService"
const MidTypePrefix = "MID"
const MonitorTypeName = "RASCAL"
const RouterTypeName = "CCR"
Variables ¶
This section is empty.
Functions ¶
func GetSnapshot ¶
GetSnapshot gets the snapshot for the given CDN. If the CDN does not exist, false is returned. If the CDN exists, but the snapshot does not, the string for an empty JSON object "{}" is returned. An error is only returned on database error, never if the CDN or snapshot does not exist.
func GetSnapshotMonitoring ¶
GetSnapshotMonitoring gets the monitor snapshot for the given CDN. If the CDN does not exist, false is returned. If the CDN exists, but the snapshot does not, the string for an empty JSON object "{}" is returned. An error is only returned on database error, never if the CDN or snapshot does not exist. Because all snapshotting is handled by the crconfig endpoints we have to also do the monitoring one here as well
func Handler ¶
func Handler(w http.ResponseWriter, r *http.Request)
Handler creates and serves the CRConfig from the raw SQL data. This MUST only be used for debugging or previewing, the raw un-snapshotted data MUST NOT be used by any component of the CDN.
func Make ¶
func Make(tx *sql.Tx, cdn, user, toHost, reqPath, toVersion string, useClientReqHost bool, emulateOldPath bool) (*tc.CRConfig, error)
Make creates and returns the CRConfig from the database.
func Snapshot ¶
func Snapshot(tx *sql.Tx, crc *tc.CRConfig, monitoringJSON *monitoring.Monitoring) error
Snapshot takes the CRConfig JSON-serializable object (which may be generated via crconfig.Make), and writes it to the snapshot table. It also takes the monitoring config JSON and writes it to the snapshot table.
func SnapshotGetHandler ¶
func SnapshotGetHandler(w http.ResponseWriter, r *http.Request)
SnapshotGetHandler gets and serves the CRConfig from the snapshot table.
func SnapshotGetMonitoringHandler ¶
func SnapshotGetMonitoringHandler(w http.ResponseWriter, r *http.Request)
SnapshotGetMonitoringHandler gets and serves the CRConfig from the snapshot table.
func SnapshotGetMonitoringLegacyHandler ¶
func SnapshotGetMonitoringLegacyHandler(w http.ResponseWriter, r *http.Request)
func SnapshotHandler ¶
func SnapshotHandler(w http.ResponseWriter, r *http.Request)
SnapshotHandler creates the CRConfig JSON and writes it to the snapshot table in the database.
func SnapshotHandlerDeprecated ¶
func SnapshotHandlerDeprecated(w http.ResponseWriter, r *http.Request)
SnapshotHandlerDeprecated creates the CRConfig JSON and writes it to the snapshot table in the database for deprecated routes.
func SnapshotOldGUIHandler ¶
func SnapshotOldGUIHandler(w http.ResponseWriter, r *http.Request)
SnapshotGUIHandler creates the CRConfig JSON and writes it to the snapshot table in the database. The response emulates the old Perl UI function. This should go away when the old Perl UI ceases to exist.
func SnapshotOldGetHandler ¶
func SnapshotOldGetHandler(w http.ResponseWriter, r *http.Request)
SnapshotOldGetHandler gets and serves the CRConfig from the snapshot table, not wrapped in response to match the old non-API CRConfig-Snapshots endpoint
Types ¶
type CRConfigConfigParameter ¶
type DSRouteInfo ¶
type ServerAndHost ¶
type ServerAndHost struct { Server ServerUnion Host string }
type ServerParams ¶
type ServerParams struct { APIPort *string SecureAPIPort *string Weight *float64 WeightMultiplier *float64 }
ServerParams contains parameter data filled in the CRConfig Servers objects. If a given param doesn't exist on the given server, it will be nil.
type ServerUnion ¶
ServerUnion has all fields from all servers. This is used to select all server data with a single query, and then convert each to the proper type afterwards.