memory

package
v0.0.0-...-f52bcce Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package memory is an output adapter to store entities in memory

Package memory is an output adapter to store entities in memory

Package memory implements in memory output

Package memory implements in memory output

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemoryRepository

func NewMemoryRepository(cryptoKey []byte) *memoryRepository

NewMemoryRepository in memory repository constructor function

Types

type DMO

type DMO struct {
	*user.EntityDMO // Do not remove it. This will let you add custom encrypted fields and more.

}

type EntityDMOMemory

type EntityDMOMemory struct {
	*user.EntityDMO

	Id_      string `json:"id"`
	Created_ int64  `json:"created"`
	Updated_ int64  `json:"updated"`

	Name_     string `json:"name,omitempty" `
	Email_    string `json:"email,omitempty" `
	Password_ string `json:"password,omitempty" torpedo.field:"encrypted"`
	Plan_     string `json:"plan,omitempty" `
	Miles_    int64  `json:"miles,omitempty" `

	DMO
}

EntityDMOMemory Data Mapper Object to the memory output

func NewEntityDMOMemory

func NewEntityDMOMemory(key []byte) *EntityDMOMemory

NewEntityDMOMemory constructor function

func NewEntityDMOMemoryFrom

func NewEntityDMOMemoryFrom(ety *user.UserEntity, key []byte) (*EntityDMOMemory, error)

NewEntityDMOMemoryFrom constructor function from user.UserEntity

func (*EntityDMOMemory) Created

func (dmo *EntityDMOMemory) Created() int64

Created getter method

func (*EntityDMOMemory) Email

func (dmo *EntityDMOMemory) Email() string

Email getter method

func (*EntityDMOMemory) HydrateFromEntity

func (dmo *EntityDMOMemory) HydrateFromEntity(ety *user.UserEntity) error

HydrateFromEntity populates the DMO fields from the user.UserEntity

func (*EntityDMOMemory) Id

func (dmo *EntityDMOMemory) Id() string

Id getter method

func (*EntityDMOMemory) Miles

func (dmo *EntityDMOMemory) Miles() int64

Miles getter method

func (*EntityDMOMemory) Name

func (dmo *EntityDMOMemory) Name() string

Name getter method

func (*EntityDMOMemory) Password

func (dmo *EntityDMOMemory) Password() (string, error)

Password getter method

func (*EntityDMOMemory) Plan

func (dmo *EntityDMOMemory) Plan() string

Plan getter method

func (*EntityDMOMemory) ToEntity

func (dmo *EntityDMOMemory) ToEntity() (*user.UserEntity, error)

ToEntity returns a user.UserEntity from the DMO object

func (*EntityDMOMemory) Updated

func (dmo *EntityDMOMemory) Updated() int64

Updated getter method

Jump to

Keyboard shortcuts

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