model

package
v0.0.0-...-f5f780e Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2013 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package model provide some interfaces to support application development on multiple database platforms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, driver Driver)

Register makes a database driver available by the provided name. If Register is called twice with the same name or if driver is nil, it panics.

Types

type Driver

type Driver interface {
	DecodeId(interface{}) (Identifier, error)
	ValidIdRep(interface{}) bool
	NewId() Identifier
}

Driver is the interface that ... do something...

func Load

func Load(name string) (Driver, error)

Load return a Driver with name. An error return if the driver not exist

func MustLoad

func MustLoad(name string) Driver

MusLoad return a Driver with name, it panic if the sriver not exist

type Identifier

type Identifier interface {
	Decode(interface{}) error
	Encode() string
	Valid() bool
}

Jump to

Keyboard shortcuts

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