utils

package
v0.0.0-...-dde20d3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatAgentData

func FormatAgentData(agents []agents.Agent) []map[string]any

FormatAgentData returns an array of agents as DATA (not schema).

func FormatAgentSchema

func FormatAgentSchema(agent *agents.Agent) map[string]any

FormatAgentSchema formats a single agent into a schema map for API endpoints.

func FormatAgentsSchema

func FormatAgentsSchema(agents []agents.Agent) []map[string]any

FormatAgentsSchema returns an array of agent schemas for admin endpoints.

func FormatCollectionItem

func FormatCollectionItem(item *models.Item, collection *models.Collection) map[string]any

FormatCollectionItem formats a single item for a Strapi-like /api/[collection] response.

func FormatCollectionItems

func FormatCollectionItems(items []models.Item, collection *models.Collection) []map[string]any

FormatCollectionItems returns multiple items formatted for Strapi

func FormatCollectionSchema

func FormatCollectionSchema(collection *models.Collection) map[string]any

func FormatCollectionsData

func FormatCollectionsData(collections []models.Collection) []map[string]any

FormatCollectionData returns an array of collections as DATA (not schema), Strapi-style for /collections API.

func FormatCollectionsSchema

func FormatCollectionsSchema(collections []models.Collection) []map[string]any

FormatCollectionsSchema: returns an array of collection schemas for admin endpoints.

func FormatNestedItems

func FormatNestedItems(itemID uint, data models.JSONMap, collection *models.Collection) map[string]any

FormatNestedItemToStrapi wraps your nested JSONMap

func GenerateSlug

func GenerateSlug(username string) string

GenerateSlug creates a URL-friendly slug from the provided username.

Types

This section is empty.

Jump to

Keyboard shortcuts

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