utils

package
v0.0.0-...-46144ef Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAuditFields

func BuildAuditFields(operator *dto.AuthPrincipal) models.AuditFields

func BuildHTMLSummary

func BuildHTMLSummary(content string) string

func BuildMessageHTMLForResponse

func BuildMessageHTMLForResponse(content string) string

func BuildRenderableMessage

func BuildRenderableMessage(item *models.Message) (content, payload string)

func BuildRuntimeMessageText

func BuildRuntimeMessageText(messageType enums.IMMessageType, content string) string

func FormatTime

func FormatTime(t time.Time) string

func FormatTimePtr

func FormatTimePtr(t *time.Time) string

func GenerateRandomPassword

func GenerateRandomPassword(length int) (string, error)

func JoinInt64s

func JoinInt64s(values []int64) string

func NormalizeMessageHTMLAssets

func NormalizeMessageHTMLAssets(content string) (string, error)

func NormalizeNullableString

func NormalizeNullableString(value *string) *string

func SanitizeMessageHTML

func SanitizeMessageHTML(content string) string

func SplitInt64s

func SplitInt64s(raw string) []int64

Types

type ContentChunk

type ContentChunk struct {
	Type       ContentChunkType    //
	Content    string              // text content or image url
	AssetID    string              // image asset id
	Provider   enums.AssetProvider // image provider
	StorageKey string              // image storage key
}

func SplitHTMLContentChunks

func SplitHTMLContentChunks(content string) ([]ContentChunk, error)

type ContentChunkType

type ContentChunkType string
const (
	ContentChunkTypeText  ContentChunkType = "text"
	ContentChunkTypeImage ContentChunkType = "image"
)

Jump to

Keyboard shortcuts

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