utils

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 8 Imported by: 1 module, 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

Index

Constants

View Source
const SecretMask = "********"

SecretMask replaces stored secrets in API responses. Sending it back unchanged on update keeps the stored value.

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. Credentials (LLM API key/secret, webhook token) are masked.

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