database

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRUD

type CRUD interface {
	MockReadWriter
	GetMocks(ctx context.Context) ([]*mock.Mock, error)
	PatchRoute(ctx context.Context, mockID string, routeID string, data string) error
	DeleteRoute(ctx context.Context, mockID string, routeID string) error
	CreateRoute(ctx context.Context, mockID string, data string) error
	PatchResponse(ctx context.Context, mockID, routeID, responseID, data string) error
}

CRUD represents the database interface for the CRUD operations

type Database

type Database interface {
	EngineDB
	CRUD
}

type EngineDB

type EngineDB interface {
	MockReadWriter
	GetInt(ctx context.Context, mockID, key string) (int, error)
	Increment(ctx context.Context, mockID, key string) (int, error)
	Set(ctx context.Context, mockID, key, value string) error
	Get(ctx context.Context, mockID, key string) (string, error)
	SetActiveSession(ctx context.Context, mockID string, sessionID string) error
	GetActiveSession(ctx context.Context, mockID string) (string, error)
}

EngineDB represents the database interface for the engine

type MockReadWriter

type MockReadWriter interface {
	GetMock(ctx context.Context, id string) (*mock.Mock, error)
	SetMock(ctx context.Context, cfg *mock.Mock) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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