data

package
v0.0.0-...-9829ae4 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Limit = 50
)

Variables

This section is empty.

Functions

func GetActionResultMap

func GetActionResultMap(rawData interface{}) (map[string]interface{}, error)

func GetMultipleResultMap

func GetMultipleResultMap(rawData interface{}) ([]interface{}, error)

func GetPatchResultMap

func GetPatchResultMap(rawData interface{}) (map[string]interface{}, error)

func GetSingleResultMap

func GetSingleResultMap(rawData interface{}) (map[string]interface{}, error)

func GetSurrealDBResponse

func GetSurrealDBResponse(rawData interface{}) (map[string]interface{}, error)

Types

type NoSQLDatabase

type NoSQLDatabase interface {
	GetSingle(query string, vars interface{}) (interface{}, error)
	GetMultiple(query string, vars interface{}) ([]interface{}, error)
	Query(query string, vars interface{}) (interface{}, error)
	QueryWithoutResponse(query string, vars interface{}) (interface{}, error)
	Create(table string, data interface{}) (interface{}, error)
	Patch(id string, data interface{}) (interface{}, error)
	Delete(id string) error
	Init() error
	Close() error
}

type RQLite

type RQLite struct {
	Config   *RQLiteConfig
	Database *gorqlite.Connection
}

func NewRQLite

func NewRQLite() *RQLite

func (*RQLite) Close

func (db *RQLite) Close() error

func (*RQLite) Init

func (db *RQLite) Init() error

type RQLiteConfig

type RQLiteConfig struct {
	Host           string
	Port           int
	User           string
	Password       string
	Namespace      string
	Database       string
	Authentication bool
}

type SQLDatabase

type SQLDatabase interface {
	Orm() *gorm.DB
	Init() error
	Close() error
}

type SQLite

type SQLite struct {
	Config   *SQLiteConfig
	Database *gorm.DB
}

func NewSQLite

func NewSQLite() *SQLite

func (*SQLite) Close

func (db *SQLite) Close() error

func (*SQLite) Init

func (db *SQLite) Init() error

func (*SQLite) Orm

func (db *SQLite) Orm() *gorm.DB

type SQLiteConfig

type SQLiteConfig struct {
	Database string
}

type SurrealDB

type SurrealDB struct {
	Config   *SurrealDBConfig
	Database *surrealdb.DB
}

func NewSurrealDB

func NewSurrealDB() *SurrealDB

func (*SurrealDB) Close

func (db *SurrealDB) Close() error

func (*SurrealDB) Create

func (db *SurrealDB) Create(table string, data interface{}) (interface{}, error)

func (*SurrealDB) Delete

func (db *SurrealDB) Delete(id string) error

func (*SurrealDB) GetMultiple

func (db *SurrealDB) GetMultiple(query string, vars interface{}) ([]interface{}, error)

func (*SurrealDB) GetSingle

func (db *SurrealDB) GetSingle(query string, vars interface{}) (interface{}, error)

func (*SurrealDB) Init

func (db *SurrealDB) Init() error

func (*SurrealDB) Patch

func (db *SurrealDB) Patch(id string, data interface{}) (interface{}, error)

func (*SurrealDB) Query

func (db *SurrealDB) Query(query string, vars interface{}) (interface{}, error)

func (*SurrealDB) QueryWithoutResponse

func (db *SurrealDB) QueryWithoutResponse(query string, vars interface{}) (interface{}, error)

type SurrealDBConfig

type SurrealDBConfig struct {
	Host      string
	Port      int
	User      string
	Password  string
	Namespace string
	Database  string
}

type SurrealDBResponse

type SurrealDBResponse struct {
	Result []interface{} `json:"result"`
	Status string        `json:"status"`
	Time   string        `json:"time"`
}

Jump to

Keyboard shortcuts

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