client

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout = time.Second * 25
)

Variables

View Source
var ErrInsecure = errors.New("this client connection is insecure")

Functions

func NewHTTPClient

func NewHTTPClient(timeout time.Duration) *http.Client

NewHTTPClient returns a more appropriate HTTP client as opposed the default provided by `net/http`

func NewHTTPClientWithTransport

func NewHTTPClientWithTransport(timeout time.Duration, transport http.RoundTripper) *http.Client

NewHTTPClientWithTransport returns a more appropriate HTTP client as opposed the default provided by `net/http`

func NewService

func NewService(host, wsHost string, conn *Connection) service

func ResultWriter

func ResultWriter(w io.Writer, results []TestCase)

ResultWriter writes testcase results to a writer

Types

type Connection

type Connection struct {
	*http.Client
}

func NewConnection

func NewConnection() (*Connection, error)

type Service

type Service interface {
	Version() (VersionResponse, error)
	Run(discoveryFile, configFile, exportConfig string) ([]TestCase, error)
}

Service is a gateway to backend services provided by FCS

type TestCase

type TestCase struct {
	Id   string `json:"id"`
	Pass bool   `json:"pass"`
	Fail string `json:"fail,omitempty"`
}

TestCase result for a run

type TestCaseResult

type TestCaseResult struct {
	Type string   `json:"type"`
	Test TestCase `json:"test"`
}

type VersionResponse

type VersionResponse struct {
	Version string `json:"version"`
	Message string `json:"message"`
	Update  bool   `json:"update"`
}

Jump to

Keyboard shortcuts

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