wdbClient

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Allowed bool = true
	Denied  bool = false
)

Functions

This section is empty.

Types

type Client

type Client interface {
	// Database Methods
	AddDatabase(databaseId model.Identifier, userId model.Identifier) *er.WdbError
	GetDatabase(databaseId model.Identifier) (*model.Database, *er.WdbError)
	DeleteDatabase(databaseId model.Identifier) *er.WdbError

	// Collection Methods
	AddCollection(databaseId, collectionId model.Identifier, schema model.Schema, primaryKey *model.Identifier) *er.WdbError
	GetCollection(databaseId, collectionId model.Identifier) (*model.Collection, *er.WdbError)
	DeleteCollection(databaseId, collectionId model.Identifier) *er.WdbError

	// Data Methods
	AddData(databaseId, collectionId model.Identifier, inputData interface{}) *er.WdbError
	GetData(databaseId model.Identifier, collectionId model.Identifier, filters interface{}) (map[model.Identifier]*model.Record, *er.WdbError)
	UpdateData(databaseId model.Identifier, collectionId model.Identifier, updatedData interface{}, filters interface{}) *er.WdbError
	DeleteData(databaseId model.Identifier, collectionId model.Identifier, filters interface{}) *er.WdbError
	QueryData(databaseId, collectionId model.Identifier, query string, mode data.QueryType) (interface{}, *er.WdbError)

	// Users Methods
	CreateUser(userID model.Identifier, password string) *er.WdbError
	AuthenticateUser(userID model.Identifier, password string) (bool, *er.WdbError)
	CheckUserPermissions(userID model.Identifier, privilege string, entities model.Entities) (bool, *er.WdbError)
	GrantRole(userID model.Identifier, permissions model.Permissions) *er.WdbError
	RevokeRole(userID model.Identifier, permission model.Permissions) (map[string]int, *er.WdbError)

	// Roles Methods
	ListRole(requesterId, forceListAllRoles string) (r.Roles, *er.WdbError)
	CreateRole(roleID model.Identifier, allowed []string, denied []string, hidden bool) *er.WdbError
	UpdateRole(roleID model.Identifier, allowed []string, denied []string, hidden bool) *er.WdbError

	// Admin Method
	InitializeAdmin(config *config.Config)
}

func NewWdbClient

func NewWdbClient(configurations model.Configurations, databases d.Databases, roles r.Roles, users u.Users, hashingAlgorithm string) Client

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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