testutils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RendererConnTimeoutSecs represents connection timeout for testing renderer server.
	RendererConnTimeoutSecs = 2

	// RendererRequestTimeoutSecs represents rendering timeout for testing renderer server.
	RendererRequestTimeoutSecs = 1
)

Variables

View Source
var ErrRequestCancelled = errors.New("request to testing lc-renderer is cancelled")

ErrRequestCancelled contains error message about cancelled testing lc-renderer request.

Functions

func ColorsDefault

func ColorsDefault() *render.ChartViewColors

func GetChartRequest

func GetChartRequest(chartID string) *render.GetChartRequest

func NewEmptyBackend added in v0.1.0

func NewEmptyBackend(healthy bool) backend.Backend

NewEmptyBackend returns a new TestingBackend.

func NewEmptyRecorder added in v0.1.0

func NewEmptyRecorder() metric.Recorder

NewEmptyRecorder returns a new EmptyRecorder.

func RandomString added in v0.1.0

func RandomString(size int) string

func RandomUUID added in v0.1.0

func RandomUUID(t *testing.T) uuid.UUID

Types

type ChartScale added in v0.1.0

type ChartScale struct {
	*render.ChartScale
}

func NewBandChartScale added in v0.1.0

func NewBandChartScale() *ChartScale

func NewLinearChartScale added in v0.1.0

func NewLinearChartScale() *ChartScale

func (*ChartScale) InvertRanges added in v0.1.0

func (s *ChartScale) InvertRanges() *ChartScale

func (*ChartScale) SetCategoriesDomain added in v0.1.0

func (s *ChartScale) SetCategoriesDomain() *ChartScale

func (*ChartScale) SetNoBoundariesOffset added in v0.1.0

func (s *ChartScale) SetNoBoundariesOffset() *ChartScale

func (*ChartScale) SetNumericDomain added in v0.1.0

func (s *ChartScale) SetNumericDomain() *ChartScale

func (*ChartScale) SetPaddings added in v0.1.0

func (s *ChartScale) SetPaddings() *ChartScale

func (*ChartScale) SetRanges added in v0.1.0

func (s *ChartScale) SetRanges(rangeStart, rangeEnd int32) *ChartScale

func (*ChartScale) Unembed added in v0.1.0

func (s *ChartScale) Unembed() *render.ChartScale

func (*ChartScale) UnsetDomain added in v0.1.0

func (s *ChartScale) UnsetDomain() *ChartScale

func (*ChartScale) UnsetKind added in v0.1.0

func (s *ChartScale) UnsetKind() *ChartScale

func (*ChartScale) UnsetRanges added in v0.1.0

func (s *ChartScale) UnsetRanges() *ChartScale

type ChartView added in v0.1.0

type ChartView struct {
	*render.ChartView
}

func NewAreaView added in v0.1.0

func NewAreaView() *ChartView

func NewHorizontalBarView added in v0.1.0

func NewHorizontalBarView() *ChartView

func NewLineView added in v0.1.0

func NewLineView() *ChartView

func NewScatterView added in v0.1.0

func NewScatterView() *ChartView

func NewVerticalBarView added in v0.1.0

func NewVerticalBarView() *ChartView

func (*ChartView) SetBadFillRGBColor added in v0.1.0

func (v *ChartView) SetBadFillRGBColor() *ChartView

func (*ChartView) SetBarLabelPosition added in v0.1.0

func (v *ChartView) SetBarLabelPosition() *ChartView

func (*ChartView) SetDefaultBarBools added in v0.1.0

func (v *ChartView) SetDefaultBarBools() *ChartView

func (*ChartView) SetDefaultBarParams added in v0.1.0

func (v *ChartView) SetDefaultBarParams() *ChartView

func (*ChartView) SetDefaultColors added in v0.1.0

func (v *ChartView) SetDefaultColors() *ChartView

func (*ChartView) SetDefaultPointBools added in v0.1.0

func (v *ChartView) SetDefaultPointBools() *ChartView

func (*ChartView) SetDefaultPointParams added in v0.1.0

func (v *ChartView) SetDefaultPointParams() *ChartView

func (*ChartView) SetFillAndStrokeColor added in v0.1.0

func (v *ChartView) SetFillAndStrokeColor() *ChartView

func (*ChartView) Unembed added in v0.1.0

func (v *ChartView) Unembed() *render.ChartView

func (*ChartView) UnsetKind added in v0.1.0

func (v *ChartView) UnsetKind() *ChartView

func (*ChartView) UnsetValues added in v0.1.0

func (v *ChartView) UnsetValues() *ChartView

type CreateChartRequest added in v0.1.0

type CreateChartRequest struct {
	*render.CreateChartRequest
}

func NewCreateChartRequest added in v0.1.0

func NewCreateChartRequest() *CreateChartRequest

func (*CreateChartRequest) AddAreaView added in v0.1.0

func (req *CreateChartRequest) AddAreaView() *CreateChartRequest

func (*CreateChartRequest) AddLineView added in v0.1.0

func (req *CreateChartRequest) AddLineView() *CreateChartRequest

func (*CreateChartRequest) AddVerticalBarView added in v0.1.0

func (req *CreateChartRequest) AddVerticalBarView() *CreateChartRequest

func (*CreateChartRequest) AddView added in v0.1.0

func (req *CreateChartRequest) AddView(v *render.ChartView) *CreateChartRequest

func (*CreateChartRequest) SetBadMargins added in v0.1.0

func (req *CreateChartRequest) SetBadMargins() *CreateChartRequest

func (*CreateChartRequest) SetBadSizes added in v0.1.0

func (req *CreateChartRequest) SetBadSizes() *CreateChartRequest

func (*CreateChartRequest) SetBandBottomAxis added in v0.1.0

func (req *CreateChartRequest) SetBandBottomAxis() *CreateChartRequest

func (*CreateChartRequest) SetBottomAxisLabel added in v0.1.0

func (req *CreateChartRequest) SetBottomAxisLabel() *CreateChartRequest

func (*CreateChartRequest) SetLeftAxisLabel added in v0.1.0

func (req *CreateChartRequest) SetLeftAxisLabel() *CreateChartRequest

func (*CreateChartRequest) SetLinearLeftAxis added in v0.1.0

func (req *CreateChartRequest) SetLinearLeftAxis() *CreateChartRequest

func (*CreateChartRequest) SetMargins added in v0.1.0

func (req *CreateChartRequest) SetMargins() *CreateChartRequest

func (*CreateChartRequest) SetSizes added in v0.1.0

func (req *CreateChartRequest) SetSizes() *CreateChartRequest

func (*CreateChartRequest) SetTitle added in v0.1.0

func (req *CreateChartRequest) SetTitle() *CreateChartRequest

func (*CreateChartRequest) Unembed added in v0.1.0

func (req *CreateChartRequest) Unembed() *render.CreateChartRequest

type EmptyBackend added in v0.1.0

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

EmptyBackend represents a backend.Backend that doesn't have real connections.

func (*EmptyBackend) IsHealthy added in v0.1.0

func (b *EmptyBackend) IsHealthy() bool

func (*EmptyBackend) RendererClient added in v0.1.0

func (b *EmptyBackend) RendererClient() render.ChartRendererClient

func (*EmptyBackend) RendererRequestTimeout added in v0.1.0

func (b *EmptyBackend) RendererRequestTimeout() time.Duration

func (*EmptyBackend) Shutdown added in v0.1.0

func (b *EmptyBackend) Shutdown()

type EmptyRecorder added in v0.1.0

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

EmptyRecorder represents testing metric recorder.

func (*EmptyRecorder) HTTPHandler added in v0.1.0

func (er *EmptyRecorder) HTTPHandler() http.Handler

HTTPHandler returns default Prometheus HTTP handler.

func (*EmptyRecorder) RequestDuration added in v0.1.0

func (er *EmptyRecorder) RequestDuration() *prometheus.HistogramVec

RequestDuration returns unregistered request_duration_seconds metric.

type JSONChartScale added in v0.1.0

type JSONChartScale struct {
	*view.ChartScale
}

func NewJSONBandChartScale added in v0.1.0

func NewJSONBandChartScale() *JSONChartScale

func NewJSONLinearChartScale added in v0.1.0

func NewJSONLinearChartScale() *JSONChartScale

func (*JSONChartScale) SetNoBoundariesOffset added in v0.1.0

func (s *JSONChartScale) SetNoBoundariesOffset() *JSONChartScale

func (*JSONChartScale) SetTwoDomains added in v0.1.0

func (s *JSONChartScale) SetTwoDomains() *JSONChartScale

func (*JSONChartScale) Unembed added in v0.1.0

func (s *JSONChartScale) Unembed() *view.ChartScale

type JSONChartView added in v0.1.0

type JSONChartView struct {
	*view.ChartView
}

func NewJSONAreaView added in v0.1.0

func NewJSONAreaView() *JSONChartView

func NewJSONHorizontalBarView added in v0.1.0

func NewJSONHorizontalBarView() *JSONChartView

func NewJSONLineView added in v0.1.0

func NewJSONLineView() *JSONChartView

func NewJSONVerticalBarView added in v0.1.0

func NewJSONVerticalBarView() *JSONChartView

func (*JSONChartView) SetBadPointsCount added in v0.1.0

func (v *JSONChartView) SetBadPointsCount() *JSONChartView

func (*JSONChartView) SetPointsValues added in v0.1.0

func (v *JSONChartView) SetPointsValues() *JSONChartView

func (*JSONChartView) SetScalarValues added in v0.1.0

func (v *JSONChartView) SetScalarValues() *JSONChartView

func (*JSONChartView) Unembed added in v0.1.0

func (v *JSONChartView) Unembed() *view.ChartView

func (*JSONChartView) UnsetValues added in v0.1.0

func (v *JSONChartView) UnsetValues() *JSONChartView

type JSONCreateChartRequest added in v0.1.0

type JSONCreateChartRequest struct {
	*view.CreateChartRequest
}

func NewJSONCreateChartRequest added in v0.1.0

func NewJSONCreateChartRequest() *JSONCreateChartRequest

func (*JSONCreateChartRequest) AddLineView added in v0.1.0

func (req *JSONCreateChartRequest) AddLineView() *JSONCreateChartRequest

func (*JSONCreateChartRequest) AddVerticalBarView added in v0.1.0

func (req *JSONCreateChartRequest) AddVerticalBarView() *JSONCreateChartRequest

func (*JSONCreateChartRequest) SetBandBottomAxis added in v0.1.0

func (req *JSONCreateChartRequest) SetBandBottomAxis() *JSONCreateChartRequest

func (*JSONCreateChartRequest) SetBottomAxisLabel added in v0.1.0

func (req *JSONCreateChartRequest) SetBottomAxisLabel() *JSONCreateChartRequest

func (*JSONCreateChartRequest) SetLeftAxisLabel added in v0.1.0

func (req *JSONCreateChartRequest) SetLeftAxisLabel() *JSONCreateChartRequest

func (*JSONCreateChartRequest) SetLinearLeftAxis added in v0.1.0

func (req *JSONCreateChartRequest) SetLinearLeftAxis() *JSONCreateChartRequest

func (*JSONCreateChartRequest) SetMargins added in v0.1.0

func (*JSONCreateChartRequest) SetSizes added in v0.1.0

func (*JSONCreateChartRequest) SetTitle added in v0.1.0

func (*JSONCreateChartRequest) Unembed added in v0.1.0

type Opts

type Opts struct {
	FailMsg   string
	ChartData []byte
	Latency   time.Duration
}

Opts contains options to configure TestingChartRendererServer.

type TestingChartRendererServer

type TestingChartRendererServer struct {
	render.UnimplementedChartRendererServer
	// contains filtered or unexported fields
}

TestingChartRendererServer implements render.ChartRendererServer.

func NewTestingChartRendererServer

func NewTestingChartRendererServer(opts Opts) (*TestingChartRendererServer, error)

NewTestingChartRendererServer returns a new TestingChartRendererServer.

func (*TestingChartRendererServer) Address

func (s *TestingChartRendererServer) Address() string

Address returns listener address.

func (*TestingChartRendererServer) RenderChart

func (s *TestingChartRendererServer) RenderChart(ctx context.Context, req *render.RenderChartRequest) (*render.RenderChartReply, error)

RenderChart implements render.ChartRendererServer.RenderChart.

func (*TestingChartRendererServer) Serve

Serve gRPC server.

Jump to

Keyboard shortcuts

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