memory

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PluginMemory = storageTY.TypeMemory
)

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, config cmap.CustomMap) (storageTY.Plugin, error)

New in-memory database

Types

type Config

type Config struct {
	Name         string   `yaml:"name"`
	DumpEnabled  bool     `yaml:"dump_enabled"`
	DumpInterval string   `yaml:"dump_interval"`
	DumpDir      string   `yaml:"dump_dir"`
	DumpFormat   []string `yaml:"dump_format"`
	LoadFormat   string   `yaml:"load_format"`
}

Config of the memory storage

type Store

type Store struct {
	Config Config
	// contains filtered or unexported fields
}

Store to keep all the entities

func (*Store) ClearDatabase

func (s *Store) ClearDatabase() error

ClearDatabase removes all the data from the database

func (*Store) Close

func (s *Store) Close() error

Close Implementation

func (*Store) Delete

func (s *Store) Delete(entityName string, filters []storageTY.Filter) (int64, error)

Delete Implementation

func (*Store) DoStartupImport

func (s *Store) DoStartupImport() (bool, string, string)

DoStartupImport returns the needs, files location, and file format

func (*Store) Find

func (s *Store) Find(entityName string, out interface{}, filters []storageTY.Filter, pagination *storageTY.Pagination) (*storageTY.Result, error)

Find Implementation

func (*Store) FindOne

func (s *Store) FindOne(entityName string, out interface{}, filters []storageTY.Filter) error

FindOne Implementation

func (*Store) Insert

func (s *Store) Insert(entityName string, data interface{}) error

Insert Implementation

func (*Store) Name

func (s *Store) Name() string

func (*Store) Pause

func (s *Store) Pause() error

Pause the storage to perform import like jobs

func (*Store) Ping

func (s *Store) Ping() error

Ping Implementation

func (*Store) Resume

func (s *Store) Resume() error

Resume the storage if Paused

func (*Store) Update

func (s *Store) Update(entityName string, data interface{}, filters []storageTY.Filter) error

Update Implementation

func (*Store) Upsert

func (s *Store) Upsert(entityName string, data interface{}, filters []storageTY.Filter) error

Upsert Implementation

Jump to

Keyboard shortcuts

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