1
0
Fork 0

Adding upstream version 0.28.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-22 10:57:38 +02:00
parent 88f1d47ab6
commit e28c88ef14
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
933 changed files with 194711 additions and 0 deletions

32
core/record_proxy.go Normal file
View file

@ -0,0 +1,32 @@
package core
// RecordProxy defines an interface for a Record proxy/project model,
// aka. custom model struct that acts on behalve the proxied Record to
// allow for example typed getter/setters for the Record fields.
//
// To implement the interface it is usually enough to embed the [BaseRecordProxy] struct.
type RecordProxy interface {
// ProxyRecord returns the proxied Record model.
ProxyRecord() *Record
// SetProxyRecord loads the specified record model into the current proxy.
SetProxyRecord(record *Record)
}
var _ RecordProxy = (*BaseRecordProxy)(nil)
// BaseRecordProxy implements the [RecordProxy] interface and it is intended
// to be used as embed to custom user provided Record proxy structs.
type BaseRecordProxy struct {
*Record
}
// ProxyRecord returns the proxied Record model.
func (m *BaseRecordProxy) ProxyRecord() *Record {
return m.Record
}
// SetProxyRecord loads the specified record model into the current proxy.
func (m *BaseRecordProxy) SetProxyRecord(record *Record) {
m.Record = record
}