mock

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestUUID      = "94310d8d-72d6-492a-bc30-27584627edb1"
	TestTimestamp = "2022-01-26T12:27:04.783936865Z"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CantabularClient

type CantabularClient struct {
	ErrStatus                           int
	OptionsHappy                        bool
	DimensionsHappy                     bool
	GetDimensionsByNameFunc             func(context.Context, cantabular.GetDimensionsByNameRequest) (*cantabular.GetDimensionsResponse, error)
	SearchDimensionsFunc                func(ctx context.Context, req cantabular.SearchDimensionsRequest) (*cantabular.GetDimensionsResponse, error)
	GetGeographyDimensionsInBatchesFunc func(ctx context.Context, datasetID string, batchSize, maxWorkers int) (*gql.Dataset, error)
	GetAreaFunc                         func(context.Context, cantabular.GetAreaRequest) (*cantabular.GetAreaResponse, error)
	StaticDatasetQueryFunc              func(context.Context, cantabular.StaticDatasetQueryRequest) (*cantabular.StaticDatasetQuery, error)
}

func (*CantabularClient) Checker

func (*CantabularClient) CheckerAPIExt

func (c *CantabularClient) CheckerAPIExt(_ context.Context, _ *healthcheck.CheckState) error

func (*CantabularClient) GetArea added in v1.13.0

func (*CantabularClient) GetDimensionsByName added in v1.10.0

func (*CantabularClient) GetGeographyDimensionsInBatches added in v1.13.0

func (c *CantabularClient) GetGeographyDimensionsInBatches(ctx context.Context, datasetID string, batchSize, maxWorkers int) (*gql.Dataset, error)

func (*CantabularClient) Reset added in v1.2.0

func (c *CantabularClient) Reset()

func (*CantabularClient) StaticDatasetQuery added in v1.2.0

func (*CantabularClient) StatusCode

func (c *CantabularClient) StatusCode(_ error) int

type CantabularServer added in v1.10.0

type CantabularServer struct {
	*httpfake.HTTPFake

	sync.RWMutex
	// contains filtered or unexported fields
}

func NewCantabularServer added in v1.10.0

func NewCantabularServer(t *testing.T) *CantabularServer

func (*CantabularServer) Handle added in v1.10.0

func (cs *CantabularServer) Handle(request, response []byte)

func (*CantabularServer) PostResponder added in v1.10.0

func (cs *CantabularServer) PostResponder() httpfake.Responder

func (*CantabularServer) Reset added in v1.10.0

func (cs *CantabularServer) Reset()

type Generator

type Generator struct {
	URLHost string
}

Generator is responsible for generating mocked constant strings and tokens for tests

func (*Generator) PSK

func (g *Generator) PSK() ([]byte, error)

PSK returns a new constant array of 16 bytes

func (*Generator) Timestamp

func (g *Generator) Timestamp() time.Time

Timestamp generates a constant timestamp

func (*Generator) URL

func (g *Generator) URL(_, path string, args ...interface{}) string

URL generates a URL from a constant host and a path made from a printf string + arguments

func (*Generator) UUID

func (g *Generator) UUID() (uuid.UUID, error)

UUID generates a constant UUID

func (*Generator) UniqueTimestamp

func (g *Generator) UniqueTimestamp() primitive.Timestamp

UniqueTimestamp generates a constant timestamp

Jump to

Keyboard shortcuts

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