handler

package
v0.0.0-...-faf4dc0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdCountRows    = "/db/countRows"
	CmdDeleteRows   = "/db/deleteRows"
	CmdCreateTable  = "/db/createTable"
	CmdDropTable    = "/db/dropTable"
	CmdCreateSchema = "/db/createSchema"
	CmdDropSchema   = "/db/dropSchema"
)

Database operation URL paths.

View Source
const (
	TestBulkSeq = "/test/BulkSeq"
	TestManySeq = "/test/ManySeq"
	TestBulkPar = "/test/BulkPar"
	TestManyPar = "/test/ManyPar"
)

Test URL paths.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBHandler

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

DBHandler implements the http.Handler interface for database operations.

func NewDBHandler

func NewDBHandler(log logFunc) (*DBHandler, error)

NewDBHandler returns a new DBHandler instance.

func (DBHandler) DriverVersion

func (h DBHandler) DriverVersion() string

DriverVersion returns the go-hdb driver version.

func (DBHandler) HDBVersion

func (h DBHandler) HDBVersion() string

HDBVersion returns the hdb version.

func (*DBHandler) ServeHTTP

func (h *DBHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DBResult

type DBResult struct {
	Command string
	DbObj   dbObj
	DbOp    dbOp
	ObjName string
	NumRow  int64
	Error   string
}

DBResult is the structure used to provide the JSON based cb command result response.

func (*DBResult) String

func (r *DBResult) String() string

type IndexHandler

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

IndexHandler implements the http.Handler interface for the html index page.

func NewIndexHandler

func NewIndexHandler(testHandler *TestHandler, dbHandler *DBHandler) (*IndexHandler, error)

NewIndexHandler returns a new IndexHandler instance.

func (*IndexHandler) ServeHTTP

func (h *IndexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type TestHandler

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

TestHandler implements the http.Handler interface for the tests.

func NewTestHandler

func NewTestHandler(log logFunc) (*TestHandler, error)

NewTestHandler returns a new TestHandler instance.

func (*TestHandler) ServeHTTP

func (h *TestHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type TestResult

type TestResult struct {
	Test       string
	Seconds    float64
	BatchCount int
	BatchSize  int
	BulkSize   int
	Duration   time.Duration
	Error      string
}

TestResult is the structure used to provide the JSON based test result response.

func (*TestResult) String

func (r *TestResult) String() string

Jump to

Keyboard shortcuts

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