mock

package
v0.0.0-...-51d629d Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2016 License: BSD-3-Clause, BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2014 Charles Gentry. All rights reserved. Please see the license included with this package

Index

Constants

View Source
const (
	// DriverName Specifies the specific identity of this driver within a group
	DriverName      = "mock"
	IdentityStorage = "Mock"
	HelpShort       = "Simple JSON File. Store data JSON encoded into a file"
	HelpTemplate    = `

   This is a dummy driver used for testing purposes.

   `
)

Variables

This section is empty.

Functions

func Register

func Register()

Register is a simple wrapper to make sure registration occurs properly

Types

type MockConn

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

func (*MockConn) Close

func (t *MockConn) Close() error

Close the connection to the database (if it is open)

func (*MockConn) GetRawHandle

func (t *MockConn) GetRawHandle() interface{}

Return the raw database handle to the caller. This allows more flexible options

func (*MockConn) UserFetch

func (t *MockConn) UserFetch(domain, key, value string) (*tenant.User, error)

func (*MockConn) UserInsert

func (t *MockConn) UserInsert(user *tenant.User) error

func (*MockConn) UserUpdate

func (t *MockConn) UserUpdate(user *tenant.User) error

type MockDriver

type MockDriver struct{}

func NewMockDriver

func NewMockDriver() *MockDriver

Fetch a raw database Mock driver

func (*MockDriver) Open

func (t *MockDriver) Open(option1 string, extraDriverOptions string) (storage.Conn, error)

The main driver will call this function to get a connection to the SqlLite db driver. it then 'routes' calls through this connection.

Jump to

Keyboard shortcuts

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