Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Model("User", func() {
- Description("This is the User model and describes a User as in any system")
- Composition("UserAddon")
- Field("id", gorma.UUID, func() {
- PrimaryKey()
- SQLTag("type:uuid")
- Description("This is the ID PK field")
- })
- Field("email", gorma.String)
- })
- type UserStorage interface {
- UserAddon // Added by the use of "Composition" in DSL
- DB() interface{}
- List(ctx context.Context) []User
- Get(ctx context.Context, id uuid.UUID) (User, error)
- Add(ctx context.Context, user *User) (*User, error)
- Update(ctx context.Context, user *User) error
- Delete(ctx context.Context, id uuid.UUID) error
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement