statrow

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: MIT Imports: 8 Imported by: 0 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

Overview

Code generated by kvo. DO NOT EDIT.

Package statrow defines synthetic account state for normal-table benchmarks.

Index

Constants

This section is empty.

Variables

View Source
var Static = kvo.Generated{Fingerprint: "fcd96c3e952dca1b992e6a173b3863c49200aefb99571792641bd51cb68ffa1c",
	Fields: map[reflect.Type]*nativebind.GeneratedFields{
		reflect.TypeFor[State]():     &StaticFields0,
		reflect.TypeFor[Profile]():   &StaticFields3,
		reflect.TypeFor[typ2.Time](): &StaticFields4,
	},
	Encode: func(dst []byte, row any, layout row2.Layout) []byte {
		w := row2.AcquireWriter(dst)
		defer w.Release()
		StaticW0(w, *row.(*State), 0, "", layout, false, 0)
		return w.BytesWritten()
	},
	Decode: func(raw []byte, row any) { *row.(*State) = StaticR0(values.Bytes(raw), true, 0) }}
View Source
var StaticFields0 = nativebind.GeneratedFields{Type: reflect.TypeFor[State](), New: func() unsafe.Pointer { return unsafe.Pointer(new(State)) }, Fields: []nativebind.GeneratedField{
	{Name: "Key", Get: func(p unsafe.Pointer) values.Value { return values.Uint(uint64((*(State))(p).Key)) }, Set: func(p unsafe.Pointer, v values.Value) { (*(State))(p).Key = uint64(v.R) }},
	{Name: "ID", Get: func(p unsafe.Pointer) values.Value { return values.Uint(uint64((*(State))(p).ID)) }, Set: func(p unsafe.Pointer, v values.Value) { (*(State))(p).ID = uint64(v.R) }},
	{Name: "Active", Get: func(p unsafe.Pointer) values.Value { return values.Bool(bool((*(State))(p).Active)) }, Set: func(p unsafe.Pointer, v values.Value) { (*(State))(p).Active = bool(v.R != 0) }},
	{Name: "Revision", Get: func(p unsafe.Pointer) values.Value { return values.Uint(uint64((*(State))(p).Revision)) }, Set: func(p unsafe.Pointer, v values.Value) { (*(State))(p).Revision = uint64(v.R) }},
	{Name: "Profile", Get: func(p unsafe.Pointer) values.Value { return values.Value{P: unsafe.Pointer(&(*(State))(p).Profile)} }, Set: func(p unsafe.Pointer, v values.Value) {
		if v.P == nil {
			var zero Profile
			(*(State))(p).Profile = zero
		} else {
			(*(State))(p).Profile = *(*(Profile))(v.P)
		}
	}},
	{Name: "Group", Get: func(p unsafe.Pointer) values.Value { return values.Uint(uint64((*(State))(p).Group)) }, Set: func(p unsafe.Pointer, v values.Value) { (*(State))(p).Group = uint64(v.R) }},
	{Name: "Created", Get: func(p unsafe.Pointer) values.Value { return values.Value{P: unsafe.Pointer(&(*(State))(p).Created)} }, Set: func(p unsafe.Pointer, v values.Value) {
		if v.P == nil {
			var zero typ2.Time
			(*(State))(p).Created = zero
		} else {
			(*(State))(p).Created = *(*(typ2.Time))(v.P)
		}
	}},
	{Name: "LastActivity", Get: func(p unsafe.Pointer) values.Value {
		return values.Value{P: unsafe.Pointer(&(*(State))(p).LastActivity)}
	}, Set: func(p unsafe.Pointer, v values.Value) {
		if v.P == nil {
			var zero typ2.Time
			(*(State))(p).LastActivity = zero
		} else {
			(*(State))(p).LastActivity = *(*(typ2.Time))(v.P)
		}
	}},
	{Name: "Tags", Get: func(p unsafe.Pointer) values.Value { return values.Value{P: unsafe.Pointer(&(*(State))(p).Tags)} }, Set: func(p unsafe.Pointer, v values.Value) {
		if v.P == nil {
			var zero []uint64
			(*(State))(p).Tags = zero
		} else {
			(*(State))(p).Tags = *(*([]uint64))(v.P)
		}
	}},
	{Name: "History", Get: func(p unsafe.Pointer) values.Value { return values.Value{P: unsafe.Pointer(&(*(State))(p).History)} }, Set: func(p unsafe.Pointer, v values.Value) {
		if v.P == nil {
			var zero map[uint64]int64
			(*(State))(p).History = zero
		} else {
			(*(State))(p).History = *(*(map[uint64]int64))(v.P)
		}
	}},
	{Name: "Progress", Get: func(p unsafe.Pointer) values.Value { return values.Value{P: unsafe.Pointer(&(*(State))(p).Progress)} }, Set: func(p unsafe.Pointer, v values.Value) {
		if v.P == nil {
			var zero map[uint64]Profile
			(*(State))(p).Progress = zero
		} else {
			(*(State))(p).Progress = *(*(map[uint64]Profile))(v.P)
		}
	}},
	{Name: "Segments", Get: func(p unsafe.Pointer) values.Value { return values.Value{P: unsafe.Pointer(&(*(State))(p).Segments)} }, Set: func(p unsafe.Pointer, v values.Value) {
		if v.P == nil {
			var zero []uint64
			(*(State))(p).Segments = zero
		} else {
			(*(State))(p).Segments = *(*([]uint64))(v.P)
		}
	}},
	{Name: "Earned", Get: func(p unsafe.Pointer) values.Value { return values.Int(int64((*(State))(p).Earned)) }, Set: func(p unsafe.Pointer, v values.Value) { (*(State))(p).Earned = int64(v.AsInt()) }},
	{Name: "Spent", Get: func(p unsafe.Pointer) values.Value { return values.Int(int64((*(State))(p).Spent)) }, Set: func(p unsafe.Pointer, v values.Value) { (*(State))(p).Spent = int64(v.AsInt()) }},
	{Name: "Visits", Get: func(p unsafe.Pointer) values.Value { return values.Uint(uint64((*(State))(p).Visits)) }, Set: func(p unsafe.Pointer, v values.Value) { (*(State))(p).Visits = uint64(v.R) }},
}}
View Source
var StaticFields3 = nativebind.GeneratedFields{Type: reflect.TypeFor[Profile](), New: func() unsafe.Pointer { return unsafe.Pointer(new(Profile)) }, Fields: []nativebind.GeneratedField{
	{Name: "Balance", Get: func(p unsafe.Pointer) values.Value { return values.Uint(uint64((*(Profile))(p).Balance)) }, Set: func(p unsafe.Pointer, v values.Value) { (*(Profile))(p).Balance = uint64(v.R) }},
	{Name: "Rate", Get: func(p unsafe.Pointer) values.Value { return values.Uint(uint64((*(Profile))(p).Rate)) }, Set: func(p unsafe.Pointer, v values.Value) { (*(Profile))(p).Rate = uint64(v.R) }},
}}
View Source
var StaticFields4 = nativebind.GeneratedFields{Type: reflect.TypeFor[typ2.Time](), New: func() unsafe.Pointer { return unsafe.Pointer(new(typ2.Time)) }, Fields: []nativebind.GeneratedField{}}

Functions

func Model

func Model() (*kvo.Schema, *kvo.Model)

func StaticR1

func StaticR1(v values.Value, present bool, d int) (out uint64)

func StaticR2

func StaticR2(v values.Value, present bool, d int) (out bool)

func StaticR4

func StaticR4(v values.Value, present bool, d int) (out typ2.Time)

func StaticR5

func StaticR5(v values.Value, present bool, d int) (out []uint64)

func StaticR6

func StaticR6(v values.Value, present bool, d int) (out map[uint64]int64)

func StaticR7

func StaticR7(v values.Value, present bool, d int) (out int64)

func StaticR8

func StaticR8(v values.Value, present bool, d int) (out map[uint64]Profile)

func StaticR9

func StaticR9(v values.Value, present bool, d int) (out []uint64)

func StaticW0

func StaticW0(w *row2.Writer, v State, k uint64, s string, layout row2.Layout, keep bool, d int)

func StaticW1

func StaticW1(w *row2.Writer, v uint64, k uint64, s string, layout row2.Layout, keep bool, d int)

func StaticW2

func StaticW2(w *row2.Writer, v bool, k uint64, s string, layout row2.Layout, keep bool, d int)

func StaticW3

func StaticW3(w *row2.Writer, v Profile, k uint64, s string, layout row2.Layout, keep bool, d int)

func StaticW4

func StaticW4(w *row2.Writer, v typ2.Time, k uint64, s string, layout row2.Layout, keep bool, d int)

func StaticW5

func StaticW5(w *row2.Writer, v []uint64, k uint64, s string, layout row2.Layout, keep bool, d int)

func StaticW6

func StaticW6(w *row2.Writer, v map[uint64]int64, k uint64, s string, layout row2.Layout, keep bool, d int)

func StaticW7

func StaticW7(w *row2.Writer, v int64, k uint64, s string, layout row2.Layout, keep bool, d int)

func StaticW8

func StaticW8(w *row2.Writer, v map[uint64]Profile, k uint64, s string, layout row2.Layout, keep bool, d int)

func StaticW9

func StaticW9(w *row2.Writer, v []uint64, k uint64, s string, layout row2.Layout, keep bool, d int)

Types

type Profile

type Profile struct {
	Balance uint64 `edb:"balance"`
	Rate    uint64 `edb:"rate"`
}

func StaticR3

func StaticR3(v values.Value, present bool, d int) (out Profile)

type State

type State struct {
	Key          uint64             `edb:"-" msgpack:"-"`
	ID           uint64             `edb:"id"`
	Active       bool               `edb:"active"`
	Revision     uint64             `edb:"revision"`
	Profile      Profile            `edb:"profile"`
	Group        uint64             `edb:"group"`
	Created      time.Time          `edb:"created"`
	LastActivity time.Time          `edb:"last_activity"`
	Tags         []uint64           `edb:"tags,compact"`
	History      map[uint64]int64   `edb:"history,compact"`
	Progress     map[uint64]Profile `edb:"progress"`
	Segments     []uint64           `edb:"segments"`
	Earned       int64              `edb:"earned"`
	Spent        int64              `edb:"spent"`
	Visits       uint64             `edb:"visits"`
}

func Sample

func Sample(id uint64) *State

func StaticR0

func StaticR0(v values.Value, present bool, d int) (out State)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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