model

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Cmd      string
	Target   string
	From     string
	Limit    int
	Resolver string
	// JsonOutput is a flag that determines whether the output should be in JSON format.
	JsonOutput bool
	// Latency is a flag that outputs only stats of a measurement
	Latency bool
	// CI flag is used to determine whether the output should be in a format that is easy to parse by a CI tool
	CI bool
	// Full output
	Full bool
	// Display share message
	Share bool
}

Used in thc client TUI

type GetMeasurement

type GetMeasurement struct {
	ID          string                `json:"id"`
	Type        string                `json:"type"`
	Status      string                `json:"status"`
	CreatedAt   string                `json:"createdAt"`
	UpdatedAt   string                `json:"updatedAt"`
	ProbesCount int                   `json:"probesCount"`
	Results     []MeasurementResponse `json:"results"`
}

Main struct

type Locations

type Locations struct {
	Magic string `json:"magic"`
}

Nested structs

type MeasurementOptions

type MeasurementOptions struct {
	Query    *QueryOptions   `json:"query,omitempty"`
	Request  *RequestOptions `json:"request,omitempty"`
	Protocol string          `json:"protocol,omitempty"`
	Port     int             `json:"port,omitempty"`
	Resolver string          `json:"resolver,omitempty"`
	Trace    bool            `json:"trace,omitempty"`
	Packets  int             `json:"packets,omitempty"`
}

type MeasurementResponse

type MeasurementResponse struct {
	Probe  ProbeData  `json:"probe"`
	Result ResultData `json:"result"`
}

Nested structs

type PostError

type PostError struct {
	Error struct {
		Message string                 `json:"message"`
		Type    string                 `json:"type"`
		Params  map[string]interface{} `json:"params,omitempty"`
	} `json:"error"`
}

type PostMeasurement

type PostMeasurement struct {
	Limit             int                 `json:"limit"`
	Locations         []Locations         `json:"locations"`
	Type              string              `json:"type"`
	Target            string              `json:"target"`
	InProgressUpdates bool                `json:"inProgressUpdates"`
	Options           *MeasurementOptions `json:"measurementOptions,omitempty"`
}

Main struct

type PostResponse

type PostResponse struct {
	ID          string `json:"id"`
	ProbesCount int    `json:"probesCount"`
}

type ProbeData

type ProbeData struct {
	Continent string   `json:"continent"`
	Region    string   `json:"region"`
	Country   string   `json:"country"`
	City      string   `json:"city"`
	State     string   `json:"state,omitempty"`
	ASN       int      `json:"asn"`
	Network   string   `json:"network,omitempty"`
	Tags      []string `json:"tags,omitempty"`
}

type QueryOptions

type QueryOptions struct {
	Type string `json:"type,omitempty"`
}

type RequestOptions

type RequestOptions struct {
	Headers map[string]string `json:"headers,omitempty"`
	Path    string            `json:"path,omitempty"`
	Host    string            `json:"host,omitempty"`
	Query   string            `json:"query,omitempty"`
	Method  string            `json:"method,omitempty"`
}

type ResultData

type ResultData struct {
	Status           string                 `json:"status"`
	RawOutput        string                 `json:"rawOutput"`
	RawHeaders       string                 `json:"rawHeaders"`
	RawBody          string                 `json:"rawBody"`
	ResolvedAddress  string                 `json:"resolvedAddress"`
	ResolvedHostname string                 `json:"resolvedHostname"`
	Stats            map[string]interface{} `json:"stats,omitempty"`
	TimingsRaw       json.RawMessage        `json:"timings,omitempty"`
}

type Timings

type Timings struct {
	Arr       []map[string]interface{}
	Interface map[string]interface{}
}

Jump to

Keyboard shortcuts

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