dao

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package dao provides abstraction of persistence layer used by pydio services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface{}

func NewConn

func NewConn(d string, dsn string) (Conn, error)

type DAO

type DAO interface {
	Init(config.Map) error
	GetConn() Conn
	SetConn(Conn)
	Driver() string

	// Prefix is used to prevent collision between table names
	// in case this DAO accesses a shared DB.
	Prefix() string
}

DAO interface definition

func NewDAO

func NewDAO(conn Conn, driver string, prefix string) DAO

NewDAO returns a reference to a newly created struct that contains the necessary information to access a database. Prefix parameter is used to specify a prefix to avoid collision between table names in case this DAO accesses a shared DB: it thus will be an empty string in most of the cases.

Jump to

Keyboard shortcuts

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