castmodel

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package castmodel supplies imported rich Go shapes for CAST integration tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bounds

type Bounds struct {
	Unit string     `json:"unit"`
	Cap  int        `json:"cap"`
	Has  *BoundsHas `json:"-" sqlx:"-" setMarker:"true"`
}

type BoundsHas

type BoundsHas struct{ Unit, Cap bool }

type Record

type Record struct {
	ID     int        `json:"id" sqlx:"id,primaryKey=true"`
	Unit   string     `json:"-" sqlx:"unit" internal:"true"`
	Cap    int        `json:"-" sqlx:"cap" internal:"true"`
	Bounds Bounds     `json:"bounds" sqlx:"-"`
	Labels []string   `json:"labels" sqlx:"labels,enc=JSON"`
	Has    *RecordHas `json:"-" sqlx:"-" setMarker:"true"`
}

func (*Record) Init

func (r *Record) Init(context.Context) error

Init maps only supplied nested fields to their physical backing columns.

func (*Record) OnFetch

func (r *Record) OnFetch(context.Context) error

type RecordHas

type RecordHas struct{ ID, Unit, Cap, Bounds, Labels bool }

type Scalar

type Scalar[T ScalarValue] struct {
	ID    int        `json:"id" sqlx:"id,primaryKey=true"`
	Unit  string     `json:"-" sqlx:"unit"`
	Cap   int        `json:"-" sqlx:"cap"`
	Value T          `json:"value" sqlx:"-"`
	Has   *ScalarHas `json:"-" sqlx:"-" setMarker:"true"`
}

func (*Scalar[T]) Init

func (r *Scalar[T]) Init(context.Context) error

func (*Scalar[T]) OnFetch

func (r *Scalar[T]) OnFetch(context.Context) error

type ScalarHas

type ScalarHas struct{ ID, Unit, Cap, Value bool }

type ScalarValue

type ScalarValue interface{ int | *int | string }

Jump to

Keyboard shortcuts

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