This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "github.com/docker/docker/pkg/archive" | |
// createBuildContext archive a dir and return an io.Reader | |
func createBuildContext(path string) (io.Reader, error) { | |
return archive.Tar(path, archive.Uncompressed) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SignUpRequest { | |
String firstName; | |
String lastName; | |
String pin; | |
List<Identifier> identifiers; | |
} | |
class Identifier { | |
String identifier; | |
String identifierType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func createBuildContext() (io.Reader, error) { | |
// get current working dir | |
wd, err := os.Getwd() | |
if err != nil { | |
return nil, err | |
} | |
// resolve Dockerfile path | |
path := filepath.join(wd, "Dockerfile") | |
return os.Open(path) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
events { | |
worker_connections 1024; | |
} | |
http { | |
server_tokens off; | |
server { | |
listen 80; | |
location /api/account { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this file is just a pseudo code of the whole idea | |
// we have 3 entities - Booking, User and Address(Origin and Destination) | |
// example userDao | |
class UserDao { | |
public User getUser(int id); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package utils | |
import ( | |
"encoding/json" | |
"net/http" | |
) | |
func Message(status bool, message string) (map[string]interface{}) { | |
return map[string]interface{} {"status" : status, "message" : message} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package controllers | |
import ( | |
"net/http" | |
"go-contacts/models" | |
"encoding/json" | |
u "go-contacts/utils" | |
"strconv" | |
"github.com/gorilla/mux" | |
"fmt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models | |
import ( | |
u "go-contacts/utils" | |
"github.com/jinzhu/gorm" | |
"fmt" | |
) | |
type Contact struct { | |
gorm.Model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package controllers | |
import ( | |
"net/http" | |
u "go-contacts/utils" | |
"go-contacts/models" | |
"encoding/json" | |
) | |
var CreateAccount = func(w http.ResponseWriter, r *http.Request) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models | |
import ( | |
"github.com/dgrijalva/jwt-go" | |
u "lens/utils" | |
"strings" | |
"github.com/jinzhu/gorm" | |
"os" | |
"golang.org/x/crypto/bcrypt" | |
) |