Help us shape the future of Go! Take the 2026 Go Developer Survey

mapstore

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package mapstore provides the in-memory ModelStore implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store keeps a complete model in Go maps.

func New

func New(scopeID uint64) *Store

New returns an empty in-memory store.

func (*Store) Apply

func (s *Store) Apply(ctx context.Context, batch modelstore.TrainingBatch) error

Apply applies one batch atomically.

func (*Store) Classes

func (s *Store) Classes(ctx context.Context) ([]modelstore.Class, error)

Classes returns copied class records in ascending ID order.

func (*Store) Close

func (s *Store) Close() error

Close releases this store. It is safe to call more than once.

func (*Store) ExportTransitions

func (s *Store) ExportTransitions(ctx context.Context, sink func(modelstore.TransitionCount) error) error

ExportTransitions sends copied transition counts in ascending ID order.

func (*Store) Reset

func (s *Store) Reset(ctx context.Context) error

Reset clears all learned state.

func (*Store) ScopeID

func (s *Store) ScopeID() uint64

ScopeID returns the model scope ID.

func (*Store) Stats

func (s *Store) Stats(ctx context.Context, fromID uint64) (modelstore.Stats, error)

Stats returns one consistent count view for an input ID.

Jump to

Keyboard shortcuts

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