mock

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 18 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)
	GetCategorisationsFunc              func(ctx context.Context, req cantabular.GetCategorisationsRequest) (*cantabular.GetCategorisationsResponse, 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) GetCategorisations added in v1.16.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 CantabularMetadataClient added in v1.16.0

type CantabularMetadataClient struct {
	ErrStatus                    int
	OptionsHappy                 bool
	DimensionsHappy              bool
	GetDefaultClassificationFunc func(ctx context.Context, req cantabularmetadata.GetDefaultClassificationRequest) (*cantabularmetadata.GetDefaultClassificationResponse, error)
}

func (*CantabularMetadataClient) Checker added in v1.16.0

func (*CantabularMetadataClient) CheckerAPIExt added in v1.16.0

func (*CantabularMetadataClient) GetDimensionOptions added in v1.16.0

func (*CantabularMetadataClient) Reset added in v1.16.0

func (c *CantabularMetadataClient) Reset()

func (*CantabularMetadataClient) StatusCode added in v1.16.0

func (c *CantabularMetadataClient) 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

type PopulationTypesAPIClient added in v1.18.0

type PopulationTypesAPIClient struct {
	GetCategorisationsResponses map[population.GetCategorisationsInput]population.GetCategorisationsResponse
	GetCategoristionsHappy      bool
	GetMetadataResponse         population.GetPopulationTypeMetadataResponse
	// contains filtered or unexported fields
}

func NewPopulationTypesAPIClient added in v1.18.0

func NewPopulationTypesAPIClient() *PopulationTypesAPIClient

func (*PopulationTypesAPIClient) Checker added in v1.18.0

func (*PopulationTypesAPIClient) GetCategorisations added in v1.18.0

func (*PopulationTypesAPIClient) GetPopulationTypeMetadata added in v1.18.0

func (*PopulationTypesAPIClient) Reset added in v1.18.0

func (c *PopulationTypesAPIClient) Reset()

func (*PopulationTypesAPIClient) SetDefaultDatasetMetadata added in v1.18.0

func (c *PopulationTypesAPIClient) SetDefaultDatasetMetadata(res population.GetPopulationTypeMetadataResponse)

func (*PopulationTypesAPIClient) SetGetCategorisationsResponse added in v1.18.0

Jump to

Keyboard shortcuts

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