testmodels

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Details

type Details struct {
	Description string  `json:"description"`
	Score       float64 `json:"score"`
	WasVerified bool    `json:"was_verified"`
	Info        Info    `json:"info"`
}

Details represents the nested details structure.

type Document

type Document []Item

Document represents an array of Items.

type Info

type Info struct {
	Category string   `json:"category"`
	Rating   int      `json:"rating"`
	Features []string `json:"features"`
	Options  Options  `json:"options"`
}

Info represents the information block in details.

type Item

type Item struct {
	dirty.Enabled

	ID       int      `json:"id"`
	Name     string   `json:"name"`
	IsActive bool     `json:"is_active"`
	Details  Details  `json:"details"`
	Tags     []string `json:"tags"`
}

Item is the top-level object in the JSON document. It embeds json.Enabled to allow dirty unmarshalling.

func (Item) Dirty

func (i Item) Dirty() any

Dirty returns the dirty schema variant for the Item. This is used when clean unmarshalling fails so that flexible (dirty) parsing can be applied to problematic fields.

func (Item) String

func (i Item) String() string

String returns JSON representation of the Item (Clean JSON).

type Option

type Option struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Option represents a key/value pair in the option array.

type Options

type Options []Option

Jump to

Keyboard shortcuts

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