Model updates
This commit is contained in:
parent
ee36e26edc
commit
ce12c040fa
@ -2,6 +2,7 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/micro/go-micro/v2/codec"
|
||||||
"github.com/micro/go-micro/v2/store"
|
"github.com/micro/go-micro/v2/store"
|
||||||
"github.com/micro/go-micro/v2/sync"
|
"github.com/micro/go-micro/v2/sync"
|
||||||
)
|
)
|
||||||
@ -27,13 +28,19 @@ type Model interface {
|
|||||||
type Entity interface {
|
type Entity interface {
|
||||||
// Unique id of the entity
|
// Unique id of the entity
|
||||||
Id() string
|
Id() string
|
||||||
|
// Name of the entity
|
||||||
|
Name() string
|
||||||
// The value associated with the entity
|
// The value associated with the entity
|
||||||
Value() interface{}
|
Value() interface{}
|
||||||
// Attributes of the enity
|
// Attributes of the enity
|
||||||
Attributes() map[string]interface{}
|
Attributes() map[string]interface{}
|
||||||
|
// Read a value as a concrete type
|
||||||
|
Read(v interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
type Options struct {
|
type Options struct {
|
||||||
|
// for serialising
|
||||||
|
Codec codec.Marshaler
|
||||||
// for locking
|
// for locking
|
||||||
Sync sync.Sync
|
Sync sync.Sync
|
||||||
// for storage
|
// for storage
|
||||||
|
Loading…
x
Reference in New Issue
Block a user