data

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MessiName          = "Lionel"
	PassSecret         = "Secret00"
	PassSecretEcrypted = password.EncryptPassword(PassSecret)
	MessiEmail         = "lionel.messi@fcb.com"
	MessiEmail2        = "lm@barcelona.es"
	MessiID            = uint(0)
	MustermannName     = "Mustermann GesmbH"
	MustermannID       = uint(1)
	MustermannStreet   = "Short Street"
)

...

Functions

This section is empty.

Types

type Datastore

type Datastore interface {
	entitydata.EntityDatastore
	GetUser(name string) (*models.User, error)
	GetDB() *gorm.DB
}

Datastore interface to datastore

func NewInMemoryDatastore

func NewInMemoryDatastore() (Datastore, error)

NewInMemoryDatastore ...

func NewPostgres

func NewPostgres() (Datastore, error)

NewPostgres ...

func NewSqlite

func NewSqlite(dbName string) (Datastore, error)

NewSqlite ...

type DatastoreImpl

type DatastoreImpl struct {
	*entitydata.GormEntityDatastore
}

DatastoreImpl the Datastore implementation

func (DatastoreImpl) GetDB

func (ds DatastoreImpl) GetDB() *gorm.DB

GetDB ...

func (*DatastoreImpl) GetUser

func (ds *DatastoreImpl) GetUser(username string) (*models.User, error)

GetUser return User data

type MockedDatastore

type MockedDatastore struct {
	mock.Mock
}

MockedDatastore ...

func (*MockedDatastore) CreateEntity

func (m *MockedDatastore) CreateEntity(entity interface{}) error

CreateEntity ...

func (*MockedDatastore) DeleteEntityByID

func (m *MockedDatastore) DeleteEntityByID(entity interface{}, id uint) error

DeleteEntityByID ...

func (*MockedDatastore) GetAllEntities

func (m *MockedDatastore) GetAllEntities(entity interface{}, entitySlice interface{}) error

GetAllEntities ...

func (*MockedDatastore) GetDB

func (m *MockedDatastore) GetDB() *gorm.DB

GetDB ...

func (*MockedDatastore) GetEntityByID

func (m *MockedDatastore) GetEntityByID(entity interface{}, id uint) error

GetEntityByID ...

func (*MockedDatastore) GetOneEntityBy

func (m *MockedDatastore) GetOneEntityBy(entity interface{}, key string, val interface{}) error

GetOneEntityBy ...

func (*MockedDatastore) GetUser

func (m *MockedDatastore) GetUser(username string) (*models.User, error)

GetUser ...

func (*MockedDatastore) SaveEntity

func (m *MockedDatastore) SaveEntity(entity interface{}) error

SaveEntity ...

Jump to

Keyboard shortcuts

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