dao

package
v2.2.0-rc2+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: AGPL-3.0 Imports: 9 Imported by: 232

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var (
	DB_MYSQL_CONNECTIONS_PERCENT_PER_REQUEST = 5
	DB_MYSQL_MAX_CONNECTIONS_PERCENT         = 90
	DB_MYSQL_IDLE_CONNECTIONS_PERCENT        = 25
)

Functions

func FilterDAOErrors added in v1.5.0

func FilterDAOErrors(err error) (error, bool)

FilterDAOErrors hides sensitive information about the underlying table when we receive MySQLError.

Types

type Conn

type Conn interface{}

func NewConn

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

type DAO

type DAO interface {
	Init(configx.Values) error
	GetConn() Conn
	SetConn(Conn)
	CloseConn() error
	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