Documentation
¶
Index ¶
- Variables
- func IsRedacted(s string) bool
- type AuthConfig
- type Config
- type Duration
- type DynamicAuth
- type DynamicRequest
- type Endpoint
- type EndpointEntity
- type EndpointPayload
- type Entity
- type Frequency
- type ImpersionationCredentials
- type RequestEntity
- type RequestPayload
- type Schedule
- type ScheduleEntity
- type SchedulePayload
- type ScheduleWeek
- type Secret
- type Secrets
- type ServerInfo
- type StatEntity
- type StatPayload
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Redacted = "**REDACTED**" // When marchsalling a Secret, the value will be replaced with this constant value (**REDACTED**) RedactedSecret = []byte(`"` + Redacted + `"`) )
Functions ¶
func IsRedacted ¶
Types ¶
type AuthConfig ¶
type AuthConfig struct { // With dynamic, a series of requests can be made before the stress-test is performed. // The output can be piped into eachother, and then into the requests made during the stress-test. Dynamic DynamicAuth `json:"dynamic,omitempty"` // Bearer or Dynamic Kind string `json:"kind,omitempty"` // Used to impersonate (currently only works with keycloak) ImpersionationCredentials ImpersionationCredentials `json:"impersionation_credentials,omitempty"` // ClientID to use for ClientID string `json:"client_id,omitempty"` RedirectUri string `json:"redirect_uri,omitempty"` ClientSecret Secret `json:"client_secret,omitempty"` Endpoint string `json:"endpoint,omitempty"` // Used with kind=Bearer and impersonation. Currenly, only keycloak is supported EndpointType string `json:"endpoint_type,omitempty"` // The header-key to use. Defaults to Authorization HeaderKey string `json:"header_key,omitempty"` Token Secret `json:"token,omitEmpty"` }
type Config ¶
type Config struct { // Auth can be used to configure the authentication performed on a request. Auth *AuthConfig `json:"auth,omitempty"` // A list of http-status-codes to consider OK. Defaults to 200 and 204. OkStatusCodes *[]int `json:"ok_status_codes,omitempty"` // Whether or not Response-data should be stored. ResponseData *bool `json:"response_data,omitempty"` // Concurrency for the requests to be made Concurrency *int `json:"concurrency,omitempty"` // Number of requests to be performaed RequestCount *int `json:"request_count,omitempty"` Secrets *Secrets `json:"secrets,omitempty"` }
type DynamicAuth ¶
type DynamicAuth struct {
Requests []DynamicRequest `json:"requests,omitempty"`
}
type DynamicRequest ¶
type DynamicRequest struct { Method string `json:"method,omitempty"` Uri string `json:"uri,omitempty"` Headers map[string]string `json:"headers,omitempty"` JsonRequest bool `json:"json_request,omitempty"` JsonResponse bool `json:"json_response,omitempty"` ResultJmesPath string `json:"result_jmes_path,omitempty"` Body interface{} `json:"body,omitempty"` }
type EndpointEntity ¶
type EndpointPayload ¶
type EndpointPayload struct { // required: true // example: https://example.com Url string `json:"url,omitempty" validate:"required,uri"` Headers map[string][]string `json:"headers,omitempty" validate:"dive,max=1000"` Config *Config `json:"config,omitempty"` }
type Entity ¶
type Entity struct { // Time of which the entity was created in the database // Required: true CreatedAt time.Time `json:"createdAt,omitempty"` // Time of which the entity was updated, if any UpdatedAt *time.Time `json:"updatedAt,omitempty"` // Unique identifier of the entity // Required: true ID string `json:"id,omitempty"` // If set, the item is considered deleted. The item will normally not get deleted from the database, // but it may if cleanup is required. Deleted *time.Time `json:"deleted,omitempty"` }
type ImpersionationCredentials ¶
type ImpersionationCredentials struct { // Username to impersonate with. Needs to have the impersonation-role Username string `json:"username,omitempty"` Password Secret `json:"password,omitempty"` // UserID to impersonate as. This is preferred over UserNameToImpersonate UserIDToImpersonate string `json:"user_id_to_impersonate,omitempty"` // Will perform a lookup to get the ID of the username. UserNameToImpersonate string `json:"user_name_to_impersonate,omitempty"` }
type RequestEntity ¶
type RequestPayload ¶
type RequestPayload struct { Body string `json:"body,omitempty"` Query string `json:"query,omitempty"` Variables map[string]interface{} `json:"variables,omitempty" validate:"dive,max=1000"` Headers map[string]string `json:"headers,omitempty" validate:"dive,max=1000"` OperationName string `json:"operationName,required"` Method string `json:"method"` Config *Config `json:"config,omitempty"` }
type Schedule ¶
type Schedule struct { // These are calculated in create/update. These are used for faster lookups. // Should be ordered Ascending, e.g. the first element Dates []time.Time `json:"dates"` // FIXME: Should not use schedulePaylaod directly here. SchedulePayload // From these, the dates above can be calculated LastRun *time.Time `json:"lastRun,omitempty"` LastError string `json:"lastError,omitempty"` }
type ScheduleEntity ¶
type SchedulePayload ¶
type SchedulePayload struct { RequestID string `json:"requestID" validate:"required"` EndpointID string `json:"endpointID" validate:"required"` // If set to a positive value, the scheduler will not schedule more than this total concurrency // when starting this job, and when it is running. // // Some jobs might have been configured to run very slowly, with low concurrency, // high wait-times and can therefore run alongside other such jobs. MaxInterJobConcurrency bool `json:"maxInterJobConcurrency"` Label string `json:"label" validate:"required"` StartDate time.Time `json:"start_date" validate:"required"` ForcedStartDate *time.Time `json:"forced_start_date"` EndDate *time.Time `json:"end_date"` Frequency Frequency `json:"frequency,omitempty"` Multiplier float64 `json:"multiplier,omitempty"` // TODO: either document what this value is or drop it. I dont remember why I added this. // I am sure there was a reason, though... Offsets []int `json:"offsets,omitempty"` Config *Config `json:"config,omitempty"` ScheduleWeek }
func (SchedulePayload) CalculateNextRuns ¶
func (s SchedulePayload) CalculateNextRuns(maxCount int) (ts []time.Time)
type ScheduleWeek ¶
type ScheduleWeek struct { LocationStr string `json:"location"` Monday *Duration `json:"monday,omitempty"` Tuesday *Duration `json:"tuesday,omitempty"` Wednesday *Duration `json:"wednesday,omitempty"` Thursday *Duration `json:"thursday,omitempty"` Friday *Duration `json:"friday,omitempty"` Saturday *Duration `json:"saturday,omitempty"` Sunday *Duration `json:"sunday,omitempty"` }
type ServerInfo ¶
type StatEntity ¶
type StatEntity struct { Entity requests.CompactRequestStatistics }
type StatPayload ¶
type StatPayload = requests.CompactRequestStatistics
type Storage ¶
type Storage interface { Endpoints() (es map[string]EndpointEntity, err error) Endpoint(id string) (EndpointEntity, error) CreateEndpoint(e EndpointPayload) (EndpointEntity, error) UpdateEndpoint(id string, p EndpointPayload) (EndpointEntity, error) SoftDeleteEndpoint(id string) (EndpointEntity, error) Requests() (es map[string]RequestEntity, err error) Request(id string) (RequestEntity, error) CreateRequest(e RequestPayload) (RequestEntity, error) UpdateRequest(id string, p RequestPayload) (RequestEntity, error) SoftDeleteRequest(id string) (RequestEntity, error) Schedules() (es map[string]ScheduleEntity, err error) Schedule(id string) (ScheduleEntity, error) CreateSchedule(e SchedulePayload) (ScheduleEntity, error) UpdateSchedule(id string, p Schedule) (ScheduleEntity, error) SoftDeleteSchedule(id string) (ScheduleEntity, error) CompactStats() (es map[string]StatEntity, err error) CleanCompactStats() (err error) Size() (int64, error) CreateCompactStats(id string, createdAt time.Time, p StatPayload) error UpdateCompactStats(id string, createdAt time.Time, p StatPayload) error }
Click to show internal directories.
Click to hide internal directories.