cmsadapter

package
v0.145.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package cmsadapter contains internal CMS adapter helper families that can live outside the top-level admin package without pulling receiver-bound adapter types or admin-only orchestration state with them.

Index

Constants

View Source
const (
	DefaultChannelKey     = "default"
	DefaultEnvironmentKey = DefaultChannelKey
)

Variables

This section is empty.

Functions

func AdminBlockDefinitionRecordToCMSBlockDefinition

func AdminBlockDefinitionRecordToCMSBlockDefinition(record cms.AdminBlockDefinitionRecord) cmsboot.CMSBlockDefinition

AdminBlockDefinitionRecordToCMSBlockDefinition maps the upstream admin definition DTO onto the local CMSBlockDefinition contract.

func AdminBlockDefinitionVersionRecordToCMSBlockDefinitionVersion

func AdminBlockDefinitionVersionRecordToCMSBlockDefinitionVersion(record cms.AdminBlockDefinitionVersionRecord) cmsboot.CMSBlockDefinitionVersion

AdminBlockDefinitionVersionRecordToCMSBlockDefinitionVersion maps the upstream admin definition-version DTO onto the local CMSBlockDefinitionVersion contract.

func AdminBlockRecordToCMSBlock

func AdminBlockRecordToCMSBlock(record cms.AdminBlockRecord) cmsboot.CMSBlock

AdminBlockRecordToCMSBlock maps the upstream admin block DTO onto the local CMSBlock contract.

func AdminContentRecordToCMSContent

func AdminContentRecordToCMSContent(record cms.AdminContentRecord) cmsboot.CMSContent

func AsString

func AsString(val any, fallback string) string

func BlockDefinitionChannel

func BlockDefinitionChannel(def cmsboot.CMSBlockDefinition) string

func BoolField

func BoolField(val reflect.Value, field string) (bool, bool)

func BoolFieldAny

func BoolFieldAny(val reflect.Value, fields ...string) (bool, bool)

func BuildGoCMSContentTranslations

func BuildGoCMSContentTranslations(content cmsboot.CMSContent) []cmscontent.ContentTranslationInput

func CMSBlockDefinitionToAdminBlockDefinitionCreateRequest

func CMSBlockDefinitionToAdminBlockDefinitionCreateRequest(def cmsboot.CMSBlockDefinition, envKey string) cms.AdminBlockDefinitionCreateRequest

CMSBlockDefinitionToAdminBlockDefinitionCreateRequest maps the local block definition onto the upstream admin write-service create request.

func CMSBlockDefinitionToAdminBlockDefinitionUpdateRequest

func CMSBlockDefinitionToAdminBlockDefinitionUpdateRequest(def cmsboot.CMSBlockDefinition, id uuid.UUID, envKey string) cms.AdminBlockDefinitionUpdateRequest

CMSBlockDefinitionToAdminBlockDefinitionUpdateRequest maps the local block definition onto the upstream admin write-service update request.

func CMSBlockToAdminBlockSaveRequest

func CMSBlockToAdminBlockSaveRequest(block cmsboot.CMSBlock, definitionID, contentID, createdBy, updatedBy uuid.UUID) cms.AdminBlockSaveRequest

CMSBlockToAdminBlockSaveRequest maps the local CMSBlock contract onto the upstream admin block write-service save request.

func CMSContentToAdminContentCreateRequest

func CMSContentToAdminContentCreateRequest(content cmsboot.CMSContent, contentTypeID, actor uuid.UUID, allowMissing bool) cms.AdminContentCreateRequest

func CMSContentToAdminContentUpdateRequest

func CMSContentToAdminContentUpdateRequest(content cmsboot.CMSContent, contentTypeID, actor uuid.UUID, allowMissing bool) cms.AdminContentUpdateRequest

func CMSContentToAdminContentUpdateTranslationRequest added in v0.105.0

func CMSContentToAdminContentUpdateTranslationRequest(content cmsboot.CMSContent, contentTypeID, actor uuid.UUID, allowMissing bool) cms.AdminContentUpdateTranslationRequest

func CacheKey

func CacheKey(env, key string) string

func ChannelsMatch

func ChannelsMatch(recordChannel, requestedChannel string) bool

func CollectBlockDefinitionCacheEntry

func CollectBlockDefinitionCacheEntry(target map[string]uuid.UUID, names map[uuid.UUID]string, entry BlockDefinitionCacheEntry)

func ContentTypeChannel

func ContentTypeChannel(ct cmsboot.CMSContentType) string

func ConvertBlockDefinition

func ConvertBlockDefinition(value reflect.Value) cmsboot.CMSBlockDefinition

func ConvertBlockDefinitionVersion

func ConvertBlockDefinitionVersion(value reflect.Value) cmsboot.CMSBlockDefinitionVersion

func ConvertGoCMSResolvedWidget

func ConvertGoCMSResolvedWidget(entry *cmswidgets.ResolvedWidget) dashinternal.WidgetInstance

func ConvertGoCMSWidgetInstance

func ConvertGoCMSWidgetInstance(val *cmswidgets.Instance) dashinternal.WidgetInstance

func ExtractStructuralMetadata

func ExtractStructuralMetadata(data map[string]any) (map[string]any, map[string]any)

func InjectStructuralMetadata

func InjectStructuralMetadata(metadata map[string]any, data map[string]any) map[string]any

func MergeMetadata

func MergeMetadata(base map[string]any, updates map[string]any) map[string]any

func NormalizeChannel

func NormalizeChannel(value string) string

func NormalizeStructuralMetadata

func NormalizeStructuralMetadata(metadata map[string]any) map[string]any

func PersistTranslationGroupMetadata

func PersistTranslationGroupMetadata(groupID string, data, metadata map[string]any) (map[string]any, map[string]any)

func PlacementPositionForInstance

func PlacementPositionForInstance(placements []*cmswidgets.AreaPlacement, instanceID uuid.UUID) int

func RequestedFamilyID

func RequestedFamilyID(groupID string, mapsToCheck ...map[string]any) string

func ResolveBlockDefinitionCacheEnv

func ResolveBlockDefinitionCacheEnv(def cmsboot.CMSBlockDefinition, fallback string) string

func ResolveContentTypeChannel

func ResolveContentTypeChannel(ct cmsboot.CMSContentType, fallback string) string

func ResolveContextChannel

func ResolveContextChannel(fallback string, ctx context.Context, resolvers ...ContextStringResolver) string

func ResolvedFamilyID

func ResolvedFamilyID(groupID string, mapsToCheck ...map[string]any) string

func SetBlockDefinitionChannel

func SetBlockDefinitionChannel(def *cmsboot.CMSBlockDefinition, channel string)

func SetContentTypeChannel

func SetContentTypeChannel(ct *cmsboot.CMSContentType, channel string)

func StringField

func StringField(val reflect.Value, field string) string

func StringFieldAny

func StringFieldAny(val reflect.Value, fields ...string) string

func StringSliceField

func StringSliceField(val reflect.Value, field string) []string

func StringSliceFieldAny

func StringSliceFieldAny(val reflect.Value, fields ...string) []string

func StructuralMetadataFromData

func StructuralMetadataFromData(data map[string]any) map[string]any

func UUIDFromString

func UUIDFromString(id string) uuid.UUID

func UUIDPointerFromString added in v0.77.0

func UUIDPointerFromString(id string) *uuid.UUID

func UUIDStringField

func UUIDStringField(val reflect.Value, name string) string

func WidgetPlacementMetadata

func WidgetPlacementMetadata(instance dashinternal.WidgetInstance) map[string]any

Types

type BlockDefinitionCache

type BlockDefinitionCache struct {
	// contains filtered or unexported fields
}

func NewBlockDefinitionCache

func NewBlockDefinitionCache() *BlockDefinitionCache

func (*BlockDefinitionCache) Lookup

func (c *BlockDefinitionCache) Lookup(envKey, globalKey string) (uuid.UUID, bool)

func (*BlockDefinitionCache) LookupName

func (c *BlockDefinitionCache) LookupName(env, key string) (uuid.UUID, bool)

func (*BlockDefinitionCache) Name

func (c *BlockDefinitionCache) Name(id uuid.UUID) string

func (*BlockDefinitionCache) Publish

func (c *BlockDefinitionCache) Publish(defs map[string]uuid.UUID, names map[uuid.UUID]string)

func (*BlockDefinitionCache) PublishDefinition

func (c *BlockDefinitionCache) PublishDefinition(def cmsboot.CMSBlockDefinition, id uuid.UUID, env string, includeGlobal bool)

type BlockDefinitionCacheEntry

type BlockDefinitionCacheEntry struct {
	ID            uuid.UUID
	Env           string
	Primary       string
	Aliases       []string
	IncludeGlobal bool
}

func NewBlockDefinitionCacheEntry

func NewBlockDefinitionCacheEntry(def cmsboot.CMSBlockDefinition, id uuid.UUID, env string, includeGlobal bool) BlockDefinitionCacheEntry

type ContextStringResolver

type ContextStringResolver func(context.Context) string

Jump to

Keyboard shortcuts

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