repositories

package
v0.0.0-...-b27b957 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyticsRepositoryInterface

type AnalyticsRepositoryInterface interface {
	Insert(reqs []entities.AnalyticsHTTPRequestMetadata) error
	Prune(threshold time.Duration) error
	GetMetrics() (map[string]entities.AnalyticsMetric, error)
	GetMetric(key []byte) ([]byte, error)
	SetMetric(key, value []byte) error
	GetRequestMetadata(t time.Time, metrics map[string]entities.AnalyticsMetric) ([]entities.AnalyticsHTTPRequestMetadata, error)
}

type CRUDInterface

type CRUDInterface interface {
	SetEntity(entityType string, entity interface{}) (string, error)
	UpdateEntity(entityType, entityId string, update map[string]interface{}) (interface{}, error)
	DeleteEntity(entityId string) error
	FindByTarget(targets []string) ([]interface{}, error)
	FindOneByTarget(target string) (interface{}, error)
	FindOneBySlug(slug string) (string, interface{}, error)
	FindAll(namespace string) ([]interface{}, error)
	FindAllWithOptions(
		namespace string,
		order constants.SortOrder,
		pagination *entities.Pagination,
	) (int, []interface{}, error)
}

type Cache

type Cache interface {
	GetByKey(key string) interface{}
	Warm(value []byte) error
}

type Cacheable

type Cacheable interface {
	Cache() Cache
	InvalidateCache() error
}

type ConfigRepositoryInterface

type ConfigRepositoryInterface interface {
	Cacheable
	SetConfig(data url.Values) error
	GetConfig(key string) ([]byte, error)
	GetAll() ([]byte, error)
	PutConfig(key string, value interface{}) error
}

type ContentRepositoryInterface

type ContentRepositoryInterface interface {
	CreateEntityStore(entityName string, entityType interface{}) error
	CRUDInterface
	EntityIdentifierInterface
	Types() map[string]content.Builder
}

type CredentialHashRepositoryInterface

type CredentialHashRepositoryInterface interface {
	GetByUserId(userId string, credentialType entities.CredentialType) (*entities.CredentialHash, error)
	SetCredential(hash *entities.CredentialHash) error
}

type EntityIdentifierInterface

type EntityIdentifierInterface interface {
	UniqueSlug(slug string) (string, error)
	IsValidID(id string) bool
	NextIDSequence(entityType string) (string, error)
}

type RecoveryKeyRepositoryInterface

type RecoveryKeyRepositoryInterface interface {
	SetRecoveryKey(email, key string) error
	GetRecoveryKey(email string) (string, error)
}

type UserRepositoryInterface

type UserRepositoryInterface interface {
	SetUser(usr *entities.User) error
	UpdateUser(usr, updatedUsr *entities.User) error
	DeleteUser(email string) error
	GetUserByEmail(email string) (*entities.User, error)
	// GetAllUsers users repository can and should return Users entity and not byte arrays
	GetAllUsers() ([][]byte, error)
}

Jump to

Keyboard shortcuts

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