Documentation
¶
Index ¶
- Variables
- func ConnectToCouchBase(host, user, password string)
- func DeleteReadModel(id string) (gocb.Cas, error)
- func UpsertEventStore(id string, eventStore EventStore) (gocb.Cas, error)
- func UpsertReadModel(id string, model interface{}) (gocb.Cas, error)
- type Event
- type EventStore
- type Post
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var EventBucket *gocb.Bucket
View Source
var ReadBucket *gocb.Bucket
Functions ¶
func ConnectToCouchBase ¶
func ConnectToCouchBase(host, user, password string)
func UpsertEventStore ¶
func UpsertEventStore(id string, eventStore EventStore) (gocb.Cas, error)
Types ¶
type EventStore ¶
type EventStore struct {
Store []Event
}
func AddEventToEventStore ¶
func AddEventToEventStore(eventStore EventStore, event Event) (EventStore, bool)
func GetEventStore ¶
func GetEventStore(id string) (EventStore, gocb.Cas, error)
type Post ¶
type Post struct {
ID uint64 `json:"id"`
Title string `json:"title"`
Content string `json:"content"`
AuthorID uint32 `json:"author_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func BuildPostReadModel ¶
func BuildPostReadModel(id string, eventStore EventStore) (Post, error)
type User ¶
type User struct {
ID uint32 `gorm:"primary_key;auto_increment" json:"id"`
Nickname string `gorm:"size:255;not null;unique" json:"nickname"`
Email string `gorm:"size:100;not null;unique" json:"email"`
Password string `gorm:"size:100;not null;" json:"password"`
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
}
Click to show internal directories.
Click to hide internal directories.