Skip to content

Commit

Permalink
add dummy model
Browse files Browse the repository at this point in the history
  • Loading branch information
kAvEh-- committed Sep 18, 2024
1 parent 6ff34bd commit 0eac9c9
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/kAvEh--/HackerRank-Go/models

go 1.23.0
43 changes: 43 additions & 0 deletions models/users.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package models

type User struct {
ID int `json:"id"`
Username string `json:"username"`
Password string `json:"password"`
Name string `json:"name"`
}

type UserRepo interface {
Get(id int) (*User, error)
GetByUsername(username string) (*User, error)
Create(user *User) error
Update(user *User) error
Delete(id int) error
}

type userRepo struct {
}

func NewUserRepo() UserRepo {
return &userRepo{}
}

func (r *userRepo) Get(id int) (*User, error) {
return nil, nil
}

func (r *userRepo) GetByUsername(username string) (*User, error) {
return nil, nil
}

func (r *userRepo) Create(user *User) error {
return nil
}

func (r *userRepo) Update(user *User) error {
return nil
}

func (r *userRepo) Delete(id int) error {
return nil
}

0 comments on commit 0eac9c9

Please sign in to comment.