fixtures

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package fixtures provides seed data and seeding helpers for gosuki tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BookmarkToInsertSQL

func BookmarkToInsertSQL(bm SeedBookmark) string

BookmarkToInsertSQL generates an INSERT statement for a single bookmark. The xhsum is a placeholder — in real usage it's computed from the bookmark content.

func BookmarksToInsertSQL

func BookmarksToInsertSQL(bookmarks []SeedBookmark) string

BookmarksToInsertSQL generates a batch INSERT SQL string for multiple bookmarks.

func TagsToDBFormat

func TagsToDBFormat(tags []string) string

TagsToDBFormat converts a tag slice to the DB storage format: comma-separated with leading and trailing commas, e.g. ",tag1,tag2,"

Types

type SeedBookmark

type SeedBookmark struct {
	URL      string
	Title    string
	Tags     []string
	Desc     string
	Modified int64 // Unix timestamp — controlled for sort testing
	Module   string
}

SeedBookmark defines a bookmark for test seeding with controlled modified timestamps. Modified is a unix timestamp used for sort ordering tests.

func DefaultSeedSet

func DefaultSeedSet() []SeedBookmark

DefaultSeedSet returns 5 bookmarks with spaced modified timestamps (1000, 2000, 3000, 4000, 5000) for unambiguous sort verification.

Order by modified: Alpha(1000) < Beta(2000) < Gamma(3000) < Delta(4000) < Epsilon(5000)

func TagVarietySet

func TagVarietySet() []SeedBookmark

TagVarietySet returns bookmarks with overlapping and unique tags for tag-based search and filter testing.

Jump to

Keyboard shortcuts

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