Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v1 state

Back to all declarations

Record

type

Record is v1's shape: Score widened to int64 and scaled by 1000, plus a new Active flag that migrated records get set to true.

Value

v1.Record

migrate

func(old *v0.Record) *v1.Record

migrate converts a v0 record into a v1 one. Kept separate from Get so the conversion is testable without a write.

Open
OID
05a1c0…c897:8
migrate details

Inspect func

Get

func(key string) *v1.Record

Get returns a record, migrating it from v0 on first touch. Crossing, because the migration writes. That is the cost of the pattern: the cheapest possible read is now a transaction.

Open
OID
05a1c0…c897:9
Get details

Inspect func

Peek

func(key string) *v1.Record

Peek is the read-only half: it never migrates, so a record that has not been touched yet reads as its v0 self converted on the fly and NOT stored.

Open
OID
05a1c0…c897:10
Peek details

Inspect func

Migrated

func() int

Migrated is how many records have actually moved over.

Open
OID
05a1c0…c897:11
Migrated details

Inspect func

Pending

func() int

Pending is how many v0 records have never been touched. It is only a bound: v0 keeps every record it ever had, migrated or not.

Open
OID
05a1c0…c897:12
Pending details

Inspect func
Record : type =v1.Record
records : *v0.Tree Inspect
init.2 : func() Inspect
migrate : func(old *v0.Record) *v1.Record Inspect
Get : func(key string) *v1.Record Inspect
Peek : func(key string) *v1.Record Inspect
Migrated : func() int Inspect
Pending : func() int Inspect
Render : func(string) string Inspect