crystalline

package module
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: GPL-3.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JSQuoteStyle    = "'"
	JSTrailingComma = false
)

Functions

func Map

func Map(data interface{}) (interface{}, error)

func MapOrPanic

func MapOrPanic(data interface{}) interface{}

func MapOrPanicPromise added in v0.0.3

func MapOrPanicPromise(data interface{}, promise bool) interface{}

func MapPromise added in v0.0.3

func MapPromise(data interface{}, promise bool) (interface{}, error)

func MarkIgnored added in v0.0.8

func MarkIgnored(entity string, fn string)

func MarkPromise added in v0.0.8

func MarkPromise(entity string, fn string)

func SortedKeys

func SortedKeys[T any](data map[string]T) []string

Types

type Definition

type Definition struct {
	Name        string
	Entities    map[string]reflect.Type
	Definitions map[string]reflect.Type
	Nested      map[string]*Definition
	FuncMeta    map[string]map[string]*FuncMeta
	Promises    map[string]bool
	NotNil      map[string]bool
}

func (*Definition) Serialize

func (d *Definition) Serialize(ctx context.Context, appName string, path []string) (string, string, error)

type Exposer

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

func NewExposer

func NewExposer(appName string) *Exposer

func (*Exposer) AddDefinition

func (e *Exposer) AddDefinition(typeDef reflect.Type) error

func (*Exposer) AddEntity

func (e *Exposer) AddEntity(namespace []string, name string, typeDef reflect.Type, promise bool) error

func (*Exposer) Build

func (e *Exposer) Build() (string, string, error)

func (*Exposer) Expose

func (e *Exposer) Expose(entity any, packageName string, name string) error

func (*Exposer) ExposeFunc

func (e *Exposer) ExposeFunc(entity any) error

func (*Exposer) ExposeFuncOrPanic

func (e *Exposer) ExposeFuncOrPanic(entity any)

func (*Exposer) ExposeFuncOrPanicPromise added in v0.0.3

func (e *Exposer) ExposeFuncOrPanicPromise(entity any)

func (*Exposer) ExposeFuncPromise added in v0.0.3

func (e *Exposer) ExposeFuncPromise(entity any, promise bool) error

func (*Exposer) ExposeOrPanic

func (e *Exposer) ExposeOrPanic(entity any, packageName string, name string)

type FuncMeta added in v0.0.6

type FuncMeta struct {
	ArgNames []string
	Promise  bool
}

type WeakCache

type WeakCache[T any] struct {
	// contains filtered or unexported fields
}

func NewWeak

func NewWeak[T any]() *WeakCache[T]

func (*WeakCache[T]) Fetch

func (c *WeakCache[T]) Fetch(key uintptr, fetch fetch[T]) (T, error)

func (*WeakCache[T]) Len

func (c *WeakCache[T]) Len() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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