memory

package
v1.5.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldID        = "id"
	FieldAccountID = "accountId"
	FieldOwnerID   = "ownerId"
	FieldCreated   = "sb_created"
)

Variables

This section is empty.

Functions

Types

type Memory

type Memory struct {
	DB              map[string]map[string][]byte
	PublishDocument cache.PublishDocumentEvent
}

func (*Memory) ActivateTenant added in v1.4.1

func (m *Memory) ActivateTenant(tenantID string, active bool) error

func (*Memory) AddFile

func (m *Memory) AddFile(dbName string, f model.File) (id string, err error)

func (*Memory) AddFormSubmission

func (m *Memory) AddFormSubmission(dbName, form string, doc map[string]any) error

func (*Memory) AddFunction

func (m *Memory) AddFunction(dbName string, data model.ExecData) (id string, err error)

func (*Memory) AddTask added in v1.5.0

func (m *Memory) AddTask(dbName string, task model.Task) error

func (*Memory) BulkCreateDocument

func (m *Memory) BulkCreateDocument(auth model.Auth, dbName, col string, docs []interface{}) error

func (*Memory) ChangeTenantPlan added in v1.4.1

func (m *Memory) ChangeTenantPlan(tenantID string, plan int) error

func (*Memory) Count added in v1.4.3

func (m *Memory) Count(auth model.Auth, dbName, col string, filter map[string]interface{}) (int64, error)

func (*Memory) CreateAccount added in v1.4.1

func (m *Memory) CreateAccount(dbName, email string) (id string, err error)

func (*Memory) CreateDatabase added in v1.4.1

func (m *Memory) CreateDatabase(base model.DatabaseConfig) (model.DatabaseConfig, error)

func (*Memory) CreateDocument

func (m *Memory) CreateDocument(auth model.Auth, dbName, col string, doc map[string]interface{}) (map[string]interface{}, error)

func (*Memory) CreateIndex

func (m *Memory) CreateIndex(dbName, col, field string) error

func (*Memory) CreateTenant added in v1.4.1

func (m *Memory) CreateTenant(customer model.Tenant) (model.Tenant, error)

func (*Memory) CreateUser added in v1.4.1

func (m *Memory) CreateUser(dbName string, tok model.User) (id string, err error)

func (*Memory) DatabaseExists

func (m *Memory) DatabaseExists(name string) (exists bool, err error)

func (*Memory) DeleteDocument

func (m *Memory) DeleteDocument(auth model.Auth, dbName, col, id string) (n int64, err error)

func (*Memory) DeleteDocuments added in v1.5.0

func (m *Memory) DeleteDocuments(auth model.Auth, dbName, col string, filters map[string]any) (n int64, err error)

func (*Memory) DeleteFile

func (m *Memory) DeleteFile(dbName, fileID string) error

func (*Memory) DeleteFunction

func (m *Memory) DeleteFunction(dbName, name string) error

func (*Memory) DeleteTask added in v1.5.0

func (m *Memory) DeleteTask(dbName, id string) error

func (*Memory) DeleteTenant added in v1.4.1

func (m *Memory) DeleteTenant(dbName, email string) error

func (*Memory) EmailExists

func (m *Memory) EmailExists(email string) (exists bool, err error)

func (*Memory) EnableExternalLogin

func (m *Memory) EnableExternalLogin(tenantID string, config map[string]model.OAuthConfig) error

func (*Memory) FindDatabase

func (m *Memory) FindDatabase(baseID string) (base model.DatabaseConfig, err error)

func (*Memory) FindRootUser added in v1.4.1

func (m *Memory) FindRootUser(dbName, userID, accountID, token string) (tok model.User, err error)

func (*Memory) FindTenant added in v1.4.1

func (m *Memory) FindTenant(tenantID string) (cus model.Tenant, err error)

func (*Memory) FindUser added in v1.4.1

func (m *Memory) FindUser(dbName, userID, token string) (tok model.User, err error)

func (*Memory) FindUserByEmail added in v1.4.1

func (m *Memory) FindUserByEmail(dbName, email string) (tok model.User, err error)

func (*Memory) GetDocumentByID

func (m *Memory) GetDocumentByID(auth model.Auth, dbName, col, id string) (doc map[string]interface{}, err error)

func (*Memory) GetDocumentsByIDs added in v1.4.2

func (m *Memory) GetDocumentsByIDs(auth model.Auth, dbName, col string, ids []string) (docs []map[string]interface{}, err error)

func (*Memory) GetFileByID

func (m *Memory) GetFileByID(dbName, fileID string) (f model.File, err error)

func (*Memory) GetFirstUserFromAccountID added in v1.4.1

func (m *Memory) GetFirstUserFromAccountID(dbName, accountID string) (tok model.User, err error)

func (*Memory) GetForms

func (m *Memory) GetForms(dbName string) (names []string, err error)

func (*Memory) GetFunctionByID

func (m *Memory) GetFunctionByID(dbName, id string) (data model.ExecData, err error)

func (*Memory) GetFunctionByName

func (m *Memory) GetFunctionByName(dbName, name string) (data model.ExecData, err error)

func (*Memory) GetFunctionForExecution

func (m *Memory) GetFunctionForExecution(dbName, name string) (data model.ExecData, err error)

func (*Memory) GetRootForBase

func (m *Memory) GetRootForBase(dbName string) (tok model.User, err error)

func (*Memory) GetTenantByStripeID added in v1.4.1

func (m *Memory) GetTenantByStripeID(stripeID string) (cus model.Tenant, err error)

func (*Memory) GetUserByID added in v1.5.0

func (m *Memory) GetUserByID(dbName, accountID, userID string) (user model.User, err error)

func (*Memory) IncrementMonthlyEmailSent

func (m *Memory) IncrementMonthlyEmailSent(baseID string) error

func (*Memory) IncrementValue

func (m *Memory) IncrementValue(auth model.Auth, dbName, col, id, field string, n int) error

func (*Memory) ListAccounts added in v1.5.0

func (m *Memory) ListAccounts(dbName string) ([]model.Account, error)

func (*Memory) ListAllFiles

func (m *Memory) ListAllFiles(dbName, accountID string) (results []model.File, err error)

func (*Memory) ListCollections

func (m *Memory) ListCollections(dbName string) (repos []string, err error)

func (*Memory) ListDatabases

func (m *Memory) ListDatabases() (results []model.DatabaseConfig, err error)

func (*Memory) ListDocuments

func (m *Memory) ListDocuments(auth model.Auth, dbName, col string, params model.ListParams) (result model.PagedResult, err error)

func (*Memory) ListFormSubmissions

func (m *Memory) ListFormSubmissions(dbName, name string) (docs []map[string]any, err error)

func (*Memory) ListFunctions

func (m *Memory) ListFunctions(dbName string) (list []model.ExecData, err error)

func (*Memory) ListFunctionsByTrigger

func (m *Memory) ListFunctionsByTrigger(dbName, trigger string) (list []model.ExecData, err error)

func (*Memory) ListTasks

func (m *Memory) ListTasks() (results []model.Task, err error)

func (*Memory) ListTasksByBase added in v1.5.0

func (m *Memory) ListTasksByBase(dbName string) ([]model.Task, error)

func (*Memory) ListUsers added in v1.5.0

func (m *Memory) ListUsers(dbName, accountID string) ([]model.User, error)

func (*Memory) NewID

func (m *Memory) NewID() string

func (*Memory) ParseQuery

func (m *Memory) ParseQuery(clauses [][]interface{}) (filter map[string]any, err error)

func (*Memory) Ping

func (m *Memory) Ping() error

func (*Memory) QueryDocuments

func (m *Memory) QueryDocuments(auth model.Auth, dbName, col string, filter map[string]any, params model.ListParams) (result model.PagedResult, err error)

func (*Memory) RanFunction

func (m *Memory) RanFunction(dbName, id string, rh model.ExecHistory) error

func (*Memory) RemoveUser added in v1.5.0

func (m *Memory) RemoveUser(auth model.Auth, dbName, userID string) error

func (*Memory) ResetPassword

func (m *Memory) ResetPassword(dbName, email, code, password string) error

func (*Memory) SetPasswordResetCode

func (m *Memory) SetPasswordResetCode(dbName, tokenID, code string) error

func (*Memory) SetUserRole

func (m *Memory) SetUserRole(dbName, email string, role int) error

func (*Memory) UpdateDocument

func (m *Memory) UpdateDocument(auth model.Auth, dbName, col, id string, doc map[string]any) (exists map[string]any, err error)

func (*Memory) UpdateDocuments

func (m *Memory) UpdateDocuments(auth model.Auth, dbName, col string, filter map[string]interface{}, updateFields map[string]interface{}) (n int64, err error)

func (*Memory) UpdateFunction

func (m *Memory) UpdateFunction(dbName, id, code, trigger string) error

func (*Memory) UserEmailExists

func (m *Memory) UserEmailExists(dbName, email string) (exists bool, err error)

func (*Memory) UserSetPassword

func (m *Memory) UserSetPassword(dbName, tokenID, password string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳