Skip to content

Commit

Permalink
feat: started bank api
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammed committed Oct 16, 2023
1 parent 4d4fdb6 commit 12ece32
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 0 deletions.
Empty file removed go-postgres/.gitkeep
Empty file.
8 changes: 8 additions & 0 deletions go-postgres/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build:
@go build -o bin/my-bank

run: build
@./bin/my-bank

test:
@go test -v ./...
43 changes: 43 additions & 0 deletions go-postgres/api.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package main

import (
"github.com/gorilla/mux"
"net/http"
)


type APIServer struct {
listenAddr string
}

func NewApiServer(listenAddr string) *APIServer {
return &APIServer{
listenAddr: listenAddr,
}
}

func (s *APIServer) Run() {
router := mux.NewRouter()

router.HandleFunc("/account", s.handleAccount)
}

func (s *APIServer) handleAccount(w http.ResponseWriter, r *http.Request) error {
return nil
}

func (s *APIServer) handleGetAccount(w http.ResponseWriter, r *http.Request) error {
return nil
}

func (s *APIServer) handleCreateAccount(w http.ResponseWriter, r *http.Request) error {
return nil
}

func (s *APIServer) handleDeleteAccount(w http.ResponseWriter, r *http.Request) error {
return nil
}

func (s *APIServer) handleTransfer(w http.ResponseWriter, r *http.Request) error {
return nil
}
Binary file added go-postgres/bin/my-bank
Binary file not shown.
5 changes: 5 additions & 0 deletions go-postgres/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/Molaryy/go-playground/go-postgres

go 1.18

require github.com/gorilla/mux v1.8.0 // indirect
2 changes: 2 additions & 0 deletions go-postgres/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
7 changes: 7 additions & 0 deletions go-postgres/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "fmt"

func main() {
fmt.Println("Sup")
}

0 comments on commit 12ece32

Please sign in to comment.