driver

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultDriver = &BaseDriver{}
)

Functions

func GetAll

func GetAll() map[string]Driver

func Has

func Has(name string) bool

func Register

func Register(name string, driver Driver)

func Unregister

func Unregister(name string)

Types

type BaseDriver

type BaseDriver struct {
	echo.Context
	*DbAuth
	// contains filtered or unexported fields
}

func NewBaseDriver

func NewBaseDriver() *BaseDriver

func (*BaseDriver) AddResults

func (m *BaseDriver) AddResults(rs ...result.Resulter) Driver

func (*BaseDriver) CreateData

func (m *BaseDriver) CreateData() error

func (*BaseDriver) CreateDb

func (m *BaseDriver) CreateDb() error

func (*BaseDriver) CreateTable

func (m *BaseDriver) CreateTable() error

func (*BaseDriver) Export

func (m *BaseDriver) Export() error

func (*BaseDriver) Foreign

func (m *BaseDriver) Foreign() error

func (*BaseDriver) GenURL

func (m *BaseDriver) GenURL(op string, args ...string) string

func (*BaseDriver) Import

func (m *BaseDriver) Import() error

func (*BaseDriver) Indexes

func (m *BaseDriver) Indexes() error

func (*BaseDriver) Info

func (m *BaseDriver) Info() error

func (*BaseDriver) Init

func (m *BaseDriver) Init(ctx echo.Context, auth *DbAuth)

func (*BaseDriver) IsSupported

func (m *BaseDriver) IsSupported(operation string) bool

func (*BaseDriver) ListData

func (m *BaseDriver) ListData() error

func (*BaseDriver) ListDb

func (m *BaseDriver) ListDb() error

func (*BaseDriver) ListTable

func (m *BaseDriver) ListTable() error

func (*BaseDriver) Login

func (m *BaseDriver) Login() error

func (*BaseDriver) Logout

func (m *BaseDriver) Logout() error

func (*BaseDriver) ModifyDb

func (m *BaseDriver) ModifyDb() error

func (*BaseDriver) ModifyTable

func (m *BaseDriver) ModifyTable() error

func (*BaseDriver) Name

func (m *BaseDriver) Name() string

func (*BaseDriver) Privileges

func (m *BaseDriver) Privileges() error

func (*BaseDriver) ProcessList

func (m *BaseDriver) ProcessList() error

func (*BaseDriver) Results

func (m *BaseDriver) Results() []result.Resulter

func (*BaseDriver) RunCommand

func (m *BaseDriver) RunCommand() error

func (*BaseDriver) SaveResults

func (m *BaseDriver) SaveResults() Driver

func (*BaseDriver) SavedResults

func (m *BaseDriver) SavedResults() interface{}

func (*BaseDriver) SetResults

func (m *BaseDriver) SetResults(rs ...result.Resulter) Driver

func (*BaseDriver) SetURLGenerator

func (m *BaseDriver) SetURLGenerator(fn func(string, ...string) string) Driver

func (*BaseDriver) Trigger

func (m *BaseDriver) Trigger() error

func (*BaseDriver) ViewTable

func (m *BaseDriver) ViewTable() error

type DbAuth

type DbAuth struct {
	Driver   string
	Username string
	Password string
	Host     string
	Db       string
}

func (*DbAuth) CopyFrom

func (d *DbAuth) CopyFrom(auth *DbAuth) *DbAuth

type Driver

type Driver interface {
	Init(echo.Context, *DbAuth)
	SetURLGenerator(func(string, ...string) string) Driver
	GenURL(string, ...string) string
	Results() []result.Resulter
	AddResults(...result.Resulter) Driver
	SetResults(...result.Resulter) Driver
	SaveResults() Driver
	SavedResults() interface{}
	IsSupported(string) bool
	Login() error
	Logout() error
	ProcessList() error
	Privileges() error
	Info() error
	CreateDb() error
	ModifyDb() error
	ListDb() error
	CreateTable() error
	ModifyTable() error
	ListTable() error
	ViewTable() error
	ListData() error
	CreateData() error
	Indexes() error
	Foreign() error
	Trigger() error
	RunCommand() error
	Import() error
	Export() error
	Name() string
}

func Get

func Get(name string) (Driver, bool)

func GetForce

func GetForce(name string) Driver

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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