memory

package
v1.4.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 11 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 internal.PublishDocumentEvent
}

func (*Memory) ActivateCustomer

func (m *Memory) ActivateCustomer(customerID string, active bool) error

func (*Memory) AddFile

func (m *Memory) AddFile(dbName string, f internal.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 internal.ExecData) (id string, err error)

func (*Memory) BulkCreateDocument

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

func (*Memory) ChangeCustomerPlan

func (m *Memory) ChangeCustomerPlan(customerID string, plan int) error

func (*Memory) CreateBase

func (m *Memory) CreateBase(base internal.BaseConfig) (internal.BaseConfig, error)

func (*Memory) CreateCustomer

func (m *Memory) CreateCustomer(customer internal.Customer) (internal.Customer, error)

func (*Memory) CreateDocument

func (m *Memory) CreateDocument(auth internal.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) CreateUserAccount

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

func (*Memory) CreateUserToken

func (m *Memory) CreateUserToken(dbName string, tok internal.Token) (id string, err error)

func (*Memory) DatabaseExists

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

func (*Memory) DeleteCustomer

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

func (*Memory) DeleteDocument

func (m *Memory) DeleteDocument(auth internal.Auth, dbName, col, id string) (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) EmailExists

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

func (*Memory) EnableExternalLogin

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

func (*Memory) FindAccount

func (m *Memory) FindAccount(customerID string) (cus internal.Customer, err error)

func (*Memory) FindDatabase

func (m *Memory) FindDatabase(baseID string) (base internal.BaseConfig, err error)

func (*Memory) FindRootToken

func (m *Memory) FindRootToken(dbName, tokenID, accountID, token string) (tok internal.Token, err error)

func (*Memory) FindToken

func (m *Memory) FindToken(dbName, tokenID, token string) (tok internal.Token, err error)

func (*Memory) FindTokenByEmail

func (m *Memory) FindTokenByEmail(dbName, email string) (tok internal.Token, err error)

func (*Memory) GetCustomerByStripeID

func (m *Memory) GetCustomerByStripeID(stripeID string) (cus internal.Customer, err error)

func (*Memory) GetDocumentByID

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

func (*Memory) GetFileByID

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

func (*Memory) GetFirstTokenFromAccountID

func (m *Memory) GetFirstTokenFromAccountID(dbName, accountID string) (tok internal.Token, 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 internal.ExecData, err error)

func (*Memory) GetFunctionByName

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

func (*Memory) GetFunctionForExecution

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

func (*Memory) GetRootForBase

func (m *Memory) GetRootForBase(dbName string) (tok internal.Token, err error)

func (*Memory) IncrementMonthlyEmailSent

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

func (*Memory) IncrementValue

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

func (*Memory) ListAllFiles

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

func (*Memory) ListCollections

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

func (*Memory) ListDatabases

func (m *Memory) ListDatabases() (results []internal.BaseConfig, err error)

func (*Memory) ListDocuments

func (m *Memory) ListDocuments(auth internal.Auth, dbName, col string, params internal.ListParams) (result internal.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 []internal.ExecData, err error)

func (*Memory) ListFunctionsByTrigger

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

func (*Memory) ListTasks

func (m *Memory) ListTasks() (results []internal.Task, err 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 internal.Auth, dbName, col string, filter map[string]any, params internal.ListParams) (result internal.PagedResult, err error)

func (*Memory) RanFunction

func (m *Memory) RanFunction(dbName, id string, rh internal.ExecHistory) 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 internal.Auth, dbName, col, id string, doc map[string]any) (exists map[string]any, err error)

func (*Memory) UpdateDocuments

func (m *Memory) UpdateDocuments(auth internal.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