simulator

package
v0.0.0-...-140d8b8 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeMetrics

func InitializeMetrics(subsystem string)

func IssueRequest

func IssueRequest(restyClient *resty.Client, verb string, path string, body interface{}, params map[string]string, result interface{}) (string, error)

func LittleJaegerExample

func LittleJaegerExample(jaegerTracerProvider *tracesdk.TracerProvider, ctx context.Context)

func NewJaegerTracerProvider

func NewJaegerTracerProvider(service string, url string) (*tracesdk.TracerProvider, error)

NewJaegerTracerProvider returns an OpenTelemetry TracerProvider configured to use the Jaeger exporter that will send spans to the provided url. The returned TracerProvider will also use a Resource configured with all the information about the application.

func RecordEvent

func RecordEvent(name string, tag string, err error)

func RecordEventValue

func RecordEventValue(name string, tag string, value float64)

func RunClient

func RunClient(serverAddress string, workers int, provider *tracesdk.TracerProvider)

func RunServer

func RunServer(jaegerTracerProvider *tracesdk.TracerProvider)

func SetupHTTPServer

func SetupHTTPServer(responder Responder)

SetupHTTPServer .....

Types

type Client

type Client struct {
	ServerAddress string
	RestyClient   *resty.Client
}

func NewClient

func NewClient(server string) *Client

func (*Client) FetchScan

func (c *Client) FetchScan(scanId string) (*ScanResults, error)

func (*Client) Start

func (c *Client) Start(workers int, provider *tracesdk.TracerProvider)

func (*Client) StartScan

func (c *Client) StartScan(scan *StartScan) (string, error)

type FetchScanResults

type FetchScanResults struct {
	JobId string
}

type Responder

type Responder interface {
	StartScan(scan *StartScan)
	FetchScanResults(scanId string) (*ScanResults, error)

	NotFound(w http.ResponseWriter, r *http.Request)
	Error(w http.ResponseWriter, r *http.Request, err error, statusCode int)
}

Responder .....

type ScanResults

type ScanResults struct {
	IsDone bool
	Data   string
}

type Server

type Server struct {
	Provider *tracesdk.TracerProvider
}

func (*Server) Error

func (s *Server) Error(w http.ResponseWriter, r *http.Request, httpError error, statusCode int)

func (*Server) FetchScanResults

func (s *Server) FetchScanResults(scanId string) (*ScanResults, error)

func (*Server) NotFound

func (s *Server) NotFound(w http.ResponseWriter, r *http.Request)

func (*Server) StartScan

func (s *Server) StartScan(scan *StartScan)

type StartScan

type StartScan struct {
	Data string
}

Jump to

Keyboard shortcuts

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