memstore

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package memstore provides an in-memory SpendStore for local development, ark run, and unit tests. Data is not persisted across restarts.

Register it with a blank import:

import _ "github.com/arkonis-dev/ark/pkg/costs/memstore"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemSpendStore

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

MemSpendStore is a non-persistent, thread-safe SpendStore backed by a slice.

func New

func New() *MemSpendStore

New returns an empty MemSpendStore.

func (*MemSpendStore) Record

func (m *MemSpendStore) Record(_ context.Context, entry costs.SpendEntry) error

func (*MemSpendStore) Rollup

func (m *MemSpendStore) Rollup(_ context.Context, scope costs.SpendScope, period costs.Period, since time.Time) ([]costs.RollupEntry, error)

func (*MemSpendStore) Total

func (m *MemSpendStore) Total(_ context.Context, scope costs.SpendScope, since time.Time) (float64, error)

Jump to

Keyboard shortcuts

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