kopia lustrzana https://github.com/reiver/greatape
35 wiersze
594 B
Go
35 wiersze
594 B
Go
package model
|
|
|
|
import (
|
|
. "fmt"
|
|
|
|
. "github.com/xeronith/diamante/contracts/database"
|
|
. "github.com/xeronith/diamante/contracts/system"
|
|
)
|
|
|
|
type (
|
|
RepositoryTransactionHandler func(transaction IRepositoryTransaction) error
|
|
|
|
IEntity interface {
|
|
Stringer
|
|
Id() int64
|
|
SortOrder() float32
|
|
SetSortOrder(float32)
|
|
Payload() string
|
|
SetPayload(string)
|
|
Validate() error
|
|
}
|
|
|
|
IRepository interface {
|
|
Name() string
|
|
Migrate() error
|
|
GetSqlDatabase() ISqlDatabase
|
|
SetSqlDatabase(ISqlDatabase)
|
|
Serialize(Pointer, error)
|
|
}
|
|
|
|
IRepositoryTransaction interface {
|
|
OnCommit(func())
|
|
}
|
|
)
|