Documentation
¶
Overview ¶
Code generated by model_paginated_gen. DO NOT EDIT.
Index ¶
- Variables
- type Account
- type Agreement
- type AgreementNotFoundError
- type AgreementType
- type CreateDomainRequest
- type CreateJobRequest
- type CreateTestAuthorisation
- type CreateTestJobRequest
- type CreateTestRequest
- type CreateTestThreshold
- type Domain
- type DomainNotFoundError
- type DomainStatus
- type DomainVerificationMethod
- type GetAccountResponseBody
- type GetAgreementResponseBody
- type GetDomainResponseBody
- type GetDomainsResponseBody
- type GetJobResponseBody
- type GetJobResultsResponseBody
- type GetJobSettingsResponseBody
- type GetJobsResponseBody
- type GetScenariosResponseBody
- type GetTestResponseBody
- type GetTestsResponseBody
- type GetThresholdResponseBody
- type GetThresholdsResponseBody
- type Job
- type JobFailType
- type JobNotFoundError
- type JobResults
- type JobResultsAxis
- type JobSettings
- type JobStatus
- type LTaaSService
- type PaginatedDomain
- type PaginatedJob
- type PaginatedScenario
- type PaginatedTest
- type PaginatedThreshold
- type Scenario
- type Service
- func (s *Service) CreateAccount() (string, error)
- func (s *Service) CreateDomain(req CreateDomainRequest) (string, error)
- func (s *Service) CreateJob(req CreateJobRequest) (string, error)
- func (s *Service) CreateTest(req CreateTestRequest) (string, error)
- func (s *Service) DeleteDomain(domainID string) error
- func (s *Service) DeleteJob(jobID string) error
- func (s *Service) DeleteTest(testID string) error
- func (s *Service) GetDomain(domainID string) (Domain, error)
- func (s *Service) GetDomains(parameters connection.APIRequestParameters) ([]Domain, error)
- func (s *Service) GetDomainsPaginated(parameters connection.APIRequestParameters) (*PaginatedDomain, error)
- func (s *Service) GetJob(jobID string) (Job, error)
- func (s *Service) GetJobResults(jobID string) (JobResults, error)
- func (s *Service) GetJobSettings(jobID string) (JobSettings, error)
- func (s *Service) GetJobs(parameters connection.APIRequestParameters) ([]Job, error)
- func (s *Service) GetJobsPaginated(parameters connection.APIRequestParameters) (*PaginatedJob, error)
- func (s *Service) GetLatestAgreement(agreementType AgreementType) (Agreement, error)
- func (s *Service) GetScenarios(parameters connection.APIRequestParameters) ([]Scenario, error)
- func (s *Service) GetScenariosPaginated(parameters connection.APIRequestParameters) (*PaginatedScenario, error)
- func (s *Service) GetTest(testID string) (Test, error)
- func (s *Service) GetTests(parameters connection.APIRequestParameters) ([]Test, error)
- func (s *Service) GetTestsPaginated(parameters connection.APIRequestParameters) (*PaginatedTest, error)
- func (s *Service) GetThreshold(thresholdID string) (Threshold, error)
- func (s *Service) GetThresholds(parameters connection.APIRequestParameters) ([]Threshold, error)
- func (s *Service) GetThresholdsPaginated(parameters connection.APIRequestParameters) (*PaginatedThreshold, error)
- func (s *Service) StopJob(jobID string) error
- func (s *Service) VerifyDomainDNS(domainID string) error
- func (s *Service) VerifyDomainFile(domainID string) error
- type Test
- type TestDuration
- type TestNotFoundError
- type TestProtocol
- type TestRecurringType
- type Threshold
- type ThresholdNotFoundError
Constants ¶
This section is empty.
Variables ¶
var AgreementTypeEnum = []connection.Enum{ AgreementTypeSingle, AgreementTypeRecurring, }
var DomainVerificationMethodEnum = []connection.Enum{ DomainVerificationMethodDNS, DomainVerificationMethodFileUpload, }
var TestProtocolEnum = []connection.Enum{ TestProtocolHTTP, TestProtocolHTTPS, }
Functions ¶
This section is empty.
Types ¶
type Account ¶ added in v1.3.1
type Account struct {
ID string `json:"id"`
}
Account represents an LTaaS account
type AgreementNotFoundError ¶
type AgreementNotFoundError struct {
Type AgreementType
}
AgreementNotFoundError indicates a agreement was not found
func (*AgreementNotFoundError) Error ¶
func (e *AgreementNotFoundError) Error() string
type AgreementType ¶
type AgreementType string
const ( AgreementTypeSingle AgreementType = "single" AgreementTypeRecurring AgreementType = "recurring" )
func ParseAgreementType ¶ added in v1.3.1
func ParseAgreementType(s string) (AgreementType, error)
ParseAgreementType attempts to parse a AgreementType from string
func (AgreementType) String ¶
func (s AgreementType) String() string
type CreateDomainRequest ¶
type CreateDomainRequest struct { connection.APIRequestBodyDefaultValidator Name string `json:"name" validate:"required"` VerificationMethod DomainVerificationMethod `json:"verification_method" validate:"required"` }
CreateDomainRequest represents a request to create a domain
func (*CreateDomainRequest) Validate ¶
func (c *CreateDomainRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type CreateJobRequest ¶
type CreateJobRequest struct { connection.APIRequestBodyDefaultValidator TestID string `json:"test_id" validate:"required"` ScheduledTimestamp connection.DateTime `json:"scheduled_timestamp,omitempty"` RunNow bool `json:"run_now"` }
CreateJobRequest represents a request to create a job
func (*CreateJobRequest) Validate ¶
func (c *CreateJobRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type CreateTestAuthorisation ¶
type CreateTestAuthorisation struct { AgreementVersion string `json:"agreement_version" validate:"required"` Name string `json:"name" validate:"required"` Position string `json:"position" validate:"required"` Company string `json:"company" validate:"required"` }
CreateTestAuthorisation represents the test authorisation payload
type CreateTestJobRequest ¶
type CreateTestJobRequest struct { connection.APIRequestBodyDefaultValidator ScheduledTimestamp connection.DateTime `json:"scheduled_timestamp,omitempty"` RunNow bool `json:"run_now"` }
CreateTestJobRequest represents a request to create a job for a test
func (*CreateTestJobRequest) Validate ¶
func (c *CreateTestJobRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type CreateTestRequest ¶
type CreateTestRequest struct { connection.APIRequestBodyDefaultValidator DomainID string `json:"domain_id" validate:"required"` Name string `json:"name" validate:"required"` ScenarioID string `json:"scenario_id"` ScriptID string `json:"script_id,omitempty"` Protocol TestProtocol `json:"protocol"` Path string `json:"path,omitempty"` NumberOfUsers int `json:"number_of_users"` Duration TestDuration `json:"duration"` Authorisation CreateTestAuthorisation `json:"authorisation" validate:"required"` Thresholds []CreateTestThreshold `json:"thresholds"` }
CreateTestRequest represents a request to create a test
func (*CreateTestRequest) Validate ¶
func (c *CreateTestRequest) Validate() *connection.ValidationError
Validate returns an error if struct properties are missing/invalid
type CreateTestThreshold ¶
type CreateTestThreshold struct { ThresholdID string `json:"threshold_id"` Values *string `json:"values"` Warn *int `json:"warn"` Fail *int `json:"fail"` }
CreateTestThreshold represents the test threshold payload
type Domain ¶
type Domain struct { ID string `json:"id"` Name string `json:"name"` VerificationMethod DomainVerificationMethod `json:"verification_method"` VerifyHash string `json:"verify_hash"` Status DomainStatus `json:"status"` CreatedAt connection.DateTime `json:"created_at"` UpdatedAt connection.DateTime `json:"updated_at"` }
Domain represents an LTaaS domain
type DomainNotFoundError ¶
type DomainNotFoundError struct {
ID string
}
DomainNotFoundError indicates a domain was not found
func (*DomainNotFoundError) Error ¶
func (e *DomainNotFoundError) Error() string
type DomainStatus ¶
type DomainStatus string
const ( DomainStatusVerified DomainStatus = "Verified" DomainStatusNotVerified DomainStatus = "Not verified" )
func (DomainStatus) String ¶
func (s DomainStatus) String() string
type DomainVerificationMethod ¶
type DomainVerificationMethod string
const ( DomainVerificationMethodDNS DomainVerificationMethod = "DNS" DomainVerificationMethodFileUpload DomainVerificationMethod = "File upload" )
func ParseDomainVerificationMethod ¶
func ParseDomainVerificationMethod(s string) (DomainVerificationMethod, error)
ParseDomainVerificationMethod attempts to parse a DomainVerificationMethod from string
func (DomainVerificationMethod) String ¶
func (s DomainVerificationMethod) String() string
type GetAccountResponseBody ¶ added in v1.3.1
type GetAccountResponseBody struct { connection.APIResponseBody Data Account `json:"data"` }
GetAccountResponseBody represents the API response body from the GetAccount resource
type GetAgreementResponseBody ¶
type GetAgreementResponseBody struct { connection.APIResponseBody Data Agreement `json:"data"` }
GetAgreementResponseBody represents the API response body from the GetAgreement resource
type GetDomainResponseBody ¶
type GetDomainResponseBody struct { connection.APIResponseBody Data Domain `json:"data"` }
GetDomainResponseBody represents the API response body from the GetDomain resource
type GetDomainsResponseBody ¶
type GetDomainsResponseBody struct { connection.APIResponseBody Data []Domain `json:"data"` }
GetDomainsResponseBody represents the API response body from the GetDomains resource
type GetJobResponseBody ¶
type GetJobResponseBody struct { connection.APIResponseBody Data Job `json:"data"` }
GetJobResponseBody represents the API response body from the GetJob resource
type GetJobResultsResponseBody ¶
type GetJobResultsResponseBody struct { connection.APIResponseBody Data JobResults `json:"data"` }
GetJobResultsResponseBody represents the API response body from the GetJobResults resource
type GetJobSettingsResponseBody ¶
type GetJobSettingsResponseBody struct { connection.APIResponseBody Data JobSettings `json:"data"` }
GetJobSettingsResponseBody represents the API response body from the GetJobSettings resource
type GetJobsResponseBody ¶
type GetJobsResponseBody struct { connection.APIResponseBody Data []Job `json:"data"` }
GetJobsResponseBody represents the API response body from the GetJobs resource
type GetScenariosResponseBody ¶
type GetScenariosResponseBody struct { connection.APIResponseBody Data []Scenario `json:"data"` }
GetScenariosResponseBody represents the API response body from the GetScenarios resource
type GetTestResponseBody ¶
type GetTestResponseBody struct { connection.APIResponseBody Data Test `json:"data"` }
GetTestResponseBody represents the API response body from the GetTest resource
type GetTestsResponseBody ¶
type GetTestsResponseBody struct { connection.APIResponseBody Data []Test `json:"data"` }
GetTestsResponseBody represents the API response body from the GetTests resource
type GetThresholdResponseBody ¶
type GetThresholdResponseBody struct { connection.APIResponseBody Data Threshold `json:"data"` }
GetThresholdResponseBody represents the API response body from the GetThreshold resource
type GetThresholdsResponseBody ¶
type GetThresholdsResponseBody struct { connection.APIResponseBody Data []Threshold `json:"data"` }
GetThresholdsResponseBody represents the API response body from the GetThresholds resource
type Job ¶
type Job struct { ID string `json:"id"` TestID string `json:"test_id"` DomainID string `json:"domain_id"` ScheduledTimestamp connection.DateTime `json:"scheduled_timestamp"` JobStartTimestamp connection.DateTime `json:"job_start_timestamp"` JobEndTimestamp connection.DateTime `json:"job_end_timestamp"` Status JobStatus `json:"status"` FailType JobFailType `json:"fail_type"` CreatedAt connection.DateTime `json:"created_at"` UpdatedAt connection.DateTime `json:"updated_at"` }
Job represents an LTaaS job
type JobFailType ¶
type JobFailType string
const ( JobFailTypeTest JobFailType = "Test" JobFailTypeInfrastructure JobFailType = "Infrastructure" )
func (JobFailType) String ¶
func (s JobFailType) String() string
type JobNotFoundError ¶
type JobNotFoundError struct {
ID string
}
JobNotFoundError indicates a job was not found
func (*JobNotFoundError) Error ¶
func (e *JobNotFoundError) Error() string
type JobResults ¶
type JobResults struct { VirtualUsers []JobResultsAxis `json:"virtual_users"` SuccessfulRequests []JobResultsAxis `json:"successful_requests"` FailedRequests []JobResultsAxis `json:"failed_requests"` Latency []JobResultsAxis `json:"latency"` }
JobResults represents the results of an LTaaS job
type JobResultsAxis ¶
type JobResultsAxis struct { X connection.DateTime `json:"x"` Y float64 `json:"y"` }
type JobSettings ¶
type JobSettings struct { Date connection.DateTime `json:"date"` Type string `json:"type"` Name string `json:"name"` Duration TestDuration `json:"duration"` MaxUsers int `json:"max_users"` Protocol TestProtocol `json:"protocol"` Domain string `json:"domain"` Path string `json:"path"` }
JobSettings represents the settings of an LTaaS job
type LTaaSService ¶
type LTaaSService interface { CreateAccount() (string, error) GetDomains(parameters connection.APIRequestParameters) ([]Domain, error) GetDomainsPaginated(parameters connection.APIRequestParameters) (*PaginatedDomain, error) GetDomain(domainID string) (Domain, error) CreateDomain(req CreateDomainRequest) (string, error) DeleteDomain(domainID string) error VerifyDomainFile(domainID string) error VerifyDomainDNS(domainID string) error GetTests(parameters connection.APIRequestParameters) ([]Test, error) GetTestsPaginated(parameters connection.APIRequestParameters) (*PaginatedTest, error) GetTest(testID string) (Test, error) CreateTest(req CreateTestRequest) (string, error) DeleteTest(testID string) error GetJobs(parameters connection.APIRequestParameters) ([]Job, error) GetJobsPaginated(parameters connection.APIRequestParameters) (*PaginatedJob, error) GetJob(testID string) (Job, error) GetJobResults(jobID string) (JobResults, error) GetJobSettings(jobID string) (JobSettings, error) CreateJob(req CreateJobRequest) (string, error) DeleteJob(jobID string) error StopJob(jobID string) error GetThresholds(parameters connection.APIRequestParameters) ([]Threshold, error) GetThresholdsPaginated(parameters connection.APIRequestParameters) (*PaginatedThreshold, error) GetThreshold(thresholdID string) (Threshold, error) GetScenarios(parameters connection.APIRequestParameters) ([]Scenario, error) GetScenariosPaginated(parameters connection.APIRequestParameters) (*PaginatedScenario, error) GetLatestAgreement(agreementType AgreementType) (Agreement, error) }
LTaaSService is an interface for managing LTaaS
type PaginatedDomain ¶
type PaginatedDomain struct { *connection.PaginatedBase Items []Domain }
PaginatedDomain represents a paginated collection of Domain
func NewPaginatedDomain ¶
func NewPaginatedDomain(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Domain) *PaginatedDomain
NewPaginatedDomain returns a pointer to an initialized PaginatedDomain struct
type PaginatedJob ¶
type PaginatedJob struct { *connection.PaginatedBase Items []Job }
PaginatedJob represents a paginated collection of Job
func NewPaginatedJob ¶
func NewPaginatedJob(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Job) *PaginatedJob
NewPaginatedJob returns a pointer to an initialized PaginatedJob struct
type PaginatedScenario ¶
type PaginatedScenario struct { *connection.PaginatedBase Items []Scenario }
PaginatedScenario represents a paginated collection of Scenario
func NewPaginatedScenario ¶
func NewPaginatedScenario(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Scenario) *PaginatedScenario
NewPaginatedScenario returns a pointer to an initialized PaginatedScenario struct
type PaginatedTest ¶
type PaginatedTest struct { *connection.PaginatedBase Items []Test }
PaginatedTest represents a paginated collection of Test
func NewPaginatedTest ¶
func NewPaginatedTest(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Test) *PaginatedTest
NewPaginatedTest returns a pointer to an initialized PaginatedTest struct
type PaginatedThreshold ¶
type PaginatedThreshold struct { *connection.PaginatedBase Items []Threshold }
PaginatedThreshold represents a paginated collection of Threshold
func NewPaginatedThreshold ¶
func NewPaginatedThreshold(getFunc connection.PaginatedGetFunc, parameters connection.APIRequestParameters, pagination connection.APIResponseMetadataPagination, items []Threshold) *PaginatedThreshold
NewPaginatedThreshold returns a pointer to an initialized PaginatedThreshold struct
type Scenario ¶
type Scenario struct { ID string `json:"id"` Name string `json:"name"` AvailableTrial bool `json:"available_trial"` Formula string `json:"formula"` Description string `json:"description"` CreatedAt connection.DateTime `json:"created_at"` UpdatedAt connection.DateTime `json:"updated_at"` }
Scenario represents a test scenario
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements LTaaSService for managing LTaaS via the UKFast API
func NewService ¶
func NewService(connection connection.Connection) *Service
NewService returns a new instance of LTaaSService
func (*Service) CreateAccount ¶ added in v1.3.1
CreateAccount creates a new account
func (*Service) CreateDomain ¶
func (s *Service) CreateDomain(req CreateDomainRequest) (string, error)
CreateDomain creates a new domain
func (*Service) CreateJob ¶
func (s *Service) CreateJob(req CreateJobRequest) (string, error)
CreateJob creates a new job
func (*Service) CreateTest ¶
func (s *Service) CreateTest(req CreateTestRequest) (string, error)
CreateTest creates a new test
func (*Service) DeleteDomain ¶
DeleteDomain removes a domain
func (*Service) DeleteTest ¶
DeleteTest removes a test
func (*Service) GetDomains ¶
func (s *Service) GetDomains(parameters connection.APIRequestParameters) ([]Domain, error)
GetDomains retrieves a list of domains
func (*Service) GetDomainsPaginated ¶
func (s *Service) GetDomainsPaginated(parameters connection.APIRequestParameters) (*PaginatedDomain, error)
GetDomainsPaginated retrieves a paginated list of domains
func (*Service) GetJobResults ¶
func (s *Service) GetJobResults(jobID string) (JobResults, error)
GetJobResults retrieves the results of a single job by id
func (*Service) GetJobSettings ¶
func (s *Service) GetJobSettings(jobID string) (JobSettings, error)
GetJobSettings retrieves the settings of a single job by id
func (*Service) GetJobs ¶
func (s *Service) GetJobs(parameters connection.APIRequestParameters) ([]Job, error)
GetJobs retrieves a list of jobs
func (*Service) GetJobsPaginated ¶
func (s *Service) GetJobsPaginated(parameters connection.APIRequestParameters) (*PaginatedJob, error)
GetJobsPaginated retrieves a paginated list of jobs
func (*Service) GetLatestAgreement ¶
func (s *Service) GetLatestAgreement(agreementType AgreementType) (Agreement, error)
GetLatestAgreement retrieves the latest agreement for given type
func (*Service) GetScenarios ¶
func (s *Service) GetScenarios(parameters connection.APIRequestParameters) ([]Scenario, error)
GetScenarios retrieves a list of scenarios
func (*Service) GetScenariosPaginated ¶
func (s *Service) GetScenariosPaginated(parameters connection.APIRequestParameters) (*PaginatedScenario, error)
GetScenariosPaginated retrieves a paginated list of scenarios
func (*Service) GetTests ¶
func (s *Service) GetTests(parameters connection.APIRequestParameters) ([]Test, error)
GetTests retrieves a list of tests
func (*Service) GetTestsPaginated ¶
func (s *Service) GetTestsPaginated(parameters connection.APIRequestParameters) (*PaginatedTest, error)
GetTestsPaginated retrieves a paginated list of tests
func (*Service) GetThreshold ¶
GetThreshold retrieves a single threshold by id
func (*Service) GetThresholds ¶
func (s *Service) GetThresholds(parameters connection.APIRequestParameters) ([]Threshold, error)
GetThresholds retrieves a list of thresholds
func (*Service) GetThresholdsPaginated ¶
func (s *Service) GetThresholdsPaginated(parameters connection.APIRequestParameters) (*PaginatedThreshold, error)
GetThresholdsPaginated retrieves a paginated list of thresholds
func (*Service) VerifyDomainDNS ¶ added in v1.3.1
VerifyDomainDNS verifies a domain by DNS method
func (*Service) VerifyDomainFile ¶ added in v1.3.1
VerifyDomainFile verifies a domain by File method
type Test ¶
type Test struct { ID string `json:"id"` Name string `json:"name"` ScriptID string `json:"script_id"` ScenarioID string `json:"scenario_id"` DomainID string `json:"domain_id"` Protocol TestProtocol `json:"protocol"` Path string `json:"path"` NumberOfUsers int `json:"number_of_users"` Duration TestDuration `json:"duration"` RecurringType TestRecurringType `json:"recurring_type"` // TODO: Change back to `int`. Server-side issue causing null/empty value of RecurringValue to be string, not int. #121 RecurringValue interface{} `json:"recurring_value"` NextRun connection.DateTime `json:"next_run"` CreatedAt connection.DateTime `json:"created_at"` UpdatedAt connection.DateTime `json:"updated_at"` }
Test represents an LTaaS test
type TestDuration ¶
type TestDuration string
TestDuration represents a load test duration
func ParseTestDuration ¶
func ParseTestDuration(s string) (TestDuration, error)
ParseTestDuration parses string s and returns a pointer to an initialised TestDuration
func (*TestDuration) Duration ¶
func (d *TestDuration) Duration() time.Duration
Duration returns the test duration as time.Duration
type TestNotFoundError ¶
type TestNotFoundError struct {
ID string
}
TestNotFoundError indicates a test was not found
func (*TestNotFoundError) Error ¶
func (e *TestNotFoundError) Error() string
type TestProtocol ¶
type TestProtocol string
const ( TestProtocolHTTP TestProtocol = "http" TestProtocolHTTPS TestProtocol = "https" )
func ParseTestProtocol ¶ added in v1.3.1
func ParseTestProtocol(s string) (TestProtocol, error)
ParseTestProtocol attempts to parse a TestProtocol from string
func (TestProtocol) String ¶
func (s TestProtocol) String() string
type TestRecurringType ¶
type TestRecurringType string
const ( TestRecurringTypeDaily TestRecurringType = "Daily" TestRecurringTypeOneOff TestRecurringType = "One off" TestRecurringTypeWeekly TestRecurringType = "Weekly" )
func (TestRecurringType) String ¶
func (s TestRecurringType) String() string
type Threshold ¶
type Threshold struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` Query string `json:"query"` CreatedAt connection.DateTime `json:"created_at"` UpdatedAt connection.DateTime `json:"updated_at"` }
Threshold represents a test threshold
type ThresholdNotFoundError ¶
type ThresholdNotFoundError struct {
ID string
}
ThresholdNotFoundError indicates a threshold was not found
func (*ThresholdNotFoundError) Error ¶
func (e *ThresholdNotFoundError) Error() string