unsafe

package
v0.0.0-...-9d85d00 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUnsafeValue

func NewUnsafeValue(val any, meta *model.Model) valuer.Value

func PrintFieldOffset

func PrintFieldOffset(entity any)

Types

type FieldMeta

type FieldMeta struct {
	Offset uintptr
	// contains filtered or unexported fields
}

type UnsafeAccessor

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

UnsafeAccessor 使用 unsafe 通过操作内存地址的方式,实现读取/修改值

func NewUnsafeAccessor

func NewUnsafeAccessor(entity any) *UnsafeAccessor

func (*UnsafeAccessor) Field

func (a *UnsafeAccessor) Field(field string) (any, error)

func (*UnsafeAccessor) SetField

func (a *UnsafeAccessor) SetField(field string, val any) error

Jump to

Keyboard shortcuts

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