cmd

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallGRPC

func CallGRPC(endpoint string, fullMethod string, req *grpc.Request) (*grpc.Response, error)

func CallHTTP

func CallHTTP(endpointURL string, method libhttp.Method, req *libhttp.Request) (*libhttp.Response, error)

func Dump

func Dump(
	ctx context.Context,
	db libdb.DB,
	tableNames []string,
	schemaGetter SchemaGetter,
	rowLister RowLister,
) (tables.DumpTables, error)

func Init

func Init(ctx context.Context,
	db libdb.DB,
	jsonTables tables.InitTables,
	schemaGetter SchemaGetter,
	rowClearer RowClearer,
	rowCreator RowCreator,
) error

Types

type CompareResult

type CompareResult string
const (
	CompareResultSupersetMatch CompareResult = "SupersetMatch"
	CompareResultFullMatch     CompareResult = "FullMatch"
	CompareResultNoMatch       CompareResult = "NoMatch"
	CompareResultError         CompareResult = "Error"
)

func Compare

func Compare(expectedJson io.Reader, actualJson io.Reader) (CompareResult, string, error)

type DatabaseDriver

type DatabaseDriver struct {
	Name         string
	DB           db.DB
	RowLister    RowLister
	RowClearer   RowClearer
	RowCreator   RowCreator
	SchemaGetter SchemaGetter
}

func (*DatabaseDriver) Close

func (d *DatabaseDriver) Close() error

func (*DatabaseDriver) Open

func (d *DatabaseDriver) Open(connectionString string) error

type RowClearer

type RowClearer interface {
	ClearRows(ctx context.Context, tx db.Tx, tableName string) error
}

type RowCreator

type RowCreator interface {
	CreateRows(ctx context.Context, tx db.Tx, tableName string, schema db.Schema, rows []tables.Row) error
}

type RowLister

type RowLister interface {
	ListRows(ctx context.Context, tx db.Tx, tableName string, schema db.Schema) ([]db.Row, error)
}

type SchemaGetter

type SchemaGetter interface {
	GetSchema(ctx context.Context, tx db.Tx, tableName string) (db.Schema, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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