Versions in this module Expand all Collapse all v1 v1.0.3 Sep 5, 2026 Changes in this version + const CodeInvalid + const CodeNoSteps + const CodePointerError + const STRUCT_TAG + const UNKNOWN_FLAG_FALLBACK + var ErrInvalid = errors.New(CodeInvalid, "invalid value") + var ErrNoSteps = errors.New(CodeNoSteps, "no step found") + var ErrNotPointer = errors.New(CodePointerError, "value is not a pointer") + var OK = NewAllowList() + func AddStepKind(dstIfSrcElseSrc reflect.Kind, args ...any) + func AddStepType(dstIfSrcElseSrc reflect.Type, args ...any) + func CheckDisallowIface[TYPE any](t reflect.Type) bool + func CheckDisallowKind[TYPE any](t reflect.Type) bool + func CheckDisallowType[TYPE any](t reflect.Type) bool + func Copy(ctx context.Context, dst any, src any, opts ...func(*State)) (err error) + func CopyT[TYP any, PTR any](ctx context.Context, dst *PTR, src TYP, opts ...func(*State)) (err error) + func Flag(flag CloneFlag, reset ...bool) func(s *State) + func SharedStateContext(ctx context.Context, opts ...func(s *State)) context.Context + func StructFieldsForClone(s *State, typ reflect.Type) iter.Seq[reflect.StructField] + func WrapStep(fn func(*State, Step) Step) func(s *State) + type AllowList struct + func NewAllowList() AllowList + func (a *AllowList) Check[FUNC ClonableCheckFunc](fn FUNC) + func (a AllowList) Type(t reflect.Type) (allows bool) + func (a AllowList) Value(ctx context.Context, val reflect.Value) bool + type BaseStep struct + func (f BaseStep) Copy(ctx context.Context, s *State, d, i reflect.Value) error + func (f BaseStep) Init(ctx context.Context, s *State, dst, src reflect.Type) (Step, error) + type ClonableCheckFunc interface + type ClonableCheckTypeFunc = func(reflect.Type) bool + type ClonableCheckValueFunc = func(reflect.Value, reflect.Type) bool + type CloneFlag = bitcheck.Flag + const CF_INVALID + const CF_KEEP_POINTERS + const CF_NOVALIDATE + const CF_NOWRAP + const CF_NO_CONVS + const CF_ONLY_PUB_FLDS + type FuncStep func(s *State, dst, src reflect.Value) error + func (f FuncStep) Copy(ctx context.Context, s *State, d, i reflect.Value) error + type InitStep interface + Init func(ctx context.Context, s *State, dst, src reflect.Type) (Step, error) + type InterfaceStep struct + func (f InterfaceStep) Copy(ctx context.Context, s *State, dst, src reflect.Value) (err error) + func (f InterfaceStep) Init(ctx context.Context, s *State, dst, src reflect.Type) (_ Step, err error) + type MapStep struct + func (f MapStep) Copy(ctx context.Context, s *State, dst, src reflect.Value) (err error) + func (m MapStep) Init(ctx context.Context, s *State, dst, src reflect.Type) (step Step, err error) + type PointerStep struct + func (f PointerStep) Copy(ctx context.Context, s *State, dst, src reflect.Value) error + func (f PointerStep) Init(ctx context.Context, s *State, dst, src reflect.Type) (_ Step, err error) + type Registry interface + AddStepKind func(dstIfSrcElseSrc reflect.Kind, src ...any) + AddStepType func(dstIfSrcElseSrc reflect.Type, src ...any) + Step func(dst reflect.Type, src reflect.Type) (Step, bool) + type ResettableRegistry interface + Reset func() int + var NopRegistry ResettableRegistry = nopRegistry{} + type SliceStep struct + func (f SliceStep) Copy(ctx context.Context, s *State, dst, src reflect.Value) error + func (f SliceStep) Init(ctx context.Context, s *State, dst, src reflect.Type) (step Step, err error) + type State struct + Flags CloneFlag + func StateFromContext(ctx context.Context) (*State, bool) + func (s *State) Cache() ResettableRegistry + func (s *State) MakeMap(oldPtr reflect.Value, dstVal reflect.Value, newTyp reflect.Type, _len int) (newOrCached reflect.Value, wasCached bool) + func (s *State) MakeSlice(oldPtr reflect.Value, dstVal reflect.Value, newTyp reflect.Type, l int) (n reflect.Value, wasCached bool) + func (s *State) New(keyPtr reflect.Value, dstVal reflect.Value, newTyp reflect.Type) (newOrCached reflect.Value, cached bool) + func (s *State) Step(dstIfSrcElseSrc reflect.Type, src reflect.Type) (Step, bool) + func (s *State) StepCopy(ctx context.Context, step Step, dst, src reflect.Value) error + func (s *State) StepInit(ctx context.Context, dst, src reflect.Type) (step Step, err error) + type Step interface + Copy func(ctx context.Context, s *State, dst, src reflect.Value) error + type StructStep struct + func (f StructStep) Copy(ctx context.Context, s *State, dst, src reflect.Value) error + func (f StructStep) Init(ctx context.Context, s *State, dst, src reflect.Type) (Step, error) + type StructToMapStep struct + func (f StructToMapStep) Copy(ctx context.Context, s *State, dst, src reflect.Value) error + func (m StructToMapStep) Init(ctx context.Context, s *State, dst, src reflect.Type) (step Step, err error) + type ToArrayStep struct + func (f ToArrayStep) Copy(ctx context.Context, s *State, dst, src reflect.Value) error + func (f ToArrayStep) Init(ctx context.Context, s *State, dst, src reflect.Type) (step Step, err error) + type UUIDStep struct + func (f UUIDStep) Copy(ctx context.Context, s *State, dst, src reflect.Value) error