kvstore

package
v0.0.6-alpha.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(logger *logging.Logger, config *datastore.Config) (datastore.Factory, error)

func NewRoleDAO

func NewRoleDAO(params *datastore.Params[*entities.Role]) (datastore.RoleDAO, error)

func NewUserDAO

func NewUserDAO(params *datastore.Params[*entities.User]) (datastore.UserDAO, error)

func NewWebAuthnDAO

func NewWebAuthnDAO(params *datastore.Params[*entities.Blob]) (datastore.WebAuthnDAO, error)

Types

type AferoDAO

type AferoDAO[E any] struct {
	datastore.GenericDAO[E]
	// contains filtered or unexported fields
}

func NewAferoDAO

func NewAferoDAO[E any](params *datastore.Params[E]) (*AferoDAO[E], error)

Creates a key/value blob storage backend

func (*AferoDAO[E]) Count

func (aferoDAO *AferoDAO[E]) Count(CONSISTENCY_LEVEL datastore.ConsistencyLevel) (int, error)

Returns the number of items in the blob store partition using a buffered read

func (*AferoDAO[E]) Delete

func (aferoDAO *AferoDAO[E]) Delete(entity E) error

Deletes the provided entity from the blob datastore. Returns an error if the provided entity can't be found.

func (*AferoDAO[E]) ForEachPage

func (aferoDAO *AferoDAO[E]) ForEachPage(
	pageQuery datastore.PageQuery,
	pagerProcFunc datastore.PagerProcFunc[E],
	CONSISTENCY_LEVEL datastore.ConsistencyLevel) error

Reads all records in batches of PageQuery.PageSize, passing each page to the provided pageProcFunc to process the resultset.

func (*AferoDAO[E]) Get

func (aferoDAO *AferoDAO[E]) Get(id uint64, CONSISTENCY_LEVEL datastore.ConsistencyLevel) (E, error)

Retrieves the entity with the provided ID from the blob datastore. Returns an error if the entity can't be found or if it can't be unmarshalled.

func (*AferoDAO[E]) Page

func (aferoDAO *AferoDAO[E]) Page(
	pageQuery datastore.PageQuery,
	CONSISTENCY_LEVEL datastore.ConsistencyLevel) (datastore.PageResult[E], error)

Returns a page of items in the blob store partition

func (*AferoDAO[E]) Save

func (aferoDAO *AferoDAO[E]) Save(entity E) error

Saves the provided entity to the blob datastore. Returns an error if the entity can not be serialized or there is a problem saving to blob storage.

type Factory

type Factory struct {
	datastore.Factory
	// contains filtered or unexported fields
}

func (*Factory) OrganizationDAO

func (factory *Factory) OrganizationDAO() (datastore.OrganizationDAO, error)

func (*Factory) RegistrationDAO

func (factory *Factory) RegistrationDAO() (datastore.RegistrationDAO, error)

func (*Factory) RoleDAO

func (factory *Factory) RoleDAO() (datastore.RoleDAO, error)

func (*Factory) SerializerType

func (factory *Factory) SerializerType() serializer.SerializerType

func (*Factory) UserDAO

func (factory *Factory) UserDAO() (datastore.UserDAO, error)

func (*Factory) WebAuthnDAO

func (factory *Factory) WebAuthnDAO() (datastore.WebAuthnDAO, error)

type OrganizationDAO

type OrganizationDAO struct {
	*AferoDAO[*entities.Organization]
}

func (*OrganizationDAO) GetUsers

func (organizationDAO *OrganizationDAO) GetUsers(id uint64, CONSISTENCY_LEVEL datastore.ConsistencyLevel) ([]*entities.User, error)

type RegistrationDAO

type RegistrationDAO struct {
	*AferoDAO[*entities.Registration]
}

type RoleDAO

type RoleDAO struct {
	*AferoDAO[*entities.Role]
}

func (*RoleDAO) GetByName

func (roleDAO *RoleDAO) GetByName(name string, CONSISTENCY_LEVEL datastore.ConsistencyLevel) (*entities.Role, error)

type UserDAO

type UserDAO struct {
	*AferoDAO[*entities.User]
}

type WebAuthnDAO

type WebAuthnDAO struct {
	*AferoDAO[*entities.Blob]
}

Jump to

Keyboard shortcuts

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