mock

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mock provides a mock implementation and driver for testing purposes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct{}

Driver for the mock model

func (Driver) DiscardQuery

func (d Driver) DiscardQuery(res dbms.QueryResult, seed *seed.Seed) bool

DiscardQuery always returns true

func (Driver) GetQueryResultType

func (d Driver) GetQueryResultType(res dbms.QueryResult) dbms.QueryResultType

GetQueryResultType always returns dbms.Valid

func (Driver) GetSchema

func (d Driver) GetSchema(opts dbms.DBOptions) (*schema.Schema, error)

GetSchema does nothing and returns a default, initialized schema and nil

func (*Driver) Init

func (d *Driver) Init(opts dbms.DBOptions) error

Init does nothing and returns nil

func (Driver) IsEqualResult

func (d Driver) IsEqualResult(a, b dbms.QueryResult) bool

IsEqualResult always returns true

func (*Driver) Reset

func (d *Driver) Reset(opts dbms.DBOptions) error

Reset does nothing and returns nil

func (Driver) RunQuery

func (d Driver) RunQuery(opts dbms.DBOptions, query string) dbms.QueryResult

RunQuery does nothing and returns an empty query result

func (Driver) VerifyConnectivity

func (d Driver) VerifyConnectivity(dbms.DBOptions) (bool, error)

VerifyConnectivity always returns true and nil

type Implementation

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

Implementation for the mock model.

Its generation behavior can be configured using the [AddDropIn] and [SetConfig] methods.

func (*Implementation) AddDropIn

func (m *Implementation) AddDropIn(c translator.Clause, d translator.DropIn)

AddDropIn registers a drop in for the implementation, which is returned when its Implementation.GetDropIns method gets called.

func (Implementation) GetDropIns

func (m Implementation) GetDropIns() translator.DropIns

GetDropIns returns the drop ins passed to the Implementation struct.

func (Implementation) GetOpenCypherConfig

func (m Implementation) GetOpenCypherConfig() config.Config

GetOpenCypherConfig returns the config passed to the Implementation struct.

func (*Implementation) SetConfig

func (m *Implementation) SetConfig(c config.Config)

SetConfig sets the implementation's config, which is returned when its Implementation.GetOpenCypherConfig method gets called.

Jump to

Keyboard shortcuts

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