expandable

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap1RE

func Wrap1RE[T1, R1, B1 any](f func(*T1) (R1, error), d1 *Derived[T1, B1]) func(*B1) (R1, error)

func Wrap2

func Wrap2[D1, D2, B1, B2 any](f func(*D1, *D2), d1 *Derived[D1, B1], d2 *Derived[D2, B2]) func(*B1, *B2)

func Wrap21

func Wrap21[D1, T2, B1 any](f func(*D1, T2), d1 *Derived[D1, B1]) func(*B1, T2)

func Wrap21A

func Wrap21A[D1, T2, B1 any](f func(*D1, *T2) any, d1 *Derived[D1, B1]) func(*B1, *T2) any

func Wrap21B added in v0.3.0

func Wrap21B[D1, T2, B1 any](f func(*D1, T2) bool, d1 *Derived[D1, B1]) func(*B1, T2) bool

func Wrap2E

func Wrap2E[D1, D2, B1, B2 any](f func(*D1, *D2) error, d1 *Derived[D1, B1], d2 *Derived[D2, B2]) func(*B1, *B2) error

Types

type Any

type Any[B any] interface {
	String() string
	Base() *Base[B]
	Type() reflect.Type
	PtrType() reflect.Type

	AnyFrom(base *B) any
	// contains filtered or unexported methods
}

type Base

type Base[B any] struct {
	// contains filtered or unexported fields
}

func NewBase

func NewBase[B any](schema *Schema, name string) *Base[B]

func (*Base[B]) AnyFrom

func (t *Base[B]) AnyFrom(base *B) any

func (*Base[B]) AnyFull

func (t *Base[B]) AnyFull(base *B) any

func (*Base[B]) Base

func (t *Base[B]) Base() *Base[B]

func (*Base[B]) FacetByPtrType

func (t *Base[B]) FacetByPtrType(typ reflect.Type) Any[B]

func (*Base[B]) New

func (t *Base[B]) New() *B

func (*Base[B]) PtrType

func (t *Base[B]) PtrType() reflect.Type

func (*Base[B]) String

func (t *Base[B]) String() string

func (*Base[B]) Type

func (t *Base[B]) Type() reflect.Type

func (*Base[B]) WithNew

func (t *Base[B]) WithNew(f func() *B) *Base[B]

type Derived

type Derived[T, B any] struct {
	// contains filtered or unexported fields
}

func Derive

func Derive[T, B any](schema *Schema, base *Base[B]) *Derived[T, B]

func (*Derived[T, B]) AnyFrom

func (t *Derived[T, B]) AnyFrom(base *B) any

func (*Derived[T, B]) Base

func (t *Derived[T, B]) Base() *Base[B]

func (*Derived[T, B]) From

func (t *Derived[T, B]) From(base *B) *T

func (*Derived[T, B]) PtrType

func (t *Derived[T, B]) PtrType() reflect.Type

func (*Derived[T, B]) String

func (t *Derived[T, B]) String() string

func (*Derived[T, B]) ToBase

func (t *Derived[T, B]) ToBase(drvd *T) *B

func (*Derived[T, B]) Type

func (t *Derived[T, B]) Type() reflect.Type

func (*Derived[T, B]) WithNew

func (t *Derived[T, B]) WithNew(f func() *T) *Derived[T, B]

func (*Derived[T, B]) Wrap

func (t *Derived[T, B]) Wrap(f func(*T)) func(*B)

func (*Derived[T, B]) WrapAE

func (t *Derived[T, B]) WrapAE(f func(*T) (any, error)) func(*B) (any, error)

type Expandable

type Expandable interface {
	ExpandableImpl() *Impl
}

type Impl

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

func (*Impl) ExpandableImpl

func (impl *Impl) ExpandableImpl() *Impl

type Schema

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

func NewSchema

func NewSchema(name string) *Schema

Jump to

Keyboard shortcuts

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