testUtils

package
v0.0.0-...-72364b4 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

View Source
var (
	TestQueryCol   = map[string][]string{}
	FailQuery      int
	ErrQueryFailed = errors.New("query failed")
)

Functions

func GenerateCert

func GenerateCert(host, validFrom *string, validFor *time.Duration, isCA *bool, rsaBits *int) (certName, keyName string)

Generate a self-signed X.509 certificate for a TLS server. Outputs to 'cert.pem' and 'key.pem' and will overwrite existing files.

Types

type StubDbClient

type StubDbClient struct {
	Host   string
	UseTls bool
}

stub a database client

func (*StubDbClient) Close

func (StubDbClient *StubDbClient) Close()

func (*StubDbClient) Log

func (StubDbClient *StubDbClient) Log(interface{})

func (*StubDbClient) QueryInsertUpdate

func (StubDbClient *StubDbClient) QueryInsertUpdate(query string, args ...interface{}) error

func (*StubDbClient) QueryMapFirstColumnToRow

func (StubDbClient *StubDbClient) QueryMapFirstColumnToRow(query string, args ...interface{}) (map[string][]string, error)

func (*StubDbClient) QueryReturnColumnDict

func (StubDbClient *StubDbClient) QueryReturnColumnDict(query string, args ...interface{}) (map[string][]string, error)

func (*StubDbClient) ValidateInsertStatement

func (StubDbClient *StubDbClient) ValidateInsertStatement(query string, args ...interface{}) error

Jump to

Keyboard shortcuts

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