models

package
v0.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultServerUrl = "https://app.tracetest.io"
	ServerURL        = "serverUrl"
	ServerPath       = "serverPath"
	APIToken         = "apiToken"
)
View Source
const (
	K6Prefix     = 0756 // Being 075 the ASCII code for 'K' :)
	K6Code_Cloud = 12   // To ingest and process the related spans in k6 Cloud.
	K6Code_Local = 33   // To not ingest and process the related spans, b/c they are part of a non-cloud run.
)

Variables

View Source
var (
	ENV_SERVER_URL  = "XK6_TRACETEST_SERVER_URL"
	ENV_SERVER_PATH = "XK6_TRACETEST_SERVER_PATH"
	ENV_API_TOKEN   = "XK6_TRACETEST_API_TOKEN"
)

Functions

func NewSpanContext

func NewSpanContext(traceID string) trace.SpanContext

Types

type ApiOptions added in v0.1.3

type ApiOptions struct {
	ServerUrl  string
	ServerPath string
	APIToken   string
}

func NewApiOptions added in v0.1.3

func NewApiOptions(vu modules.VU, val goja.Value) (ApiOptions, error)

type HttpClientOptions added in v0.1.3

type HttpClientOptions struct {
	Propagator Propagator
	Tracetest  TracetestOptions
}

func NewHttpClientOptions added in v0.1.3

func NewHttpClientOptions(vu modules.VU, val goja.Value) (HttpClientOptions, error)

type Job

type Job struct {
	ID               string
	TraceID          string
	TestID           string
	VariableName     string
	RunGroupId       string
	JobType          JobType
	Request          Request
	Run              *TracetestRun
	JobStatus        JobStatus
	TracetestOptions TracetestOptions
	Error            string
	Metadata         metadata.Metadata
	Definition       string
}

func NewJob

func NewJob(traceId string, options TracetestOptions, request Request) Job

func (Job) HandleRunResponse

func (job Job) HandleRunResponse(run *openapi.TestRun, err error) Job

func (Job) IsSuccessful

func (job Job) IsSuccessful() bool

func (Job) Summary

func (job Job) Summary(baseUrl string) string

type JobStatus

type JobStatus string
const (
	Pending JobStatus = "pending"
	Running JobStatus = "running"
	Failed  JobStatus = "failed"
	Success JobStatus = "success"
)

type JobType

type JobType string
const (
	RunTestFromId JobType = "runTestFromId"
)

type Metadata

type Metadata map[string]string

type OutputConfig added in v0.1.3

type OutputConfig struct {
	ServerUrl  string
	ServerPath string
	APIToken   string
}

func NewConfig added in v0.1.3

func NewConfig(params output.Params) (OutputConfig, error)

type Propagator

type Propagator struct {
	// contains filtered or unexported fields
}

func NewPropagator

func NewPropagator(propagators []PropagatorName) Propagator

func (Propagator) GenerateHeaders

func (p Propagator) GenerateHeaders(traceID string) http.Header

type PropagatorName

type PropagatorName string
const (
	TraceContext PropagatorName = "tracecontext"
	Baggage      PropagatorName = "baggage"
	PropagatorB3 PropagatorName = "b3"
	OT           PropagatorName = "ot"
	Jaeger       PropagatorName = "jaeger"
	XRay         PropagatorName = "xray"
)

type Request

type Request struct {
	Method   string
	URL      string
	ID       string
	Metadata Metadata
}

type Test

type Test struct {
	ID   string
	Name string
}

type TraceID

type TraceID struct {
	Prefix            int16
	Code              int8
	UnixTimestampNano uint64
}

func DecodeTraceID

func DecodeTraceID(buf []byte) *TraceID

func (*TraceID) Encode

func (t *TraceID) Encode() (string, []byte, error)

func (*TraceID) IsValid

func (t *TraceID) IsValid() bool

func (*TraceID) IsValidCloud

func (t *TraceID) IsValidCloud() bool

type TracetestOptions added in v0.1.3

type TracetestOptions struct {
	TestID       string
	ShouldWait   bool
	VariableName string
	RunGroupId   string
	Definition   string
}

func NewTracetestOptions added in v0.1.3

func NewTracetestOptions(runTime *goja.Runtime, params *goja.Object) TracetestOptions

type TracetestRun

type TracetestRun struct {
	TestId  string
	TestRun *openapi.TestRun
}

func (*TracetestRun) IsSuccessful

func (tr *TracetestRun) IsSuccessful() bool

func (*TracetestRun) Summary

func (tr *TracetestRun) Summary(baseUrl string) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL