gocmsutil

package
v0.142.3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deref

func Deref(val reflect.Value) reflect.Value

func ExtractUUID

func ExtractUUID(val reflect.Value, fieldName string) (uuid.UUID, bool)

func GetIntField

func GetIntField(val reflect.Value, name string) (int, bool)

func MapFieldAny

func MapFieldAny(val reflect.Value, fieldName string) map[string]any

func ResolveActiveLocaleCodes

func ResolveActiveLocaleCodes(ctx context.Context, resolver LocaleResolver) ([]string, error)

func ResolveLocaleID added in v0.33.0

func ResolveLocaleID(ctx context.Context, cache *LocaleIDCache, localeCode string) (uuid.UUID, bool)

func SetMapField

func SetMapField(val reflect.Value, fieldName string, value map[string]any)

func SetStringField

func SetStringField(val reflect.Value, fieldName string, value string)

Types

type ActiveLocaleResolver

type ActiveLocaleResolver interface {
	ActiveLocales(ctx context.Context) ([]cms.LocaleInfo, error)
}

type LocaleIDCache

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

func NewLocaleIDCache

func NewLocaleIDCache(resolver LocaleResolver) *LocaleIDCache

func (*LocaleIDCache) Resolve

func (c *LocaleIDCache) Resolve(ctx context.Context, localeCode string) (uuid.UUID, bool)

type LocaleResolver

type LocaleResolver interface {
	ResolveByCode(ctx context.Context, code string) (cms.LocaleInfo, error)
}

Jump to

Keyboard shortcuts

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