Documentation
¶
Overview ¶
DO NOT EDIT.. COPY FROM bifrost/app/components/synthetics/helper.go
Index ¶
- func CreateScriptSnippet(req SyntheticCheck) string
- func NewBrowserChecker(c SyntheticCheck) *browserChecker
- func TimerNew(fun func(), fireInNs time.Duration, interval time.Duration) func()
- type AlertConditionsOptions
- type AssertionsCasesOptions
- type AssertionsOptions
- type Authentication
- type AwsSignature
- type BaseCheckerForTTL
- type Basic
- type Browser
- type BrowserConfig
- type CacheEntry
- type CaseOptions
- type CheckState
- type CheckTestRequestHeaders
- type ClientCertificate
- type CommandArgs
- type Config
- type DefaultNetter
- type Device
- type Digest
- type DomainExpiryCache
- type Failure
- type GRPCPayloadOptions
- type HTTPHeadersOptions
- type HTTPMultiStepsOptions
- type HTTPMultiStepsRequest
- type HTTPPayloadOptions
- type ICMPPayloadOptions
- type Mode
- type MonitorOptions
- type Netter
- type Ntlm
- type Oauth21
- type RUMConfig
- type RequestBody
- type RequestOptions
- type Resolution
- type RumConfig
- type SpecifyFrequencyOptions
- type SpecifyTimeRange
- type SyntheticCheck
- type SyntheticsExpectMeta
- type SyntheticsModel
- type SyntheticsRequestOptions
- type SyntheticsTags
- type TestReport
- type TestResult
- type TestSummary
- type Timer
- type UDPPayloadOptions
- type WSPayloadAuthentication
- type WSPayloadHeaders
- type WSPayloadOptions
- type Worker
- func (w *Worker) DeleteMessage(key string)
- func (w *Worker) DirectRun(v SyntheticCheck) (map[string]interface{}, error)
- func (w *Worker) GetMessage(key string) (*ws.Msg, bool)
- func (w *Worker) RealDirectRun(v SyntheticCheck) (map[string]interface{}, error)
- func (w *Worker) Run()
- func (w *Worker) SetMessage(key string, msg *ws.Msg)
- func (w *Worker) SubscribeUpdates(topic string, token string)
- func (w *Worker) UnsubscribeUpdates(topic string, token string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateScriptSnippet ¶
func CreateScriptSnippet(req SyntheticCheck) string
func NewBrowserChecker ¶ added in v1.0.39
func NewBrowserChecker(c SyntheticCheck) *browserChecker
Types ¶
type AlertConditionsOptions ¶
type AssertionsCasesOptions ¶
type AssertionsCasesOptions struct {
Cases []CaseOptions `json:"cases"`
}
type AssertionsOptions ¶
type AssertionsOptions struct {
HTTP AssertionsCasesOptions `json:"http"`
TCP AssertionsCasesOptions `json:"tcp"`
Ssl AssertionsCasesOptions `json:"ssl"`
DNS AssertionsCasesOptions `json:"dns"`
WebSocket AssertionsCasesOptions `json:"web_socket"`
UDP AssertionsCasesOptions `json:"udp"`
ICMP AssertionsCasesOptions `json:"icmp"`
GRPC AssertionsCasesOptions `json:"grpc"`
}
type Authentication ¶
type Authentication struct {
ClientCertificate ClientCertificate `json:"client_certificate"`
Type string `json:"type"`
Basic Basic `json:"basic"`
Digest Digest `json:"digest"`
Ntlm Ntlm `json:"ntlm"`
AwsSignature AwsSignature `json:"aws_signature"`
Oauth21 Oauth21 `json:"oauth2_1"`
}
type AwsSignature ¶
type BaseCheckerForTTL ¶ added in v1.0.22
type BaseCheckerForTTL struct {
// contains filtered or unexported fields
}
type BrowserConfig ¶ added in v1.0.39
type CacheEntry ¶ added in v1.0.29
type CaseOptions ¶
type CheckState ¶
type CheckState struct {
// contains filtered or unexported fields
}
type CheckTestRequestHeaders ¶
type ClientCertificate ¶
type CommandArgs ¶ added in v1.0.39
type DefaultNetter ¶ added in v1.0.22
type DefaultNetter struct{}
func (*DefaultNetter) ConnClose ¶ added in v1.0.22
func (d *DefaultNetter) ConnClose(conn net.Conn) error
func (*DefaultNetter) DialTimeout ¶ added in v1.0.22
type Device ¶ added in v1.0.39
type Device struct {
Resolution Resolution `json:"resolution"`
Browser Browser `json:"browser"`
}
type DomainExpiryCache ¶ added in v1.0.29
type DomainExpiryCache struct {
Store map[int]CacheEntry // checker.c.id -> CacheEntry
// contains filtered or unexported fields
}
func GetDomainExpiryStoreInstance ¶ added in v1.0.29
func GetDomainExpiryStoreInstance() *DomainExpiryCache
GetDomainExpiryStoreInstance returns signleton instance of DomainExpiryCache
func (*DomainExpiryCache) AddOrUpdateCache ¶ added in v1.0.29
func (d *DomainExpiryCache) AddOrUpdateCache(id int, entry CacheEntry)
AddOrUpdateCache update the cache
func (*DomainExpiryCache) GetCache ¶ added in v1.0.29
func (d *DomainExpiryCache) GetCache(id int) (CacheEntry, bool)
GetCache returns the cache entry for a given id.
type GRPCPayloadOptions ¶
type GRPCPayloadOptions struct {
CheckType string `json:"check_type" default:"behaviour"`
Service string `json:"service"`
ServiceDefinition string `json:"service_definition"`
MethodSelection string `json:"method_selection"`
ProtoFileContent string `json:"proto_file_content"`
Message string `json:"message"`
IgnoreServerCertificateError bool `json:"ignore_server_certificate_error"`
Metadata []struct {
Name string `json:"name"`
Value string `json:"value"`
} `json:"metadata"`
Certificate string `json:"certificate"`
PrivateKey string `json:"private_key"`
}
type HTTPHeadersOptions ¶
type HTTPMultiStepsOptions ¶
type HTTPMultiStepsOptions struct {
StepName string `json:"step_name"`
Endpoint string `json:"endpoint"`
Expect SyntheticsExpectMeta `json:"expect"`
Request HTTPMultiStepsRequest `json:"request"`
}
type HTTPMultiStepsRequest ¶
type HTTPMultiStepsRequest struct {
HTTPMethod string `json:"http_method"`
HTTPVersion string `json:"http_version"`
HTTPHeaders []HTTPHeadersOptions `json:"http_headers"`
HTTPPayload HTTPPayloadOptions `json:"http_payload"`
Assertions AssertionsOptions `json:"assertions"`
}
type HTTPPayloadOptions ¶
type HTTPPayloadOptions struct {
FollowRedirects bool `json:"follow_redirects"`
IgnoreServerCertificateError bool `json:"ignore_server_certificate_error"`
Cookies string `json:"cookies"`
QueryParams []struct {
Name string `json:"name"`
Value string `json:"value"`
} `json:"query_params"`
RequestBody RequestBody `json:"request_body"`
Privacy struct {
SaveBodyResponse bool `json:"save_body_response"`
} `json:"privacy"`
Proxy struct {
URL string `json:"url"`
Headers []struct {
Name string `json:"name"`
Value string `json:"value"`
} `json:"headers"`
} `json:"proxy"`
Authentication Authentication `json:"authentication"`
}
type ICMPPayloadOptions ¶
type ICMPPayloadOptions struct {
PingsPerTest int `json:"pings_per_test"`
}
type MonitorOptions ¶
type MonitorOptions struct {
Source string `json:"source"` // slack, email, webhook, etc
NotifyTo []interface{} `json:"notify_to"`
Renotify bool `json:"renotify"`
RenotifyIntervalSeconds int `json:"renotify_interval_seconds"`
Priority string `json:"priority"`
TriggerFailsCase bool `json:"trigger_fails_case"`
TriggerFailsCaseCount int `json:"trigger_fails_case_count"`
}
type Oauth21 ¶
type Oauth21 struct {
CredentialsType string `json:"credentials_type"`
TokenAPIAuthentication string `json:"token_api_authentication"`
AccessTokenURL string `json:"access_token_url"`
Username string `json:"username"`
Password string `json:"password"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
Audience string `json:"audience"`
Resource string `json:"resource"`
Scopes string `json:"scopes"`
}
type RequestBody ¶
type RequestOptions ¶
type Resolution ¶ added in v1.0.39
type SpecifyFrequencyOptions ¶
type SpecifyFrequencyOptions struct {
Type string `json:"type"`
IntervalType string `json:"interval_type"`
SpecifyTimeRange SpecifyTimeRange `json:"specify_time_range"`
}
type SpecifyTimeRange ¶ added in v1.0.15
type SyntheticCheck ¶
type SyntheticCheck struct {
Uid string
//Not string
SyntheticsModel
}
type SyntheticsExpectMeta ¶
type SyntheticsExpectMeta struct {
HttpCode int `json:"http_status_code,omitempty"`
ResponseText string `json:"response_text,omitempty"`
ResponseTimeLessThan int `json:"response_time_less_than,omitempty"`
PacketLossLimit float64 `json:"packet_loss_limit,omitempty"`
LatencyLimit float64 `json:"latency_limit,omitempty"`
}
type SyntheticsModel ¶
type SyntheticsModel struct {
Id int `json:"id"`
AccountId int `json:"account_id"`
UserId int `json:"user_id"`
Proto string `json:"proto"`
SlugName string `json:"slug_name"`
Endpoint string `json:"endpoint"`
IntervalSeconds int `json:"interval_seconds"`
Locations string `json:"locations"`
Status string `json:"status"`
Tags []string `json:"tags"`
Expect SyntheticsExpectMeta `json:"expect"`
Request SyntheticsRequestOptions `json:"request"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Action string `json:"action"`
AccountKey string `json:"account_key"`
AccountUID string `json:"account_uid"`
Details map[string]interface{} `json:"details"`
IsPreviewRequest bool `json:"is_preview_request"`
}
type SyntheticsRequestOptions ¶
type SyntheticsRequestOptions struct {
Topic string `json:"topic" default:"locations"`
Premise []string `json:"premise"`
Environment []interface{} `json:"environment"`
TTL bool `json:"ttl"`
SslSignedCertificate bool `json:"ssl_signed_certificate"`
SslRevokedCertificateFail bool `json:"ssl_revoked_certificate_fail"`
SslServerName string `json:"ssl_server_name"`
SslCertificatePrivateKey string `json:"ssl_certificate_private_key"`
SslCertificate string `json:"ssl_certificate"`
SslMinVersion int `json:"ssl_min_version"`
SslMaxVersion int `json:"ssl_max_version"`
DNSServer string `json:"dns_server"`
ICMPPayload ICMPPayloadOptions `json:"icmp_payload"`
Port string `json:"port"`
HTTPMethod string `json:"http_method"`
HTTPVersion string `json:"http_version"`
HTTPHeaders []HTTPHeadersOptions `json:"http_headers"`
HTTPPayload HTTPPayloadOptions `json:"http_payload"`
GRPCPayload GRPCPayloadOptions `json:"grpc_payload"`
UDPPayload UDPPayloadOptions `json:"udp_payload"`
WSPayload WSPayloadOptions `json:"ws_payload"`
SpecifyFrequency SpecifyFrequencyOptions `json:"specify_frequency"`
Assertions AssertionsOptions `json:"assertions"`
AlertConditions AlertConditionsOptions `json:"alert_conditions"`
Monitor MonitorOptions `json:"monitor"`
CurrentAction string `json:"current_action" default:"play"`
StepTestIndex int `json:"step_test_index"`
HTTPMultiTest bool `json:"http_multi_test"`
HTTPMultiSteps []HTTPMultiStepsOptions `json:"http_multi_steps"`
Browsers map[string][]string `json:"browsers"`
Recording json.RawMessage `json:"recording"`
RUMConfig RUMConfig `json:"rumConfig"`
Timeout int `json:"waitTimeout"`
StepsCount int `json:"stepsCount"`
TakeScreenshots bool `json:"take_screenshots"`
Timezone string `json:"timezone"`
Language string `json:"language"`
DisableCors bool `json:"disable_cors"`
DisableCSP bool `json:"disable_csp"`
}
type SyntheticsTags ¶
type TestReport ¶ added in v1.0.39
type TestReport struct {
Steps interface{} `json:"steps"`
TestResult TestResult `json:"result"`
}
type TestResult ¶ added in v1.0.39
type TestResult struct {
Config BrowserConfig `json:"config"`
TestSummary TestSummary `json:"test_summary"`
Status string `json:"status"`
TestDuration int64 `json:"test_duration"`
RecordingURL string `json:"recordingUrl"`
ConsoleURL string `json:"consoleUrl"`
HARUrl string `json:"harUrl"`
TimeToInteractive float64 `json:"timeToInteractive"`
RumConfig RumConfig `json:"rumConfig"`
Failure *Failure `json:"failure,omitempty"`
}
type TestSummary ¶ added in v1.0.39
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
func SetTimeout ¶
SetTimeout runs the specified function after waiting the specified duration (defined in milliseconds)
type UDPPayloadOptions ¶
type UDPPayloadOptions struct {
Message string `json:"message"`
}
type WSPayloadAuthentication ¶
type WSPayloadHeaders ¶
type WSPayloadOptions ¶
type WSPayloadOptions struct {
Message string `json:"message"`
Headers []WSPayloadHeaders `json:"headers"`
Authentication WSPayloadAuthentication `json:"authentication"`
}
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker is the main worker struct
func (*Worker) DeleteMessage ¶ added in v1.0.21
func (*Worker) DirectRun ¶ added in v1.0.2
func (w *Worker) DirectRun(v SyntheticCheck) (map[string]interface{}, error)
func (*Worker) GetMessage ¶ added in v1.0.21
func (*Worker) RealDirectRun ¶ added in v1.0.10
func (w *Worker) RealDirectRun(v SyntheticCheck) (map[string]interface{}, error)
func (*Worker) SubscribeUpdates ¶
func (*Worker) UnsubscribeUpdates ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.