example

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarketCapLayout

func MarketCapLayout() *mmapforge.RecordLayout

MarketCapLayout returns the record layout for MarketCap. Fields are validated at code-generation time; ComputeLayout cannot fail here.

Types

type MarketCap

type MarketCap struct {
	ID        uint64  `mmap:"id"`
	Price     float64 `mmap:"price"`
	Volume    float64 `mmap:"volume"`
	MarketCap float64 `mmap:"market_cap"`
	Stale     bool    `mmap:"stale"`
}

mmapforge:schema version=1

type MarketCapRecord

type MarketCapRecord struct {
	ID        uint64
	Price     float64
	Volume    float64
	MarketCap float64
	Stale     bool
}

MarketCapRecord holds all fields of a MarketCap record.

type MarketCapStore

type MarketCapStore struct {
	*mmapforge.Store
}

MarketCapStore is the typed store for MarketCap records.

func NewMarketCapStore

func NewMarketCapStore(path string) (*MarketCapStore, error)

NewMarketCapStore creates a new MarketCap store at the given path.

func OpenMarketCapStore

func OpenMarketCapStore(path string) (*MarketCapStore, error)

OpenMarketCapStore opens an existing MarketCap store at the given path.

func (*MarketCapStore) Get

func (s *MarketCapStore) Get(idx int) (*MarketCapRecord, error)

Get reads all fields atomically for the record at idx.

func (*MarketCapStore) GetID

func (s *MarketCapStore) GetID(idx int) (uint64, error)

GetID returns the ID field for the record at idx.

func (*MarketCapStore) GetMarketCap

func (s *MarketCapStore) GetMarketCap(idx int) (float64, error)

GetMarketCap returns the MarketCap field for the record at idx.

func (*MarketCapStore) GetPrice

func (s *MarketCapStore) GetPrice(idx int) (float64, error)

GetPrice returns the Price field for the record at idx.

func (*MarketCapStore) GetStale

func (s *MarketCapStore) GetStale(idx int) (bool, error)

GetStale returns the Stale field for the record at idx.

func (*MarketCapStore) GetVolume

func (s *MarketCapStore) GetVolume(idx int) (float64, error)

GetVolume returns the Volume field for the record at idx.

func (*MarketCapStore) Set

func (s *MarketCapStore) Set(idx int, rec *MarketCapRecord) error

Set writes all fields atomically for the record at idx.

func (*MarketCapStore) SetID

func (s *MarketCapStore) SetID(idx int, val uint64) error

SetID sets the ID field for the record at idx.

func (*MarketCapStore) SetMarketCap

func (s *MarketCapStore) SetMarketCap(idx int, val float64) error

SetMarketCap sets the MarketCap field for the record at idx.

func (*MarketCapStore) SetPrice

func (s *MarketCapStore) SetPrice(idx int, val float64) error

SetPrice sets the Price field for the record at idx.

func (*MarketCapStore) SetStale

func (s *MarketCapStore) SetStale(idx int, val bool) error

SetStale sets the Stale field for the record at idx.

func (*MarketCapStore) SetVolume

func (s *MarketCapStore) SetVolume(idx int, val float64) error

SetVolume sets the Volume field for the record at idx.

Jump to

Keyboard shortcuts

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