├── .gitignore ├── Acknowledgements.md ├── LICENSE ├── Readme.md ├── assets ├── V1goessentials.jpg ├── V1goessentials_thumb.jpg ├── V1goessentials_thumb.png ├── V2backendgo.png ├── V2backendgo_thumb.png ├── V3frontendgo.png ├── V3frontendgo_thumb.png ├── V4godeploy.png └── V4godeploy_thumb.png ├── gofullstack.go ├── volume1 ├── section1 │ └── hellogopher │ │ └── hellogopher.go ├── section2 │ ├── conditionals │ │ └── conditionals.go │ ├── declarenumerics │ │ └── declarenumerics.go │ ├── funwithfuncs │ │ └── funwithfuncs.go │ ├── greetingspackage │ │ ├── gophergreeting.go │ │ └── greetings.go │ ├── hellogopheralias │ │ └── hellogopheralias.go │ ├── lightswitch │ │ └── lightswitch.go │ ├── loopdemo │ │ └── loopdemo.go │ ├── olympicslaonwards │ │ └── olympicslaonwards.go │ ├── personalgreetings │ │ └── personalgreetings.go │ ├── repeatgreetings │ │ └── repeatgreetings.go │ ├── stringbasics │ │ └── stringbasics.go │ ├── switchdemo │ │ └── switchdemo.go │ ├── trafficlights │ │ └── trafficlights.go │ ├── usegreetings │ │ └── usegreetings.go │ └── usernamechecker │ │ └── usernamechecker.go ├── section3 │ ├── declarearrays │ │ └── declarearrays.go │ ├── emptyinterfacedemo │ │ └── emptyinterfacedemo.go │ ├── mapdemo │ │ └── mapdemo.go │ ├── matrix │ │ └── matrix.go │ ├── shapedemo │ │ └── shapedemo.go │ ├── simpleshape │ │ ├── rectangle.go │ │ ├── simpleshape.go │ │ └── triangle.go │ ├── slicedemo │ │ └── slicedemo.go │ ├── smpostexample │ │ └── smpostexample.go │ └── socialmedia │ │ ├── moodstate_string.go │ │ └── socialmedia.go ├── section4 │ ├── bufferedchannel │ │ └── bufferedchannel.go │ ├── channeldemo │ │ └── channeldemo.go │ ├── channelrange │ │ └── channelrange.go │ ├── goroutinesdemo │ │ └── goroutinesdemo.go │ ├── goroutinesdemowithchannel │ │ └── goroutinesdemowithchannel.go │ ├── goroutinewithdelay │ │ └── goroutinewithdelay.go │ ├── mutex │ │ └── mutex.go │ ├── nilakantha │ │ └── nilakantha.go │ ├── racedemo │ │ └── racedemo.go │ └── waitgroup │ │ └── waitgroup.go ├── section5 │ ├── funnybusiness │ │ └── funnybusiness.go │ ├── socialmedia │ │ ├── moodstate_string.go │ │ └── socialmedia.go │ └── validationkit │ │ ├── checkusername_test.go │ │ └── validationkit.go └── section6 │ ├── getrequest │ └── getrequest.go │ └── webserver │ └── webserver.go ├── volume2 ├── section1 │ ├── smptemplate │ │ ├── smptemplate.go │ │ ├── static │ │ │ ├── css │ │ │ │ └── gopherface.css │ │ │ └── images │ │ │ │ └── gogopher.png │ │ └── templates │ │ │ └── socialmediapost.html │ └── templatedemo │ │ ├── templatedemo.go │ │ └── templates │ │ └── greeting.html ├── section2 │ └── gopherface │ │ ├── endpoints │ │ ├── createpost.go │ │ ├── deletepost.go │ │ ├── fetchposts.go │ │ └── updatepost.go │ │ ├── gopherface.go │ │ ├── handlers │ │ ├── feed.go │ │ ├── find.go │ │ ├── foo.go │ │ ├── friends.go │ │ ├── home.go │ │ ├── login.go │ │ ├── logout.go │ │ ├── myprofile.go │ │ ├── panic.go │ │ ├── profile.go │ │ └── register.go │ │ ├── middleware │ │ ├── contextexample.go │ │ └── panicrecovery.go │ │ ├── models │ │ └── socialmedia │ │ │ ├── moodstate_string.go │ │ │ └── socialmedia.go │ │ └── templates │ │ └── index.html ├── section3 │ └── gopherfaceform │ │ ├── endpoints │ │ ├── createpost.go │ │ ├── deletepost.go │ │ ├── fetchposts.go │ │ └── updatepost.go │ │ ├── gopherface.go │ │ ├── handlers │ │ ├── feed.go │ │ ├── find.go │ │ ├── foo.go │ │ ├── friends.go │ │ ├── home.go │ │ ├── login.go │ │ ├── logout.go │ │ ├── myprofile.go │ │ ├── panic.go │ │ ├── postpreview.go │ │ ├── profile.go │ │ ├── register.go │ │ ├── signup.go │ │ ├── uploadimage.go │ │ ├── uploadvideo.go │ │ └── utility.go │ │ ├── middleware │ │ ├── contextexample.go │ │ └── panicrecovery.go │ │ ├── models │ │ └── socialmedia │ │ │ ├── moodstate_string.go │ │ │ └── socialmedia.go │ │ ├── static │ │ ├── css │ │ │ ├── gopherface.css │ │ │ └── pure.css │ │ ├── imageset │ │ │ ├── 0083d2f4a81588ed85c06679e68d9855754b498d.png │ │ │ ├── 142cb526f8d5602ec97b674804768d4eb9c1d8b3.png │ │ │ ├── 21ea6a171c98374b61ffceea7146da1ecaef14d9.png │ │ │ ├── 68e3075133cf704244c2b2a61d78fa9adabdf678.png │ │ │ ├── 85a586dc6db1483f6014819972e6d709a03e7801.png │ │ │ ├── 8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png │ │ │ ├── a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png │ │ │ ├── c1e4861d325e29731efd9e9abc760eacf3d9be8b.png │ │ │ └── c923378f14eba979d8e81db2fa8259f211af4870.png │ │ ├── uploads │ │ │ ├── images │ │ │ │ └── readme.txt │ │ │ └── videos │ │ │ │ └── readme.txt │ │ └── videoset │ │ │ └── 3DGopher.mp4 │ │ ├── templates │ │ ├── imagepreview.html │ │ ├── index.html │ │ ├── postform.html │ │ ├── signupconfirmation.html │ │ ├── signupform.html │ │ ├── socialmediapost.html │ │ ├── uploadimageform.html │ │ ├── uploadvideoform.html │ │ └── videopreview.html │ │ └── validationkit │ │ ├── checkusername_test.go │ │ └── validationkit.go ├── section4 │ └── gopherfaceform │ │ ├── endpoints │ │ ├── createpost.go │ │ ├── deletepost.go │ │ ├── fetchposts.go │ │ └── updatepost.go │ │ ├── gopherface.go │ │ ├── handlers │ │ ├── feed.go │ │ ├── find.go │ │ ├── foo.go │ │ ├── friends.go │ │ ├── home.go │ │ ├── login.go │ │ ├── logout.go │ │ ├── myprofile.go │ │ ├── panic.go │ │ ├── postpreview.go │ │ ├── profile.go │ │ ├── register.go │ │ ├── signup.go │ │ ├── uploadimage.go │ │ ├── uploadvideo.go │ │ └── utility.go │ │ ├── middleware │ │ ├── contextexample.go │ │ └── panicrecovery.go │ │ ├── models │ │ └── socialmedia │ │ │ ├── moodstate_string.go │ │ │ └── socialmedia.go │ │ ├── static │ │ ├── css │ │ │ ├── gopherface.css │ │ │ └── pure.css │ │ ├── imageset │ │ │ ├── 0083d2f4a81588ed85c06679e68d9855754b498d.png │ │ │ ├── 142cb526f8d5602ec97b674804768d4eb9c1d8b3.png │ │ │ ├── 21ea6a171c98374b61ffceea7146da1ecaef14d9.png │ │ │ ├── 68e3075133cf704244c2b2a61d78fa9adabdf678.png │ │ │ ├── 85a586dc6db1483f6014819972e6d709a03e7801.png │ │ │ ├── 8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png │ │ │ ├── a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png │ │ │ ├── c1e4861d325e29731efd9e9abc760eacf3d9be8b.png │ │ │ └── c923378f14eba979d8e81db2fa8259f211af4870.png │ │ ├── uploads │ │ │ ├── images │ │ │ │ └── readme.txt │ │ │ └── videos │ │ │ │ └── readme.txt │ │ └── videoset │ │ │ └── 3DGopher.mp4 │ │ ├── templates │ │ ├── imagepreview.html │ │ ├── index.html │ │ ├── postform.html │ │ ├── signupconfirmation.html │ │ ├── signupform.html │ │ ├── socialmediapost.html │ │ ├── uploadimageform.html │ │ ├── uploadvideoform.html │ │ └── videopreview.html │ │ └── validationkit │ │ ├── checkusername_test.go │ │ └── validationkit.go ├── section5 │ └── gopherfacedb │ │ ├── common │ │ ├── common.go │ │ ├── datastore │ │ │ ├── datastore.go │ │ │ ├── mongodb.go │ │ │ ├── mysql.go │ │ │ └── redis.go │ │ └── utility │ │ │ ├── sha256.go │ │ │ └── uuid.go │ │ ├── config │ │ └── gopherfacedb.sql │ │ ├── endpoints │ │ ├── createpost.go │ │ ├── deletepost.go │ │ ├── fetchposts.go │ │ └── updatepost.go │ │ ├── gopherface.go │ │ ├── handlers │ │ ├── feed.go │ │ ├── find.go │ │ ├── foo.go │ │ ├── friends.go │ │ ├── home.go │ │ ├── login.go │ │ ├── logout.go │ │ ├── myprofile.go │ │ ├── panic.go │ │ ├── postpreview.go │ │ ├── profile.go │ │ ├── register.go │ │ ├── signup.go │ │ ├── uploadimage.go │ │ ├── uploadvideo.go │ │ └── utility.go │ │ ├── middleware │ │ ├── contextexample.go │ │ └── panicrecovery.go │ │ ├── models │ │ ├── socialmedia │ │ │ ├── moodstate_string.go │ │ │ └── socialmedia.go │ │ └── user.go │ │ ├── static │ │ ├── css │ │ │ ├── gopherface.css │ │ │ └── pure.css │ │ ├── imageset │ │ │ ├── 0083d2f4a81588ed85c06679e68d9855754b498d.png │ │ │ ├── 142cb526f8d5602ec97b674804768d4eb9c1d8b3.png │ │ │ ├── 21ea6a171c98374b61ffceea7146da1ecaef14d9.png │ │ │ ├── 68e3075133cf704244c2b2a61d78fa9adabdf678.png │ │ │ ├── 85a586dc6db1483f6014819972e6d709a03e7801.png │ │ │ ├── 8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png │ │ │ ├── a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png │ │ │ ├── c1e4861d325e29731efd9e9abc760eacf3d9be8b.png │ │ │ └── c923378f14eba979d8e81db2fa8259f211af4870.png │ │ ├── uploads │ │ │ ├── images │ │ │ │ └── readme.txt │ │ │ └── videos │ │ │ │ └── readme.txt │ │ └── videoset │ │ │ └── 3DGopher.mp4 │ │ ├── templates │ │ ├── imagepreview.html │ │ ├── index.html │ │ ├── postform.html │ │ ├── signupconfirmation.html │ │ ├── signupform.html │ │ ├── socialmediapost.html │ │ ├── uploadimageform.html │ │ ├── uploadvideoform.html │ │ └── videopreview.html │ │ └── validationkit │ │ ├── checkusername_test.go │ │ └── validationkit.go ├── section6 │ └── gopherfaceauth │ │ ├── certs │ │ ├── gopherfacecert.pem │ │ └── gopherfacekey.pem │ │ ├── common │ │ ├── asyncq │ │ │ ├── asyncq.go │ │ │ └── task.go │ │ ├── authenticate │ │ │ ├── authenticate.go │ │ │ ├── cookie.go │ │ │ └── session.go │ │ ├── common.go │ │ ├── datastore │ │ │ ├── datastore.go │ │ │ ├── mongodb.go │ │ │ ├── mysql.go │ │ │ └── redis.go │ │ └── utility │ │ │ ├── sha256.go │ │ │ └── uuid.go │ │ ├── config │ │ └── gopherfacedb.sql │ │ ├── endpoints │ │ ├── createpost.go │ │ ├── deletepost.go │ │ ├── fetchposts.go │ │ └── updatepost.go │ │ ├── gopherface.go │ │ ├── handlers │ │ ├── feed.go │ │ ├── find.go │ │ ├── foo.go │ │ ├── friends.go │ │ ├── home.go │ │ ├── login.go │ │ ├── logout.go │ │ ├── myprofile.go │ │ ├── panic.go │ │ ├── postpreview.go │ │ ├── profile.go │ │ ├── register.go │ │ ├── signup.go │ │ ├── uploadimage.go │ │ ├── uploadvideo.go │ │ └── utility.go │ │ ├── middleware │ │ ├── contextexample.go │ │ ├── gated.go │ │ └── panicrecovery.go │ │ ├── models │ │ ├── socialmedia │ │ │ ├── moodstate_string.go │ │ │ └── socialmedia.go │ │ └── user.go │ │ ├── static │ │ ├── css │ │ │ ├── gopherface.css │ │ │ └── pure.css │ │ ├── imageset │ │ │ ├── 0083d2f4a81588ed85c06679e68d9855754b498d.png │ │ │ ├── 142cb526f8d5602ec97b674804768d4eb9c1d8b3.png │ │ │ ├── 21ea6a171c98374b61ffceea7146da1ecaef14d9.png │ │ │ ├── 68e3075133cf704244c2b2a61d78fa9adabdf678.png │ │ │ ├── 85a586dc6db1483f6014819972e6d709a03e7801.png │ │ │ ├── 8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png │ │ │ ├── a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png │ │ │ ├── c1e4861d325e29731efd9e9abc760eacf3d9be8b.png │ │ │ └── c923378f14eba979d8e81db2fa8259f211af4870.png │ │ ├── uploads │ │ │ ├── images │ │ │ │ └── readme.txt │ │ │ └── videos │ │ │ │ └── readme.txt │ │ └── videoset │ │ │ └── 3DGopher.mp4 │ │ ├── tasks │ │ └── imagetask.go │ │ ├── templates │ │ ├── feed.html │ │ ├── footer.html │ │ ├── friends.html │ │ ├── gatedheader.html │ │ ├── header.html │ │ ├── imagepreview.html │ │ ├── index.html │ │ ├── loginform.html │ │ ├── postform.html │ │ ├── profile.html │ │ ├── signupconfirmation.html │ │ ├── signupform.html │ │ ├── socialmediapost.html │ │ ├── uploadimageform.html │ │ ├── uploadvideoform.html │ │ └── videopreview.html │ │ └── validationkit │ │ ├── checkusername_test.go │ │ └── validationkit.go └── section7 │ └── gopherfaceq │ ├── certs │ ├── gopherfacecert.pem │ └── gopherfacekey.pem │ ├── common │ ├── asyncq │ │ ├── asyncq.go │ │ └── task.go │ ├── authenticate │ │ ├── authenticate.go │ │ ├── cookie.go │ │ └── session.go │ ├── common.go │ ├── datastore │ │ ├── datastore.go │ │ ├── mongodb.go │ │ ├── mysql.go │ │ └── redis.go │ └── utility │ │ ├── sha256.go │ │ └── uuid.go │ ├── config │ └── gopherfacedb.sql │ ├── endpoints │ ├── createpost.go │ ├── deletepost.go │ ├── fetchposts.go │ └── updatepost.go │ ├── gopherface.go │ ├── handlers │ ├── feed.go │ ├── find.go │ ├── foo.go │ ├── friends.go │ ├── home.go │ ├── login.go │ ├── logout.go │ ├── myprofile.go │ ├── panic.go │ ├── postpreview.go │ ├── profile.go │ ├── register.go │ ├── signup.go │ ├── uploadimage.go │ ├── uploadvideo.go │ └── utility.go │ ├── middleware │ ├── contextexample.go │ ├── gated.go │ └── panicrecovery.go │ ├── models │ ├── socialmedia │ │ ├── moodstate_string.go │ │ └── socialmedia.go │ └── user.go │ ├── static │ ├── css │ │ ├── gopherface.css │ │ └── pure.css │ ├── imageset │ │ ├── 0083d2f4a81588ed85c06679e68d9855754b498d.png │ │ ├── 142cb526f8d5602ec97b674804768d4eb9c1d8b3.png │ │ ├── 21ea6a171c98374b61ffceea7146da1ecaef14d9.png │ │ ├── 68e3075133cf704244c2b2a61d78fa9adabdf678.png │ │ ├── 85a586dc6db1483f6014819972e6d709a03e7801.png │ │ ├── 8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png │ │ ├── a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png │ │ ├── c1e4861d325e29731efd9e9abc760eacf3d9be8b.png │ │ └── c923378f14eba979d8e81db2fa8259f211af4870.png │ ├── uploads │ │ ├── images │ │ │ └── readme.txt │ │ └── videos │ │ │ └── readme.txt │ └── videoset │ │ └── 3DGopher.mp4 │ ├── tasks │ └── imagetask.go │ ├── templates │ ├── feed.html │ ├── footer.html │ ├── friends.html │ ├── gatedheader.html │ ├── header.html │ ├── imagepreview.html │ ├── index.html │ ├── loginform.html │ ├── postform.html │ ├── profile.html │ ├── signupconfirmation.html │ ├── signupform.html │ ├── socialmediapost.html │ ├── uploadimageform.html │ ├── uploadvideoform.html │ └── videopreview.html │ └── validationkit │ ├── checkusername_test.go │ └── validationkit.go ├── volume3 ├── section1 │ ├── basics │ │ ├── basics.go │ │ ├── client │ │ │ ├── alertmsg.go │ │ │ ├── builtindemo.go │ │ │ ├── client.go │ │ │ ├── cssexample.go │ │ │ └── xhrpost.go │ │ ├── static │ │ │ ├── css │ │ │ │ ├── pure-min.css │ │ │ │ └── style.css │ │ │ ├── images │ │ │ │ ├── isomorphic_go_icon.png │ │ │ │ └── isomorphic_go_logo.png │ │ │ └── js │ │ │ │ └── .gitkeep │ │ └── templates │ │ │ └── basics.html │ └── intermediate │ │ ├── cars │ │ └── cars.go │ │ ├── gwsc │ │ └── gwsc.go │ │ ├── model │ │ └── car.go │ │ ├── server.go │ │ ├── static │ │ ├── cars.html │ │ └── websocketclient.html │ │ └── websocketclient │ │ └── websocketclient.go ├── section2 │ └── 3dgopher │ │ ├── 3dgopherfinal │ │ └── 3dgopherfinal.go │ │ ├── 3dgopherresize │ │ └── 3dgopherresize.go │ │ ├── 3dgopherscene │ │ └── 3dgopherscene.go │ │ ├── server.go │ │ └── static │ │ ├── 3dgopherfinal.html │ │ ├── 3dgopherresize.html │ │ ├── 3dgopherscene.html │ │ ├── js │ │ ├── .gitkeep │ │ ├── OBJLoader.js │ │ └── three.js │ │ └── obj │ │ └── gogopher.obj ├── section3 │ ├── client │ │ └── localstorage.go │ ├── server.go │ └── static │ │ ├── css │ │ ├── pure-min.css │ │ └── style.css │ │ ├── index.html │ │ └── js │ │ └── .gitkeep ├── section4 │ └── gopherface │ │ ├── certs │ │ ├── gopherfacecert.pem │ │ └── gopherfacekey.pem │ │ ├── client │ │ ├── client.go │ │ ├── common │ │ │ └── common.go │ │ └── handlers │ │ │ ├── feed.go │ │ │ ├── friends.go │ │ │ ├── myprofile.go │ │ │ └── profile.go │ │ ├── common │ │ ├── asyncq │ │ │ ├── asyncq.go │ │ │ └── task.go │ │ ├── authenticate │ │ │ ├── authenticate.go │ │ │ ├── cookie.go │ │ │ └── session.go │ │ ├── common.go │ │ ├── datastore │ │ │ ├── datastore.go │ │ │ ├── mongodb.go │ │ │ ├── mysql.go │ │ │ └── redis.go │ │ └── utility │ │ │ ├── sha256.go │ │ │ └── uuid.go │ │ ├── config │ │ └── gopherfacedb.sql │ │ ├── endpoints │ │ ├── createpost.go │ │ ├── deletepost.go │ │ ├── fetchposts.go │ │ └── updatepost.go │ │ ├── gopherface │ │ ├── gopherface.go │ │ ├── handlers │ │ ├── feed.go │ │ ├── find.go │ │ ├── foo.go │ │ ├── friends.go │ │ ├── handlers.go │ │ ├── home.go │ │ ├── login.go │ │ ├── logout.go │ │ ├── myprofile.go │ │ ├── panic.go │ │ ├── postpreview.go │ │ ├── profile.go │ │ ├── register.go │ │ ├── signup.go │ │ ├── templatebundle.go │ │ ├── uploadimage.go │ │ ├── uploadvideo.go │ │ └── utility.go │ │ ├── middleware │ │ ├── contextexample.go │ │ ├── gated.go │ │ └── panicrecovery.go │ │ ├── models │ │ ├── socialmedia │ │ │ ├── moodstate_string.go │ │ │ └── socialmedia.go │ │ └── user.go │ │ ├── static │ │ ├── css │ │ │ ├── gopherface.css │ │ │ └── pure.css │ │ ├── imageset │ │ │ ├── 0083d2f4a81588ed85c06679e68d9855754b498d.png │ │ │ ├── 142cb526f8d5602ec97b674804768d4eb9c1d8b3.png │ │ │ ├── 21ea6a171c98374b61ffceea7146da1ecaef14d9.png │ │ │ ├── 68e3075133cf704244c2b2a61d78fa9adabdf678.png │ │ │ ├── 85a586dc6db1483f6014819972e6d709a03e7801.png │ │ │ ├── 8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png │ │ │ ├── a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png │ │ │ ├── c1e4861d325e29731efd9e9abc760eacf3d9be8b.png │ │ │ └── c923378f14eba979d8e81db2fa8259f211af4870.png │ │ ├── js │ │ │ └── .gitkeep │ │ ├── uploads │ │ │ ├── images │ │ │ │ └── readme.txt │ │ │ └── videos │ │ │ │ └── readme.txt │ │ └── videoset │ │ │ └── 3DGopher.mp4 │ │ ├── tasks │ │ └── imagetask.go │ │ ├── templates │ │ ├── feed_content.html │ │ ├── feed_page.html │ │ ├── footer.html │ │ ├── friends_content.html │ │ ├── friends_page.html │ │ ├── gatedheader.html │ │ ├── header.html │ │ ├── imagepreview.html │ │ ├── index.html │ │ ├── loginform.html │ │ ├── postform.html │ │ ├── profile_content.html │ │ ├── profile_page.html │ │ ├── signupconfirmation.html │ │ ├── signupform.html │ │ ├── socialmediapost.html │ │ ├── uploadimageform.html │ │ ├── uploadvideoform.html │ │ ├── videopreview.html │ │ └── webpage.html │ │ └── validationkit │ │ ├── checkusername_test.go │ │ └── validationkit.go └── section5 │ └── gopherface │ ├── certs │ ├── gopherfacecert.pem │ └── gopherfacekey.pem │ ├── client │ ├── client.go │ ├── common │ │ └── common.go │ └── handlers │ │ ├── feed.go │ │ ├── friends.go │ │ ├── handlers.go │ │ └── myprofile.go │ ├── common │ ├── asyncq │ │ ├── asyncq.go │ │ └── task.go │ ├── authenticate │ │ ├── authenticate.go │ │ ├── cookie.go │ │ └── session.go │ ├── common.go │ ├── datastore │ │ ├── datastore.go │ │ ├── mongodb.go │ │ ├── mysql.go │ │ └── redis.go │ └── utility │ │ ├── sha256.go │ │ └── uuid.go │ ├── config │ ├── gfdbdump.sql │ └── gopherfacedb.sql │ ├── endpoints │ ├── endpoints.go │ ├── fetchposts.go │ ├── findgophers.go │ ├── followgopher.go │ ├── friendslist.go │ ├── getgopherprofile.go │ ├── getuserprofile.go │ ├── savepost.go │ ├── saveuserprofile.go │ ├── saveuserprofileimage.go │ └── unfollowgopher.go │ ├── forms │ ├── myprofile.go │ └── smpost.go │ ├── gopherface.go │ ├── handlers │ ├── feed.go │ ├── find.go │ ├── foo.go │ ├── friends.go │ ├── handlers.go │ ├── home.go │ ├── login.go │ ├── logout.go │ ├── myprofile.go │ ├── panic.go │ ├── postpreview.go │ ├── profile.go │ ├── register.go │ ├── signup.go │ ├── templatebundle.go │ ├── uploadimage.go │ ├── uploadvideo.go │ └── utility.go │ ├── middleware │ ├── contextexample.go │ ├── gated.go │ └── panicrecovery.go │ ├── models │ ├── gopher.go │ ├── socialmedia │ │ ├── moodstate_string.go │ │ └── socialmedia.go │ ├── user.go │ └── userprofile.go │ ├── static │ ├── css │ │ ├── alertify.core.css │ │ ├── alertify.default.css │ │ ├── gopherface.css │ │ └── pure.css │ ├── images │ │ ├── .gitkeep │ │ └── gogopher.png │ ├── imageset │ │ ├── 3DGopher_blue.png │ │ ├── 3DGopher_green.png │ │ ├── 3DGopher_red.png │ │ ├── 3DGopher_yellow.png │ │ ├── Aerol.png │ │ ├── Case.png │ │ ├── Flatline.png │ │ ├── Jane.png │ │ ├── Linda.png │ │ ├── Marie.png │ │ ├── Molly.png │ │ ├── Riviera.png │ │ └── Wintermute.png │ ├── js │ │ ├── .gitkeep │ │ └── alertify.js │ ├── uploads │ │ ├── images │ │ │ ├── 0ef62347-cead-bfbf-6d23-7cdd84f8b080.png │ │ │ ├── 0ef62347-cead-bfbf-6d23-7cdd84f8b080_thumb.png │ │ │ ├── 2c2ef747-38b9-9968-8215-ce28099a8b63.png │ │ │ ├── 2c2ef747-38b9-9968-8215-ce28099a8b63_thumb.png │ │ │ ├── 38a52ac9-7704-60e7-b690-abfec7309162.png │ │ │ ├── 38a52ac9-7704-60e7-b690-abfec7309162_thumb.png │ │ │ ├── 3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6.png │ │ │ ├── 3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6_thumb.png │ │ │ ├── 5a4cd16c-93f1-5bff-cefb-5173e6d8f941.png │ │ │ ├── 5a4cd16c-93f1-5bff-cefb-5173e6d8f941_thumb.png │ │ │ ├── 605f6d17-d3f2-9090-ada7-27e72d1ebf72.png │ │ │ ├── 605f6d17-d3f2-9090-ada7-27e72d1ebf72_thumb.png │ │ │ ├── 6f3196b0-ccdc-c335-3984-f1e6b206e6a1.png │ │ │ ├── 6f3196b0-ccdc-c335-3984-f1e6b206e6a1_thumb.png │ │ │ ├── 8440908b-d565-e3ec-a16c-0b3560c806a2.png │ │ │ ├── 8440908b-d565-e3ec-a16c-0b3560c806a2_thumb.png │ │ │ ├── b2dcbd58-9489-132e-b393-9965aa40d146.png │ │ │ ├── b2dcbd58-9489-132e-b393-9965aa40d146_thumb.png │ │ │ ├── c868ac58-d7b6-f0b4-93f1-4d7249f55226.png │ │ │ ├── c868ac58-d7b6-f0b4-93f1-4d7249f55226_thumb.png │ │ │ ├── f79db6c9-3189-20c0-f0fc-bbe5e5f57335.png │ │ │ ├── f79db6c9-3189-20c0-f0fc-bbe5e5f57335_thumb.png │ │ │ └── readme.txt │ │ └── videos │ │ │ └── readme.txt │ └── videoset │ │ └── 3DGopher.mp4 │ ├── tasks │ └── imagetask.go │ ├── templates │ ├── feed_content.html │ ├── feed_page.html │ ├── footer.html │ ├── friends_content.html │ ├── friends_page.html │ ├── gatedheader.html │ ├── gopherprofile_content.html │ ├── gopherprofile_page.html │ ├── header.html │ ├── imagepreview.html │ ├── index.html │ ├── loginform.html │ ├── myprofile_content.html │ ├── myprofile_page.html │ ├── partials │ │ ├── feed_posts.html │ │ ├── friend_search_results.html │ │ └── friends_list.html │ ├── postform.html │ ├── signupconfirmation.html │ ├── signupform.html │ ├── socialmediapost.html │ ├── uploadimageform.html │ ├── uploadvideoform.html │ ├── videopreview.html │ └── webpage.html │ └── validationkit │ ├── checkusername_test.go │ └── validationkit.go └── volume4 ├── section1 └── config │ ├── gfdbdump.sql │ ├── iptables.conf │ ├── iptables.service │ └── nginx.conf ├── section2 └── gopherface │ ├── certs │ ├── gopherfacecert.pem │ └── gopherfacekey.pem │ ├── client │ ├── client.go │ ├── common │ │ └── common.go │ └── handlers │ │ ├── feed.go │ │ ├── friends.go │ │ ├── handlers.go │ │ └── myprofile.go │ ├── common │ ├── asyncq │ │ ├── asyncq.go │ │ └── task.go │ ├── authenticate │ │ ├── authenticate.go │ │ ├── cookie.go │ │ └── session.go │ ├── common.go │ ├── datastore │ │ ├── datastore.go │ │ ├── mongodb.go │ │ ├── mysql.go │ │ └── redis.go │ └── utility │ │ ├── sha256.go │ │ └── uuid.go │ ├── config │ ├── gfdbdump.sql │ ├── gopherface.service │ ├── gopherfacedb.sql │ └── nginx.conf │ ├── endpoints │ ├── endpoints.go │ ├── fetchposts.go │ ├── findgophers.go │ ├── followgopher.go │ ├── friendslist.go │ ├── getgopherprofile.go │ ├── getuserprofile.go │ ├── savepost.go │ ├── saveuserprofile.go │ ├── saveuserprofileimage.go │ └── unfollowgopher.go │ ├── forms │ ├── myprofile.go │ └── smpost.go │ ├── gopherface.go │ ├── handlers │ ├── feed.go │ ├── find.go │ ├── foo.go │ ├── friends.go │ ├── handlers.go │ ├── home.go │ ├── login.go │ ├── logout.go │ ├── myprofile.go │ ├── panic.go │ ├── postpreview.go │ ├── profile.go │ ├── register.go │ ├── signup.go │ ├── templatebundle.go │ ├── uploadimage.go │ ├── uploadvideo.go │ └── utility.go │ ├── middleware │ ├── contextexample.go │ ├── gated.go │ └── panicrecovery.go │ ├── models │ ├── gopher.go │ ├── socialmedia │ │ ├── moodstate_string.go │ │ └── socialmedia.go │ ├── user.go │ └── userprofile.go │ ├── static │ ├── css │ │ ├── alertify.core.css │ │ ├── alertify.default.css │ │ ├── gopherface.css │ │ └── pure.css │ ├── images │ │ ├── .gitkeep │ │ └── gogopher.png │ ├── imageset │ │ ├── 3DGopher_blue.png │ │ ├── 3DGopher_green.png │ │ ├── 3DGopher_red.png │ │ ├── 3DGopher_yellow.png │ │ ├── Aerol.png │ │ ├── Case.png │ │ ├── Flatline.png │ │ ├── Jane.png │ │ ├── Linda.png │ │ ├── Marie.png │ │ ├── Molly.png │ │ ├── Riviera.png │ │ └── Wintermute.png │ ├── js │ │ ├── .gitkeep │ │ └── alertify.js │ ├── uploads │ │ ├── images │ │ │ ├── 0ef62347-cead-bfbf-6d23-7cdd84f8b080.png │ │ │ ├── 0ef62347-cead-bfbf-6d23-7cdd84f8b080_thumb.png │ │ │ ├── 2c2ef747-38b9-9968-8215-ce28099a8b63.png │ │ │ ├── 2c2ef747-38b9-9968-8215-ce28099a8b63_thumb.png │ │ │ ├── 38a52ac9-7704-60e7-b690-abfec7309162.png │ │ │ ├── 38a52ac9-7704-60e7-b690-abfec7309162_thumb.png │ │ │ ├── 3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6.png │ │ │ ├── 3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6_thumb.png │ │ │ ├── 5a4cd16c-93f1-5bff-cefb-5173e6d8f941.png │ │ │ ├── 5a4cd16c-93f1-5bff-cefb-5173e6d8f941_thumb.png │ │ │ ├── 605f6d17-d3f2-9090-ada7-27e72d1ebf72.png │ │ │ ├── 605f6d17-d3f2-9090-ada7-27e72d1ebf72_thumb.png │ │ │ ├── 6f3196b0-ccdc-c335-3984-f1e6b206e6a1.png │ │ │ ├── 6f3196b0-ccdc-c335-3984-f1e6b206e6a1_thumb.png │ │ │ ├── 8440908b-d565-e3ec-a16c-0b3560c806a2.png │ │ │ ├── 8440908b-d565-e3ec-a16c-0b3560c806a2_thumb.png │ │ │ ├── b2dcbd58-9489-132e-b393-9965aa40d146.png │ │ │ ├── b2dcbd58-9489-132e-b393-9965aa40d146_thumb.png │ │ │ ├── c3265e18-bf0c-fcd4-8581-d688c289e773.png │ │ │ ├── c3265e18-bf0c-fcd4-8581-d688c289e773_thumb.png │ │ │ ├── c868ac58-d7b6-f0b4-93f1-4d7249f55226.png │ │ │ ├── c868ac58-d7b6-f0b4-93f1-4d7249f55226_thumb.png │ │ │ ├── f79db6c9-3189-20c0-f0fc-bbe5e5f57335.png │ │ │ ├── f79db6c9-3189-20c0-f0fc-bbe5e5f57335_thumb.png │ │ │ └── readme.txt │ │ └── videos │ │ │ └── readme.txt │ └── videoset │ │ └── 3DGopher.mp4 │ ├── tasks │ └── imagetask.go │ ├── templates │ ├── feed_content.html │ ├── feed_page.html │ ├── footer.html │ ├── friends_content.html │ ├── friends_page.html │ ├── gatedheader.html │ ├── gopherprofile_content.html │ ├── gopherprofile_page.html │ ├── header.html │ ├── imagepreview.html │ ├── index.html │ ├── loginform.html │ ├── myprofile_content.html │ ├── myprofile_page.html │ ├── partials │ │ ├── feed_posts.html │ │ ├── friend_search_results.html │ │ └── friends_list.html │ ├── postform.html │ ├── signupconfirmation.html │ ├── signupform.html │ ├── socialmediapost.html │ ├── uploadimageform.html │ ├── uploadvideoform.html │ ├── videopreview.html │ └── webpage.html │ └── validationkit │ ├── checkusername_test.go │ └── validationkit.go └── section3 └── gopherface ├── Dockerfile ├── certs ├── gopherfacecert.pem └── gopherfacekey.pem ├── client ├── client.go ├── common │ └── common.go └── handlers │ ├── feed.go │ ├── friends.go │ ├── handlers.go │ └── myprofile.go ├── common ├── asyncq │ ├── asyncq.go │ └── task.go ├── authenticate │ ├── authenticate.go │ ├── cookie.go │ └── session.go ├── common.go ├── datastore │ ├── datastore.go │ ├── mongodb.go │ ├── mysql.go │ └── redis.go └── utility │ ├── sha256.go │ └── uuid.go ├── config ├── gfdbdump.sql ├── gopherface-docker.service ├── gopherfacedb.sql └── nginx.conf ├── docker-compose.yml ├── endpoints ├── endpoints.go ├── fetchposts.go ├── findgophers.go ├── followgopher.go ├── friendslist.go ├── getgopherprofile.go ├── getuserprofile.go ├── savepost.go ├── saveuserprofile.go ├── saveuserprofileimage.go └── unfollowgopher.go ├── forms ├── myprofile.go └── smpost.go ├── gopherface.go ├── handlers ├── feed.go ├── find.go ├── foo.go ├── friends.go ├── handlers.go ├── home.go ├── login.go ├── logout.go ├── myprofile.go ├── panic.go ├── postpreview.go ├── profile.go ├── register.go ├── signup.go ├── templatebundle.go ├── uploadimage.go ├── uploadvideo.go └── utility.go ├── middleware ├── contextexample.go ├── gated.go └── panicrecovery.go ├── models ├── gopher.go ├── socialmedia │ ├── moodstate_string.go │ └── socialmedia.go ├── user.go └── userprofile.go ├── static ├── css │ ├── alertify.core.css │ ├── alertify.default.css │ ├── gopherface.css │ └── pure.css ├── images │ ├── .gitkeep │ └── gogopher.png ├── imageset │ ├── 3DGopher_blue.png │ ├── 3DGopher_green.png │ ├── 3DGopher_red.png │ ├── 3DGopher_yellow.png │ ├── Aerol.png │ ├── Case.png │ ├── Flatline.png │ ├── Jane.png │ ├── Linda.png │ ├── Marie.png │ ├── Molly.png │ ├── Riviera.png │ └── Wintermute.png ├── js │ ├── .gitkeep │ └── alertify.js ├── uploads │ ├── images │ │ ├── 0ef62347-cead-bfbf-6d23-7cdd84f8b080.png │ │ ├── 0ef62347-cead-bfbf-6d23-7cdd84f8b080_thumb.png │ │ ├── 2c2ef747-38b9-9968-8215-ce28099a8b63.png │ │ ├── 2c2ef747-38b9-9968-8215-ce28099a8b63_thumb.png │ │ ├── 38a52ac9-7704-60e7-b690-abfec7309162.png │ │ ├── 38a52ac9-7704-60e7-b690-abfec7309162_thumb.png │ │ ├── 3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6.png │ │ ├── 3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6_thumb.png │ │ ├── 5a4cd16c-93f1-5bff-cefb-5173e6d8f941.png │ │ ├── 5a4cd16c-93f1-5bff-cefb-5173e6d8f941_thumb.png │ │ ├── 605f6d17-d3f2-9090-ada7-27e72d1ebf72.png │ │ ├── 605f6d17-d3f2-9090-ada7-27e72d1ebf72_thumb.png │ │ ├── 6f3196b0-ccdc-c335-3984-f1e6b206e6a1.png │ │ ├── 6f3196b0-ccdc-c335-3984-f1e6b206e6a1_thumb.png │ │ ├── 8440908b-d565-e3ec-a16c-0b3560c806a2.png │ │ ├── 8440908b-d565-e3ec-a16c-0b3560c806a2_thumb.png │ │ ├── b2dcbd58-9489-132e-b393-9965aa40d146.png │ │ ├── b2dcbd58-9489-132e-b393-9965aa40d146_thumb.png │ │ ├── c3265e18-bf0c-fcd4-8581-d688c289e773.png │ │ ├── c3265e18-bf0c-fcd4-8581-d688c289e773_thumb.png │ │ ├── c868ac58-d7b6-f0b4-93f1-4d7249f55226.png │ │ ├── c868ac58-d7b6-f0b4-93f1-4d7249f55226_thumb.png │ │ ├── f79db6c9-3189-20c0-f0fc-bbe5e5f57335.png │ │ ├── f79db6c9-3189-20c0-f0fc-bbe5e5f57335_thumb.png │ │ └── readme.txt │ └── videos │ │ └── readme.txt └── videoset │ └── 3DGopher.mp4 ├── tasks └── imagetask.go ├── templates ├── feed_content.html ├── feed_page.html ├── footer.html ├── friends_content.html ├── friends_page.html ├── gatedheader.html ├── gopherprofile_content.html ├── gopherprofile_page.html ├── header.html ├── imagepreview.html ├── index.html ├── loginform.html ├── myprofile_content.html ├── myprofile_page.html ├── partials │ ├── feed_posts.html │ ├── friend_search_results.html │ └── friends_list.html ├── postform.html ├── signupconfirmation.html ├── signupform.html ├── socialmediapost.html ├── uploadimageform.html ├── uploadvideoform.html ├── videopreview.html └── webpage.html └── validationkit ├── checkusername_test.go └── validationkit.go /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.swp 3 | *.swo 4 | *.tmp 5 | *.out 6 | .DS_Store 7 | *.js 8 | *.js.map 9 | -------------------------------------------------------------------------------- /assets/V1goessentials.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/assets/V1goessentials.jpg -------------------------------------------------------------------------------- /assets/V1goessentials_thumb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/assets/V1goessentials_thumb.jpg -------------------------------------------------------------------------------- /assets/V1goessentials_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/assets/V1goessentials_thumb.png -------------------------------------------------------------------------------- /assets/V2backendgo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/assets/V2backendgo.png -------------------------------------------------------------------------------- /assets/V2backendgo_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/assets/V2backendgo_thumb.png -------------------------------------------------------------------------------- /assets/V3frontendgo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/assets/V3frontendgo.png -------------------------------------------------------------------------------- /assets/V3frontendgo_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/assets/V3frontendgo_thumb.png -------------------------------------------------------------------------------- /assets/V4godeploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/assets/V4godeploy.png -------------------------------------------------------------------------------- /assets/V4godeploy_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/assets/V4godeploy_thumb.png -------------------------------------------------------------------------------- /gofullstack.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | fmt.Println("Welcome to the gofullstack repository.") 7 | } 8 | -------------------------------------------------------------------------------- /volume1/section1/hellogopher/hellogopher.go: -------------------------------------------------------------------------------- 1 | // A basic Hello Gopher program. 2 | package main 3 | 4 | import "fmt" 5 | 6 | func main() { 7 | 8 | fmt.Println("Hello Gopher!") 9 | 10 | } 11 | -------------------------------------------------------------------------------- /volume1/section2/greetingspackage/gophergreeting.go: -------------------------------------------------------------------------------- 1 | package greetingspackage 2 | 3 | import "fmt" 4 | 5 | var MagicNumber int 6 | 7 | // This is an exported function and can be called outside the package 8 | func GopherGreetings() { 9 | 10 | fmt.Println("A very jolly hello my fellow gophers! I'm printing from the GopherGreetings() function") 11 | // Now we're calling an unexported package, because this function 12 | // is within the same package, we have access to call it 13 | printGreetingsUnexported() 14 | 15 | } 16 | 17 | // Example of a Packages init() function 18 | func init() { 19 | 20 | MagicNumber = 108 21 | 22 | } 23 | -------------------------------------------------------------------------------- /volume1/section2/hellogopheralias/hellogopheralias.go: -------------------------------------------------------------------------------- 1 | // An example of aliasing the fmt package as f. 2 | package main 3 | 4 | import f "fmt" 5 | 6 | func main() { 7 | 8 | f.Println("Hello Gopher!") 9 | 10 | } 11 | -------------------------------------------------------------------------------- /volume1/section2/lightswitch/lightswitch.go: -------------------------------------------------------------------------------- 1 | // An example to model a light switch using a boolean type. 2 | package main 3 | 4 | import "fmt" 5 | 6 | var lightSwitchIsOn bool = false 7 | 8 | func main() { 9 | 10 | printLightSwitchState() 11 | toggleLightSwitch() 12 | printLightSwitchState() 13 | toggleLightSwitch() 14 | printLightSwitchState() 15 | 16 | } 17 | 18 | func printLightSwitchState() { 19 | fmt.Println("The light switch is off:", lightSwitchIsOn) 20 | 21 | } 22 | 23 | func toggleLightSwitch() { 24 | 25 | lightSwitchIsOn = !lightSwitchIsOn 26 | 27 | } 28 | -------------------------------------------------------------------------------- /volume1/section2/personalgreetings/personalgreetings.go: -------------------------------------------------------------------------------- 1 | // An example of using a command line flag. 2 | package main 3 | 4 | import ( 5 | "flag" 6 | "fmt" 7 | ) 8 | 9 | func main() { 10 | 11 | var gopherName string 12 | flag.StringVar(&gopherName, "gophername", "Gopher", "The name of the Gopher") 13 | flag.Parse() 14 | fmt.Println("Hello " + gopherName + "!") 15 | } 16 | -------------------------------------------------------------------------------- /volume1/section2/repeatgreetings/repeatgreetings.go: -------------------------------------------------------------------------------- 1 | // An example of using a command line argument. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | "log" 7 | "os" 8 | "strconv" 9 | ) 10 | 11 | func main() { 12 | 13 | var repeatCount int 14 | var err error 15 | 16 | if len(os.Args) >= 2 { 17 | repeatCount, err = strconv.Atoi(os.Args[1]) 18 | if err != nil { 19 | log.Fatal(err) 20 | } 21 | 22 | for i := 0; i < repeatCount; i++ { 23 | fmt.Println("Hello Gopher!") 24 | } 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /volume1/section2/stringbasics/stringbasics.go: -------------------------------------------------------------------------------- 1 | // String examples covering declaration, literal definition, accessing character at value 2 | // and concatenating strings using the + operator. 3 | package main 4 | 5 | import "fmt" 6 | 7 | func main() { 8 | 9 | var subject string = "Gopher" 10 | 11 | fmt.Println("First element of Gopher string: ", string("Gopher"[0])) 12 | fmt.Printf("The first value of the subject string: %v\n", string(subject[0])) 13 | fmt.Printf("The last value of the subject string: %v\n", string(subject[len(subject)-1])) 14 | fmt.Println("Hello " + subject + "!") 15 | 16 | } 17 | -------------------------------------------------------------------------------- /volume1/section2/switchdemo/switchdemo.go: -------------------------------------------------------------------------------- 1 | // An example of declaring a switch statement. 2 | package main 3 | 4 | import "fmt" 5 | 6 | func main() { 7 | 8 | z := 36 9 | 10 | // A switch statement example 11 | switch z { 12 | case 1: 13 | fmt.Println("z is equal to 1") 14 | 15 | case 2: 16 | fmt.Println("z is equal to 2") 17 | 18 | case 3: 19 | fmt.Println("z is equal to 3") 20 | 21 | default: 22 | fmt.Println("z does not equal 1, 2, or 3") 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /volume1/section2/trafficlights/trafficlights.go: -------------------------------------------------------------------------------- 1 | // An example of declaring a constant grouping with an iota enumerator. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | ) 7 | 8 | const ( 9 | _ = iota 10 | TrafficLightStateRedLight 11 | TrafficLightStateGreenLight 12 | TrafficLightStateYellowLight 13 | ) 14 | 15 | func main() { 16 | 17 | fmt.Println("Red Light State Code: ", TrafficLightStateRedLight) 18 | fmt.Println("Green Light State Code: ", TrafficLightStateGreenLight) 19 | fmt.Println("Yellow Light State Code: ", TrafficLightStateYellowLight) 20 | } 21 | -------------------------------------------------------------------------------- /volume1/section2/usegreetings/usegreetings.go: -------------------------------------------------------------------------------- 1 | // An example of using functionality from a package. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | 7 | "github.com/EngineerKamesh/gofullstack/volume1/section2/greetingspackage" 8 | ) 9 | 10 | func main() { 11 | 12 | greetingspackage.PrintGreetings() 13 | greetingspackage.GopherGreetings() 14 | 15 | fmt.Println("The value of the Magic Number is:", greetingspackage.MagicNumber) 16 | 17 | } 18 | -------------------------------------------------------------------------------- /volume1/section3/shapedemo/shapedemo.go: -------------------------------------------------------------------------------- 1 | // A demonstration program using the simpleshape package. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | 7 | "github.com/EngineerKamesh/gofullstack/volume1/section3/simpleshape" 8 | ) 9 | 10 | func main() { 11 | 12 | r := simpleshape.NewRectangle(9, 6) 13 | t := simpleshape.NewTriangle(3, 6) 14 | 15 | fmt.Println("Area of myRectangle: ", simpleshape.ShapeArea(r)) 16 | fmt.Println("Area of myTriangle: ", simpleshape.ShapeArea(t)) 17 | 18 | } 19 | -------------------------------------------------------------------------------- /volume1/section3/simpleshape/rectangle.go: -------------------------------------------------------------------------------- 1 | package simpleshape 2 | 3 | type Rectangle struct { 4 | width float64 5 | height float64 6 | } 7 | 8 | func NewRectangle(w float64, h float64) *Rectangle { 9 | return &Rectangle{width: w, height: h} 10 | 11 | } 12 | 13 | func (r *Rectangle) Area() float64 { 14 | return r.width * r.height 15 | } 16 | -------------------------------------------------------------------------------- /volume1/section3/simpleshape/simpleshape.go: -------------------------------------------------------------------------------- 1 | // Package simpleshape is a simple interface for representing geometric shapes. 2 | package simpleshape 3 | 4 | // The Shape type represents a geometric shape. 5 | type Shape interface { 6 | Area() float64 7 | } 8 | 9 | // Calculates the area of a shape. The area calculation is based on the type of shape s. 10 | func ShapeArea(s Shape) float64 { 11 | 12 | return s.Area() 13 | 14 | } 15 | -------------------------------------------------------------------------------- /volume1/section3/simpleshape/triangle.go: -------------------------------------------------------------------------------- 1 | package simpleshape 2 | 3 | type Triangle struct { 4 | base float64 5 | height float64 6 | } 7 | 8 | func NewTriangle(b float64, h float64) *Triangle { 9 | return &Triangle{base: b, height: h} 10 | } 11 | 12 | func (t *Triangle) Area() float64 { 13 | return (t.base * t.height) / 2 14 | } 15 | -------------------------------------------------------------------------------- /volume1/section3/smpostexample/smpostexample.go: -------------------------------------------------------------------------------- 1 | // An example of creating a new instance of a Social Media Post type. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | 7 | "github.com/EngineerKamesh/gofullstack/volume1/section3/socialmedia" 8 | ) 9 | 10 | func main() { 11 | 12 | myPost := socialmedia.NewPost("EngineerKamesh", socialmedia.Moods["thrilled"], "Go is awesome!", "Check out the Go web site!", "https://golang.org", "", "", []string{"go", "golang", "programming language"}) 13 | fmt.Printf("myPost: %+v\n", myPost) 14 | } 15 | -------------------------------------------------------------------------------- /volume1/section3/socialmedia/moodstate_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=MoodState"; DO NOT EDIT 2 | 3 | package socialmedia 4 | 5 | import "fmt" 6 | 7 | const _MoodState_name = "MoodStateNeutralMoodStateHappyMoodStateSadMoodStateAngryMoodStateHopefulMoodStateThrilledMoodStateBoredMoodStateShyMoodStateComicalMoodStateOnCloudNine" 8 | 9 | var _MoodState_index = [...]uint8{0, 16, 30, 42, 56, 72, 89, 103, 115, 131, 151} 10 | 11 | func (i MoodState) String() string { 12 | if i < 0 || i >= MoodState(len(_MoodState_index)-1) { 13 | return fmt.Sprintf("MoodState(%d)", i) 14 | } 15 | return _MoodState_name[_MoodState_index[i]:_MoodState_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /volume1/section4/bufferedchannel/bufferedchannel.go: -------------------------------------------------------------------------------- 1 | // An example of a buffered channel (asynchronous). 2 | package main 3 | 4 | import "fmt" 5 | 6 | func main() { 7 | 8 | // We create a buffered channel of strings with a capacity of 3 9 | // This means the channel buffer can hold up to 3 values 10 | messageQueue := make(chan string, 3) 11 | messageQueue <- "one" 12 | messageQueue <- "two" 13 | messageQueue <- "three" 14 | 15 | // We drain the messageQueue by receiving all the values from the 16 | // buffered channel. 17 | fmt.Println(<-messageQueue) 18 | fmt.Println(<-messageQueue) 19 | fmt.Println(<-messageQueue) 20 | 21 | } 22 | -------------------------------------------------------------------------------- /volume1/section4/channeldemo/channeldemo.go: -------------------------------------------------------------------------------- 1 | // An example of sending and receiving a value through a channel. 2 | package main 3 | 4 | import "fmt" 5 | 6 | func writeMessageToChannel(message chan string) { 7 | 8 | message <- "Hello Gopher!" 9 | 10 | } 11 | 12 | func main() { 13 | 14 | fmt.Println("Channel Demo") 15 | 16 | message := make(chan string) 17 | go writeMessageToChannel(message) 18 | 19 | fmt.Println("Greeting from the message channel: ", <-message) 20 | 21 | close(message) 22 | } 23 | -------------------------------------------------------------------------------- /volume1/section4/goroutinesdemo/goroutinesdemo.go: -------------------------------------------------------------------------------- 1 | // An example of a goroutine. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | ) 7 | 8 | func printGreetings(source string) { 9 | 10 | for i := 0; i < 9; i++ { 11 | fmt.Println("Hello Gopher!", i, source) 12 | } 13 | } 14 | 15 | func main() { 16 | 17 | go printGreetings("goroutine") 18 | printGreetings("main function") 19 | 20 | } 21 | -------------------------------------------------------------------------------- /volume1/section4/goroutinesdemowithchannel/goroutinesdemowithchannel.go: -------------------------------------------------------------------------------- 1 | // An example of using a channel to wait for a goroutine to complete. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | ) 7 | 8 | var done chan bool = make(chan bool) 9 | 10 | func printGreetings(source string) { 11 | 12 | for i := 0; i < 9; i++ { 13 | fmt.Println("Hello Gopher!", i, source) 14 | } 15 | 16 | if source == "goroutine" { 17 | done <- true 18 | } 19 | 20 | } 21 | 22 | func main() { 23 | 24 | go printGreetings("goroutine") 25 | printGreetings("main function") 26 | 27 | <-done 28 | } 29 | -------------------------------------------------------------------------------- /volume1/section4/goroutinewithdelay/goroutinewithdelay.go: -------------------------------------------------------------------------------- 1 | // An example of a goroutine with a delay introduced so the goroutine can complete. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | "time" 7 | ) 8 | 9 | func printGreetings(source string) { 10 | 11 | for i := 0; i < 9; i++ { 12 | fmt.Println("Hello Gopher!", i, source) 13 | } 14 | time.Sleep(time.Millisecond * 1) 15 | } 16 | 17 | func main() { 18 | 19 | go printGreetings("goroutine") 20 | printGreetings("main function") 21 | 22 | } 23 | -------------------------------------------------------------------------------- /volume1/section4/mutex/mutex.go: -------------------------------------------------------------------------------- 1 | // An example of solving the data race condition using a mutex. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | "sync" 7 | ) 8 | 9 | var greetings string 10 | var howdyDone chan bool 11 | var mutex = &sync.Mutex{} 12 | 13 | func howdyGreetings() { 14 | 15 | mutex.Lock() 16 | greetings = "Howdy Gopher!" 17 | mutex.Unlock() 18 | howdyDone <- true 19 | } 20 | 21 | func main() { 22 | 23 | howdyDone = make(chan bool, 1) 24 | go howdyGreetings() 25 | mutex.Lock() 26 | greetings = "Hello Gopher!" 27 | fmt.Println(greetings) 28 | mutex.Unlock() 29 | <-howdyDone 30 | } 31 | -------------------------------------------------------------------------------- /volume1/section4/racedemo/racedemo.go: -------------------------------------------------------------------------------- 1 | // An example of a data race condition. 2 | // Execute the program like so: "go run -race racedemo.go" to detect the race condition. 3 | package main 4 | 5 | import "fmt" 6 | 7 | var greetings string 8 | var howdyDone chan bool 9 | 10 | func howdyGreetings() { 11 | 12 | greetings = "Howdy Gopher!" 13 | howdyDone <- true 14 | } 15 | 16 | func main() { 17 | 18 | howdyDone = make(chan bool, 1) 19 | go howdyGreetings() 20 | greetings = "Hello Gopher!" 21 | fmt.Println(greetings) 22 | <-howdyDone 23 | } 24 | -------------------------------------------------------------------------------- /volume1/section5/funnybusiness/funnybusiness.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | func main() { 6 | 7 | fmt.Printf("String or number?: %s\n", 1) 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume1/section5/socialmedia/moodstate_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=MoodState"; DO NOT EDIT 2 | 3 | package socialmedia 4 | 5 | import "fmt" 6 | 7 | const _MoodState_name = "MoodStateNeutralMoodStateHappyMoodStateSadMoodStateAngryMoodStateHopefulMoodStateThrilledMoodStateBoredMoodStateShyMoodStateComicalMoodStateOnCloudNine" 8 | 9 | var _MoodState_index = [...]uint8{0, 16, 30, 42, 56, 72, 89, 103, 115, 131, 151} 10 | 11 | func (i MoodState) String() string { 12 | if i < 0 || i >= MoodState(len(_MoodState_index)-1) { 13 | return fmt.Sprintf("MoodState(%d)", i) 14 | } 15 | return _MoodState_name[_MoodState_index[i]:_MoodState_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /volume1/section6/getrequest/getrequest.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "log" 7 | "net/http" 8 | ) 9 | 10 | func main() { 11 | 12 | resp, err := http.Get("http://www.google.com/") 13 | if err != nil { 14 | log.Fatalf("Encountered the following error: ", err) 15 | } 16 | defer resp.Body.Close() 17 | body, err := ioutil.ReadAll(resp.Body) 18 | fmt.Println(string(body)) 19 | 20 | } 21 | -------------------------------------------------------------------------------- /volume2/section1/smptemplate/static/images/gogopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section1/smptemplate/static/images/gogopher.png -------------------------------------------------------------------------------- /volume2/section1/templatedemo/templates/greeting.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Hello {{.Name}}!

5 | 6 | 7 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/endpoints/createpost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func CreatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the create post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/endpoints/deletepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func DeletePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the delete post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/endpoints/updatepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func UpdatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the update post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/handlers/feed.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FeedHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/handlers/find.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FindHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/handlers/foo.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func FooHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | fooID := r.Context().Value("fooID").(string) 10 | w.Write([]byte(fooID)) 11 | 12 | } 13 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/handlers/friends.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FriendsHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/handlers/home.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func HomeHandler(w http.ResponseWriter, r *http.Request) { 9 | 10 | fmt.Println("test") 11 | 12 | } 13 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/handlers/login.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func LoginHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/handlers/logout.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func LogoutHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/handlers/myprofile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func MyProfileHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | w.Write([]byte("profile")) 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/handlers/panic.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func TriggerPanicHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | panic("Triggering a Panic!") 10 | } 11 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/handlers/profile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/gorilla/mux" 7 | ) 8 | 9 | func ProfileHandler(w http.ResponseWriter, r *http.Request) { 10 | 11 | vars := mux.Vars(r) 12 | username := vars["username"] 13 | w.Write([]byte(username)) 14 | } 15 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/handlers/register.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func RegisterHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/middleware/panicrecovery.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | ) 7 | 8 | func PanicRecoveryHandler(next http.Handler) http.Handler { 9 | 10 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 11 | 12 | defer func() { 13 | 14 | if err := recover(); err != nil { 15 | log.Printf("Encountered panic: %+v", err) 16 | http.Error(w, http.StatusText(500), 500) 17 | } 18 | 19 | }() 20 | 21 | next.ServeHTTP(w, r) 22 | 23 | }) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/models/socialmedia/moodstate_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=MoodState"; DO NOT EDIT 2 | 3 | package socialmedia 4 | 5 | import "fmt" 6 | 7 | const _MoodState_name = "MoodStateNeutralMoodStateHappyMoodStateSadMoodStateAngryMoodStateHopefulMoodStateThrilledMoodStateBoredMoodStateShyMoodStateComicalMoodStateOnCloudNine" 8 | 9 | var _MoodState_index = [...]uint8{0, 16, 30, 42, 56, 72, 89, 103, 115, 131, 151} 10 | 11 | func (i MoodState) String() string { 12 | if i < 0 || i >= MoodState(len(_MoodState_index)-1) { 13 | return fmt.Sprintf("MoodState(%d)", i) 14 | } 15 | return _MoodState_name[_MoodState_index[i]:_MoodState_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /volume2/section2/gopherface/templates/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section2/gopherface/templates/index.html -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/endpoints/createpost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func CreatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the create post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/endpoints/deletepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func DeletePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the delete post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/endpoints/updatepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func UpdatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the update post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/handlers/feed.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FeedHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/handlers/find.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FindHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/handlers/foo.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func FooHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | fooID := r.Context().Value("fooID").(string) 10 | w.Write([]byte(fooID)) 11 | 12 | } 13 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/handlers/friends.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FriendsHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/handlers/home.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func HomeHandler(w http.ResponseWriter, r *http.Request) { 9 | 10 | fmt.Println("home page handler reached") 11 | 12 | } 13 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/handlers/login.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func LoginHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/handlers/logout.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func LogoutHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/handlers/myprofile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func MyProfileHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | w.Write([]byte("profile")) 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/handlers/panic.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func TriggerPanicHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | panic("Triggering a Panic!") 10 | } 11 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/handlers/profile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/gorilla/mux" 7 | ) 8 | 9 | func ProfileHandler(w http.ResponseWriter, r *http.Request) { 10 | 11 | vars := mux.Vars(r) 12 | username := vars["username"] 13 | w.Write([]byte(username)) 14 | } 15 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/handlers/register.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func RegisterHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/middleware/panicrecovery.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | ) 7 | 8 | func PanicRecoveryHandler(next http.Handler) http.Handler { 9 | 10 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 11 | 12 | defer func() { 13 | 14 | if err := recover(); err != nil { 15 | log.Printf("Encountered panic: %+v", err) 16 | http.Error(w, http.StatusText(500), 500) 17 | } 18 | 19 | }() 20 | 21 | next.ServeHTTP(w, r) 22 | 23 | }) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/static/imageset/0083d2f4a81588ed85c06679e68d9855754b498d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section3/gopherfaceform/static/imageset/0083d2f4a81588ed85c06679e68d9855754b498d.png -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/static/imageset/142cb526f8d5602ec97b674804768d4eb9c1d8b3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section3/gopherfaceform/static/imageset/142cb526f8d5602ec97b674804768d4eb9c1d8b3.png -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/static/imageset/21ea6a171c98374b61ffceea7146da1ecaef14d9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section3/gopherfaceform/static/imageset/21ea6a171c98374b61ffceea7146da1ecaef14d9.png -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/static/imageset/68e3075133cf704244c2b2a61d78fa9adabdf678.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section3/gopherfaceform/static/imageset/68e3075133cf704244c2b2a61d78fa9adabdf678.png -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/static/imageset/85a586dc6db1483f6014819972e6d709a03e7801.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section3/gopherfaceform/static/imageset/85a586dc6db1483f6014819972e6d709a03e7801.png -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/static/imageset/8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section3/gopherfaceform/static/imageset/8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/static/imageset/a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section3/gopherfaceform/static/imageset/a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/static/imageset/c1e4861d325e29731efd9e9abc760eacf3d9be8b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section3/gopherfaceform/static/imageset/c1e4861d325e29731efd9e9abc760eacf3d9be8b.png -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/static/imageset/c923378f14eba979d8e81db2fa8259f211af4870.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section3/gopherfaceform/static/imageset/c923378f14eba979d8e81db2fa8259f211af4870.png -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/static/uploads/images/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded image files. 2 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/static/uploads/videos/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded video files. 2 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/static/videoset/3DGopher.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section3/gopherfaceform/static/videoset/3DGopher.mp4 -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/templates/imagepreview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gopherface - Image Preview 5 | 6 | 7 | 8 |

GopherFace - Image Preview

9 | 10 |
11 | 12 |
13 | 14 | 15 |
16 | 17 |
18 | 19 |
20 | 21 |
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/templates/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section3/gopherfaceform/templates/index.html -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/templates/signupconfirmation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - Sign Up Confirmation 4 | 5 | 6 | 7 |

GopherFace - Sign Up Confirmation

8 | 9 | 10 |

Thank you {{.Fields.firstName}}!

11 |

We have received your form submission!

12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /volume2/section3/gopherfaceform/templates/videopreview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

GopherFace - Video Preview

8 | 9 |
10 | 11 |
12 | 13 | 14 |
15 | 16 |
17 | 21 |
22 | 23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/endpoints/createpost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func CreatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the create post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/endpoints/deletepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func DeletePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the delete post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/endpoints/updatepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func UpdatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the update post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/handlers/feed.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FeedHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/handlers/find.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FindHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/handlers/foo.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func FooHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | fooID := r.Context().Value("fooID").(string) 10 | w.Write([]byte(fooID)) 11 | 12 | } 13 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/handlers/friends.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FriendsHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/handlers/home.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func HomeHandler(w http.ResponseWriter, r *http.Request) { 9 | 10 | fmt.Println("home page handler reached") 11 | 12 | } 13 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/handlers/login.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func LoginHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/handlers/logout.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func LogoutHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/handlers/myprofile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func MyProfileHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | w.Write([]byte("profile")) 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/handlers/panic.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func TriggerPanicHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | panic("Triggering a Panic!") 10 | } 11 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/handlers/profile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/gorilla/mux" 7 | ) 8 | 9 | func ProfileHandler(w http.ResponseWriter, r *http.Request) { 10 | 11 | vars := mux.Vars(r) 12 | username := vars["username"] 13 | w.Write([]byte(username)) 14 | } 15 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/handlers/register.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func RegisterHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/middleware/panicrecovery.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | ) 7 | 8 | func PanicRecoveryHandler(next http.Handler) http.Handler { 9 | 10 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 11 | 12 | defer func() { 13 | 14 | if err := recover(); err != nil { 15 | log.Printf("Encountered panic: %+v", err) 16 | http.Error(w, http.StatusText(500), 500) 17 | } 18 | 19 | }() 20 | 21 | next.ServeHTTP(w, r) 22 | 23 | }) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/static/imageset/0083d2f4a81588ed85c06679e68d9855754b498d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section4/gopherfaceform/static/imageset/0083d2f4a81588ed85c06679e68d9855754b498d.png -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/static/imageset/142cb526f8d5602ec97b674804768d4eb9c1d8b3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section4/gopherfaceform/static/imageset/142cb526f8d5602ec97b674804768d4eb9c1d8b3.png -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/static/imageset/21ea6a171c98374b61ffceea7146da1ecaef14d9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section4/gopherfaceform/static/imageset/21ea6a171c98374b61ffceea7146da1ecaef14d9.png -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/static/imageset/68e3075133cf704244c2b2a61d78fa9adabdf678.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section4/gopherfaceform/static/imageset/68e3075133cf704244c2b2a61d78fa9adabdf678.png -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/static/imageset/85a586dc6db1483f6014819972e6d709a03e7801.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section4/gopherfaceform/static/imageset/85a586dc6db1483f6014819972e6d709a03e7801.png -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/static/imageset/8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section4/gopherfaceform/static/imageset/8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/static/imageset/a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section4/gopherfaceform/static/imageset/a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/static/imageset/c1e4861d325e29731efd9e9abc760eacf3d9be8b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section4/gopherfaceform/static/imageset/c1e4861d325e29731efd9e9abc760eacf3d9be8b.png -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/static/imageset/c923378f14eba979d8e81db2fa8259f211af4870.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section4/gopherfaceform/static/imageset/c923378f14eba979d8e81db2fa8259f211af4870.png -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/static/uploads/images/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded image files. 2 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/static/uploads/videos/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded video files. 2 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/static/videoset/3DGopher.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section4/gopherfaceform/static/videoset/3DGopher.mp4 -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/templates/imagepreview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gopherface - Image Preview 5 | 6 | 7 | 8 |

GopherFace - Image Preview

9 | 10 |
11 | 12 |
13 | 14 | 15 |
16 | 17 |
18 | 19 |
20 | 21 |
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/templates/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section4/gopherfaceform/templates/index.html -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/templates/signupconfirmation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - Sign Up Confirmation 4 | 5 | 6 | 7 |

GopherFace - Sign Up Confirmation

8 | 9 | 10 |

Thank you {{.Fields.firstName}}!

11 |

We have received your form submission!

12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /volume2/section4/gopherfaceform/templates/videopreview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

GopherFace - Video Preview

8 | 9 |
10 | 11 |
12 | 13 | 14 |
15 | 16 |
17 | 21 |
22 | 23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "github.com/EngineerKamesh/gofullstack/volume2/section5/gopherfacedb/common/datastore" 4 | 5 | type Env struct { 6 | DB datastore.Datastore 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/common/utility/sha256.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "crypto/sha256" 5 | "fmt" 6 | ) 7 | 8 | func SHA256OfString(input string) string { 9 | 10 | sum := sha256.Sum256([]byte(input)) 11 | return fmt.Sprintf("%x", sum) 12 | 13 | } 14 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/common/utility/uuid.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | ) 8 | 9 | func GenerateUUID() string { 10 | f, err := os.Open("/dev/urandom") 11 | if err != nil { 12 | log.Println("Encountered the following error when attempting to generate an UUID: ", err) 13 | return "" 14 | } 15 | b := make([]byte, 16) 16 | f.Read(b) 17 | f.Close() 18 | uuid := fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:]) 19 | return uuid 20 | } 21 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/endpoints/createpost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func CreatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the create post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/endpoints/deletepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func DeletePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the delete post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/endpoints/updatepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func UpdatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the update post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/handlers/feed.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FeedHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/handlers/find.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FindHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/handlers/foo.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func FooHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | fooID := r.Context().Value("fooID").(string) 10 | w.Write([]byte(fooID)) 11 | 12 | } 13 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/handlers/friends.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FriendsHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/handlers/home.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func HomeHandler(w http.ResponseWriter, r *http.Request) { 9 | 10 | fmt.Println("home page handler reached") 11 | } 12 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/handlers/login.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func LoginHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/handlers/logout.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func LogoutHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/handlers/myprofile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func MyProfileHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | w.Write([]byte("profile")) 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/handlers/panic.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func TriggerPanicHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | panic("Triggering a Panic!") 10 | } 11 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/handlers/profile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/gorilla/mux" 7 | ) 8 | 9 | func ProfileHandler(w http.ResponseWriter, r *http.Request) { 10 | 11 | vars := mux.Vars(r) 12 | username := vars["username"] 13 | w.Write([]byte(username)) 14 | } 15 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/handlers/register.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func RegisterHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/middleware/panicrecovery.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | ) 7 | 8 | func PanicRecoveryHandler(next http.Handler) http.Handler { 9 | 10 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 11 | 12 | defer func() { 13 | 14 | if err := recover(); err != nil { 15 | log.Printf("Encountered panic: %+v", err) 16 | http.Error(w, http.StatusText(500), 500) 17 | } 18 | 19 | }() 20 | 21 | next.ServeHTTP(w, r) 22 | 23 | }) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/models/socialmedia/moodstate_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=MoodState"; DO NOT EDIT 2 | 3 | package socialmedia 4 | 5 | import "fmt" 6 | 7 | const _MoodState_name = "MoodStateNeutralMoodStateHappyMoodStateSadMoodStateAngryMoodStateHopefulMoodStateThrilledMoodStateBoredMoodStateShyMoodStateComicalMoodStateOnCloudNine" 8 | 9 | var _MoodState_index = [...]uint8{0, 16, 30, 42, 56, 72, 89, 103, 115, 131, 151} 10 | 11 | func (i MoodState) String() string { 12 | if i < 0 || i >= MoodState(len(_MoodState_index)-1) { 13 | return fmt.Sprintf("MoodState(%d)", i) 14 | } 15 | return _MoodState_name[_MoodState_index[i]:_MoodState_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/static/imageset/0083d2f4a81588ed85c06679e68d9855754b498d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section5/gopherfacedb/static/imageset/0083d2f4a81588ed85c06679e68d9855754b498d.png -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/static/imageset/142cb526f8d5602ec97b674804768d4eb9c1d8b3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section5/gopherfacedb/static/imageset/142cb526f8d5602ec97b674804768d4eb9c1d8b3.png -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/static/imageset/21ea6a171c98374b61ffceea7146da1ecaef14d9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section5/gopherfacedb/static/imageset/21ea6a171c98374b61ffceea7146da1ecaef14d9.png -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/static/imageset/68e3075133cf704244c2b2a61d78fa9adabdf678.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section5/gopherfacedb/static/imageset/68e3075133cf704244c2b2a61d78fa9adabdf678.png -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/static/imageset/85a586dc6db1483f6014819972e6d709a03e7801.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section5/gopherfacedb/static/imageset/85a586dc6db1483f6014819972e6d709a03e7801.png -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/static/imageset/8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section5/gopherfacedb/static/imageset/8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/static/imageset/a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section5/gopherfacedb/static/imageset/a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/static/imageset/c1e4861d325e29731efd9e9abc760eacf3d9be8b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section5/gopherfacedb/static/imageset/c1e4861d325e29731efd9e9abc760eacf3d9be8b.png -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/static/imageset/c923378f14eba979d8e81db2fa8259f211af4870.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section5/gopherfacedb/static/imageset/c923378f14eba979d8e81db2fa8259f211af4870.png -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/static/uploads/images/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded image files. 2 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/static/uploads/videos/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded video files. 2 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/static/videoset/3DGopher.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section5/gopherfacedb/static/videoset/3DGopher.mp4 -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/templates/imagepreview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gopherface - Image Preview 5 | 6 | 7 | 8 |

GopherFace - Image Preview

9 | 10 |
11 | 12 |
13 | 14 | 15 |
16 | 17 |
18 | 19 |
20 | 21 |
22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/templates/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section5/gopherfacedb/templates/index.html -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/templates/signupconfirmation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - Sign Up Confirmation 4 | 5 | 6 | 7 |

GopherFace - Sign Up Confirmation

8 | 9 | 10 |

Thank you {{.Fields.firstName}}!

11 |

We have received your form submission!

12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /volume2/section5/gopherfacedb/templates/videopreview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

GopherFace - Video Preview

8 | 9 |
10 | 11 |
12 | 13 | 14 |
15 | 16 |
17 | 21 |
22 | 23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/common/asyncq/task.go: -------------------------------------------------------------------------------- 1 | package asyncq 2 | 3 | type Task interface { 4 | Perform() 5 | } 6 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "github.com/EngineerKamesh/gofullstack/volume2/section6/gopherfaceauth/common/datastore" 4 | 5 | type Env struct { 6 | DB datastore.Datastore 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/common/utility/sha256.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "crypto/sha256" 5 | "fmt" 6 | ) 7 | 8 | func SHA256OfString(input string) string { 9 | 10 | sum := sha256.Sum256([]byte(input)) 11 | return fmt.Sprintf("%x", sum) 12 | 13 | } 14 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/common/utility/uuid.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | ) 8 | 9 | func GenerateUUID() string { 10 | f, err := os.Open("/dev/urandom") 11 | if err != nil { 12 | log.Println("Encountered the following error when attempting to generate an UUID: ", err) 13 | return "" 14 | } 15 | b := make([]byte, 16) 16 | f.Read(b) 17 | f.Close() 18 | uuid := fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:]) 19 | return uuid 20 | } 21 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/endpoints/createpost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func CreatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the create post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/endpoints/deletepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func DeletePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the delete post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/endpoints/updatepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func UpdatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the update post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/handlers/feed.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FeedHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | m := make(map[string]string) 8 | m["PageTitle"] = "Feed" 9 | RenderGatedTemplate(w, "./templates/feed.html", m) 10 | 11 | } 12 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/handlers/find.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FindHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/handlers/foo.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func FooHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | fooID := r.Context().Value("fooID").(string) 10 | w.Write([]byte(fooID)) 11 | 12 | } 13 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/handlers/friends.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FriendsHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | m := make(map[string]string) 8 | m["PageTitle"] = "Friends" 9 | RenderGatedTemplate(w, "./templates/friends.html", m) 10 | 11 | } 12 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/handlers/home.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func HomeHandler(w http.ResponseWriter, r *http.Request) { 9 | 10 | fmt.Println("home page handler reached") 11 | } 12 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/handlers/logout.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/EngineerKamesh/gofullstack/volume2/section6/gopherfaceauth/common/authenticate" 7 | ) 8 | 9 | func LogoutHandler(w http.ResponseWriter, r *http.Request) { 10 | 11 | authenticate.ExpireUserSession(w, r) 12 | authenticate.ExpireSecureCookie(w, r) 13 | } 14 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/handlers/myprofile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func MyProfileHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | m := make(map[string]string) 10 | m["PageTitle"] = "My Profile" 11 | RenderGatedTemplate(w, "./templates/profile.html", m) 12 | 13 | } 14 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/handlers/panic.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func TriggerPanicHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | panic("Triggering a Panic!") 10 | } 11 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/handlers/profile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func ProfileHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | w.Write([]byte("profile")) 10 | 11 | } 12 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/handlers/register.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func RegisterHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/middleware/panicrecovery.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | ) 7 | 8 | func PanicRecoveryHandler(next http.Handler) http.Handler { 9 | 10 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 11 | 12 | defer func() { 13 | 14 | if err := recover(); err != nil { 15 | log.Printf("Encountered panic: %+v", err) 16 | http.Error(w, http.StatusText(500), 500) 17 | } 18 | 19 | }() 20 | 21 | next.ServeHTTP(w, r) 22 | 23 | }) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/static/imageset/0083d2f4a81588ed85c06679e68d9855754b498d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section6/gopherfaceauth/static/imageset/0083d2f4a81588ed85c06679e68d9855754b498d.png -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/static/imageset/142cb526f8d5602ec97b674804768d4eb9c1d8b3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section6/gopherfaceauth/static/imageset/142cb526f8d5602ec97b674804768d4eb9c1d8b3.png -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/static/imageset/21ea6a171c98374b61ffceea7146da1ecaef14d9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section6/gopherfaceauth/static/imageset/21ea6a171c98374b61ffceea7146da1ecaef14d9.png -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/static/imageset/68e3075133cf704244c2b2a61d78fa9adabdf678.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section6/gopherfaceauth/static/imageset/68e3075133cf704244c2b2a61d78fa9adabdf678.png -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/static/imageset/85a586dc6db1483f6014819972e6d709a03e7801.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section6/gopherfaceauth/static/imageset/85a586dc6db1483f6014819972e6d709a03e7801.png -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/static/imageset/8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section6/gopherfaceauth/static/imageset/8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/static/imageset/a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section6/gopherfaceauth/static/imageset/a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/static/imageset/c1e4861d325e29731efd9e9abc760eacf3d9be8b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section6/gopherfaceauth/static/imageset/c1e4861d325e29731efd9e9abc760eacf3d9be8b.png -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/static/imageset/c923378f14eba979d8e81db2fa8259f211af4870.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section6/gopherfaceauth/static/imageset/c923378f14eba979d8e81db2fa8259f211af4870.png -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/static/uploads/images/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded image files. 2 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/static/uploads/videos/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded video files. 2 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/static/videoset/3DGopher.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section6/gopherfaceauth/static/videoset/3DGopher.mp4 -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/templates/feed.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 | 3 |

{{.PageTitle}}

4 | 5 |

Social media feed goes here.

6 | 7 | {{template "footer.html" .}} 8 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/templates/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/templates/friends.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 | 3 |

{{.PageTitle}}

4 | 5 |

List of friends goes here.

6 | 7 | {{template "footer.html" .}} 8 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/templates/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - {{.PageTitle}} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/templates/imagepreview.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 |

{{.PageTitle}}

3 |
4 | 5 |
6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 | 16 | {{template "footer.html" .}} 17 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/templates/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section6/gopherfaceauth/templates/index.html -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/templates/profile.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 | 3 |

{{.PageTitle}}

4 | 5 |

My profile goes here.

6 | 7 | {{template "footer.html" .}} 8 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/templates/signupconfirmation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - Sign Up Confirmation 4 | 5 | 6 | 7 |

GopherFace - Sign Up Confirmation

8 | 9 | 10 |

Thank you {{.Fields.firstName}}!

11 |

We have received your form submission!

12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/templates/uploadimageform.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 | 3 |

 

4 | 5 |
6 |
7 |
8 | 9 |
10 | 11 | 12 |
13 | 14 | 15 | 16 |
17 | 18 |
19 | 20 | {{template "footer.html" .}} 21 | -------------------------------------------------------------------------------- /volume2/section6/gopherfaceauth/templates/videopreview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

GopherFace - Video Preview

8 | 9 |
10 | 11 |
12 | 13 | 14 |
15 | 16 |
17 | 21 |
22 | 23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/common/asyncq/task.go: -------------------------------------------------------------------------------- 1 | package asyncq 2 | 3 | type Task interface { 4 | Perform() 5 | } 6 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "github.com/EngineerKamesh/gofullstack/volume2/section7/gopherfaceq/common/datastore" 4 | 5 | type Env struct { 6 | DB datastore.Datastore 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/common/utility/sha256.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "crypto/sha256" 5 | "fmt" 6 | ) 7 | 8 | func SHA256OfString(input string) string { 9 | 10 | sum := sha256.Sum256([]byte(input)) 11 | return fmt.Sprintf("%x", sum) 12 | 13 | } 14 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/common/utility/uuid.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | ) 8 | 9 | func GenerateUUID() string { 10 | f, err := os.Open("/dev/urandom") 11 | if err != nil { 12 | log.Println("Encountered the following error when attempting to generate an UUID: ", err) 13 | return "" 14 | } 15 | b := make([]byte, 16) 16 | f.Read(b) 17 | f.Close() 18 | uuid := fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:]) 19 | return uuid 20 | } 21 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/endpoints/createpost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func CreatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the create post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/endpoints/deletepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func DeletePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the delete post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/endpoints/updatepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func UpdatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the update post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/handlers/feed.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FeedHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | m := make(map[string]string) 8 | m["PageTitle"] = "Feed" 9 | RenderGatedTemplate(w, "./templates/feed.html", m) 10 | 11 | } 12 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/handlers/find.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FindHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/handlers/foo.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func FooHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | fooID := r.Context().Value("fooID").(string) 10 | w.Write([]byte(fooID)) 11 | 12 | } 13 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/handlers/friends.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FriendsHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | m := make(map[string]string) 8 | m["PageTitle"] = "Friends" 9 | RenderGatedTemplate(w, "./templates/friends.html", m) 10 | 11 | } 12 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/handlers/home.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func HomeHandler(w http.ResponseWriter, r *http.Request) { 9 | 10 | fmt.Println("home page handler reached") 11 | } 12 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/handlers/logout.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/EngineerKamesh/gofullstack/volume2/section7/gopherfaceq/common/authenticate" 7 | ) 8 | 9 | func LogoutHandler(w http.ResponseWriter, r *http.Request) { 10 | 11 | authenticate.ExpireUserSession(w, r) 12 | authenticate.ExpireSecureCookie(w, r) 13 | } 14 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/handlers/myprofile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func MyProfileHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | m := make(map[string]string) 10 | m["PageTitle"] = "My Profile" 11 | RenderGatedTemplate(w, "./templates/profile.html", m) 12 | 13 | } 14 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/handlers/panic.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func TriggerPanicHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | panic("Triggering a Panic!") 10 | } 11 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/handlers/profile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func ProfileHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | w.Write([]byte("profile")) 10 | 11 | } 12 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/handlers/register.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func RegisterHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/middleware/panicrecovery.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | ) 7 | 8 | func PanicRecoveryHandler(next http.Handler) http.Handler { 9 | 10 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 11 | 12 | defer func() { 13 | 14 | if err := recover(); err != nil { 15 | log.Printf("Encountered panic: %+v", err) 16 | http.Error(w, http.StatusText(500), 500) 17 | } 18 | 19 | }() 20 | 21 | next.ServeHTTP(w, r) 22 | 23 | }) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/models/socialmedia/moodstate_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=MoodState"; DO NOT EDIT 2 | 3 | package socialmedia 4 | 5 | import "fmt" 6 | 7 | const _MoodState_name = "MoodStateNeutralMoodStateHappyMoodStateSadMoodStateAngryMoodStateHopefulMoodStateThrilledMoodStateBoredMoodStateShyMoodStateComicalMoodStateOnCloudNine" 8 | 9 | var _MoodState_index = [...]uint8{0, 16, 30, 42, 56, 72, 89, 103, 115, 131, 151} 10 | 11 | func (i MoodState) String() string { 12 | if i < 0 || i >= MoodState(len(_MoodState_index)-1) { 13 | return fmt.Sprintf("MoodState(%d)", i) 14 | } 15 | return _MoodState_name[_MoodState_index[i]:_MoodState_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/static/imageset/0083d2f4a81588ed85c06679e68d9855754b498d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section7/gopherfaceq/static/imageset/0083d2f4a81588ed85c06679e68d9855754b498d.png -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/static/imageset/142cb526f8d5602ec97b674804768d4eb9c1d8b3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section7/gopherfaceq/static/imageset/142cb526f8d5602ec97b674804768d4eb9c1d8b3.png -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/static/imageset/21ea6a171c98374b61ffceea7146da1ecaef14d9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section7/gopherfaceq/static/imageset/21ea6a171c98374b61ffceea7146da1ecaef14d9.png -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/static/imageset/68e3075133cf704244c2b2a61d78fa9adabdf678.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section7/gopherfaceq/static/imageset/68e3075133cf704244c2b2a61d78fa9adabdf678.png -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/static/imageset/85a586dc6db1483f6014819972e6d709a03e7801.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section7/gopherfaceq/static/imageset/85a586dc6db1483f6014819972e6d709a03e7801.png -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/static/imageset/8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section7/gopherfaceq/static/imageset/8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/static/imageset/a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section7/gopherfaceq/static/imageset/a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/static/imageset/c1e4861d325e29731efd9e9abc760eacf3d9be8b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section7/gopherfaceq/static/imageset/c1e4861d325e29731efd9e9abc760eacf3d9be8b.png -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/static/imageset/c923378f14eba979d8e81db2fa8259f211af4870.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section7/gopherfaceq/static/imageset/c923378f14eba979d8e81db2fa8259f211af4870.png -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/static/uploads/images/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded image files. 2 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/static/uploads/videos/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded video files. 2 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/static/videoset/3DGopher.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section7/gopherfaceq/static/videoset/3DGopher.mp4 -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/templates/feed.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 | 3 |

{{.PageTitle}}

4 | 5 |

Social media feed goes here.

6 | 7 | {{template "footer.html" .}} 8 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/templates/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/templates/friends.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 | 3 |

{{.PageTitle}}

4 | 5 |

List of friends goes here.

6 | 7 | {{template "footer.html" .}} 8 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/templates/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - {{.PageTitle}} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/templates/imagepreview.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 |

{{.PageTitle}}

3 |
4 | 5 |
6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 | 16 | {{template "footer.html" .}} 17 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/templates/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume2/section7/gopherfaceq/templates/index.html -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/templates/profile.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 | 3 |

{{.PageTitle}}

4 | 5 |

My profile goes here.

6 | 7 | {{template "footer.html" .}} 8 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/templates/signupconfirmation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - Sign Up Confirmation 4 | 5 | 6 | 7 |

GopherFace - Sign Up Confirmation

8 | 9 | 10 |

Thank you {{.Fields.firstName}}!

11 |

We have received your form submission!

12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/templates/uploadimageform.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 | 3 |

 

4 | 5 |
6 |
7 |
8 | 9 |
10 | 11 | 12 |
13 | 14 | 15 | 16 |
17 | 18 |
19 | 20 | {{template "footer.html" .}} 21 | -------------------------------------------------------------------------------- /volume2/section7/gopherfaceq/templates/videopreview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

GopherFace - Video Preview

8 | 9 |
10 | 11 |
12 | 13 | 14 |
15 | 16 |
17 | 21 |
22 | 23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /volume3/section1/basics/client/alertmsg.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/gopherjs/gopherjs/js" 5 | "honnef.co/go/js/dom" 6 | ) 7 | 8 | func DisplayAlertMessageJSGlobal(message string) { 9 | js.Global.Call("alert", message) 10 | } 11 | 12 | func DisplayAlertMessageDOM(message string) { 13 | dom.GetWindow().Alert(message) 14 | } 15 | -------------------------------------------------------------------------------- /volume3/section1/basics/client/builtindemo.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/gopherjs/jsbuiltin" 5 | "honnef.co/go/js/dom" 6 | ) 7 | 8 | func builtinDemo(element dom.Element) { 9 | 10 | if jsbuiltin.TypeOf(element) == "object" { 11 | println("Using the typeof operator, we can see that the element that was clicked, is an object.") 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /volume3/section1/basics/client/cssexample.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "honnef.co/go/js/dom" 4 | 5 | func toggleIsomorphicGopher(isVisible bool) { 6 | 7 | d := dom.GetWindow().Document() 8 | isomorphicGopherImage := d.GetElementByID("isomorphicGopher").(*dom.HTMLImageElement) 9 | 10 | if isVisible == true { 11 | isomorphicGopherImage.Style().SetProperty("display", "inline", "") 12 | } else { 13 | isomorphicGopherImage.Style().SetProperty("display", "none", "") 14 | } 15 | 16 | } 17 | 18 | func ShowIsomorphicGopher() { 19 | toggleIsomorphicGopher(true) 20 | } 21 | 22 | func HideIsomorphicGopher() { 23 | toggleIsomorphicGopher(false) 24 | } 25 | -------------------------------------------------------------------------------- /volume3/section1/basics/static/css/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: arial,helvetica; 3 | font-size: 12pt; 4 | } 5 | 6 | #welcomeContainer { 7 | padding-top: 3px; 8 | text-align: center; 9 | } 10 | 11 | #welcomeMessage { 12 | margin-top: 54px; 13 | } 14 | 15 | #copyright_notice { 16 | display: block; 17 | text-align: center; 18 | margin: 0; 19 | margin-bottom:9px; 20 | width: 100%; 21 | } 22 | 23 | #copyright_notice p { 24 | font-size: 9pt; 25 | } 26 | 27 | footer { 28 | margin-top: 72px; 29 | } 30 | 31 | h1 { 32 | margin-left: 36px !important; 33 | } 34 | 35 | .example { 36 | margin-left: 36px; 37 | margin-bottom: 108px; 38 | } 39 | -------------------------------------------------------------------------------- /volume3/section1/basics/static/images/isomorphic_go_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section1/basics/static/images/isomorphic_go_icon.png -------------------------------------------------------------------------------- /volume3/section1/basics/static/images/isomorphic_go_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section1/basics/static/images/isomorphic_go_logo.png -------------------------------------------------------------------------------- /volume3/section1/basics/static/js/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section1/basics/static/js/.gitkeep -------------------------------------------------------------------------------- /volume3/section1/intermediate/model/car.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type Car struct { 4 | ModelName string 5 | Color string 6 | Manufacturer string 7 | } 8 | -------------------------------------------------------------------------------- /volume3/section1/intermediate/static/websocketclient.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Gorilla Websocket Client Example In GopherJS 5 | 6 | 7 | 8 |

Gorilla WebSocket Client Example in GopherJS

9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /volume3/section2/3dgopher/server.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "log" 6 | "net/http" 7 | ) 8 | 9 | var addr = flag.String("addr", "localhost:8080", "http service address") 10 | 11 | func main() { 12 | fs := http.FileServer(http.Dir("./static")) 13 | flag.Parse() 14 | log.SetFlags(0) 15 | http.Handle("/", fs) 16 | 17 | log.Fatal(http.ListenAndServe(*addr, nil)) 18 | } 19 | -------------------------------------------------------------------------------- /volume3/section2/3dgopher/static/js/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section2/3dgopher/static/js/.gitkeep -------------------------------------------------------------------------------- /volume3/section3/server.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/gorilla/mux" 7 | ) 8 | 9 | func main() { 10 | 11 | r := mux.NewRouter() 12 | 13 | fs := http.FileServer(http.Dir("./static")) 14 | http.Handle("/", r) 15 | http.Handle("/static/", http.StripPrefix("/static", fs)) 16 | http.ListenAndServe(":8080", nil) 17 | 18 | } 19 | -------------------------------------------------------------------------------- /volume3/section3/static/js/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section3/static/js/.gitkeep -------------------------------------------------------------------------------- /volume3/section4/gopherface/client/common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "go.isomorphicgo.org/go/isokit" 5 | "honnef.co/go/js/dom" 6 | ) 7 | 8 | type Env struct { 9 | TemplateSet *isokit.TemplateSet 10 | Window dom.Window 11 | Document dom.Document 12 | PrimaryContent dom.Element 13 | } 14 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/client/handlers/feed.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/EngineerKamesh/gofullstack/volume3/section4/gopherface/client/common" 7 | 8 | "go.isomorphicgo.org/go/isokit" 9 | ) 10 | 11 | func FeedHandler(env *common.Env) isokit.Handler { 12 | return isokit.HandlerFunc(func(ctx context.Context) { 13 | println("Client-side Feed Handler") 14 | m := make(map[string]string) 15 | m["PageTitle"] = "Feed" 16 | env.TemplateSet.Render("feed_content", &isokit.RenderParams{Data: m, Disposition: isokit.PlacementReplaceInnerContents, Element: env.PrimaryContent}) 17 | }) 18 | } 19 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/client/handlers/friends.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/EngineerKamesh/gofullstack/volume3/section4/gopherface/client/common" 7 | 8 | "go.isomorphicgo.org/go/isokit" 9 | ) 10 | 11 | func FriendsHandler(env *common.Env) isokit.Handler { 12 | return isokit.HandlerFunc(func(ctx context.Context) { 13 | println("Client-side Friends Handler") 14 | m := make(map[string]string) 15 | m["PageTitle"] = "Friends" 16 | env.TemplateSet.Render("friends_content", &isokit.RenderParams{Data: m, Disposition: isokit.PlacementReplaceInnerContents, Element: env.PrimaryContent}) 17 | 18 | }) 19 | } 20 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/client/handlers/myprofile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/EngineerKamesh/gofullstack/volume3/section4/gopherface/client/common" 7 | 8 | "go.isomorphicgo.org/go/isokit" 9 | ) 10 | 11 | func MyProfileHandler(env *common.Env) isokit.Handler { 12 | return isokit.HandlerFunc(func(ctx context.Context) { 13 | println("Client-side My Profile Handler") 14 | m := make(map[string]string) 15 | m["PageTitle"] = "My Profile" 16 | env.TemplateSet.Render("profile_content", &isokit.RenderParams{Data: m, Disposition: isokit.PlacementReplaceInnerContents, Element: env.PrimaryContent}) 17 | }) 18 | } 19 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/client/handlers/profile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/EngineerKamesh/gofullstack/volume3/section4/gopherface/client/common" 7 | 8 | "go.isomorphicgo.org/go/isokit" 9 | ) 10 | 11 | func ProfileHandler(env *common.Env) isokit.Handler { 12 | return isokit.HandlerFunc(func(ctx context.Context) { 13 | 14 | }) 15 | } 16 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/common/asyncq/task.go: -------------------------------------------------------------------------------- 1 | package asyncq 2 | 3 | type Task interface { 4 | Perform() 5 | } 6 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "github.com/EngineerKamesh/gofullstack/volume3/section4/gopherface/common/datastore" 5 | "go.isomorphicgo.org/go/isokit" 6 | ) 7 | 8 | type Env struct { 9 | DB datastore.Datastore 10 | TemplateSet *isokit.TemplateSet 11 | } 12 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/common/utility/sha256.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "crypto/sha256" 5 | "fmt" 6 | ) 7 | 8 | func SHA256OfString(input string) string { 9 | 10 | sum := sha256.Sum256([]byte(input)) 11 | return fmt.Sprintf("%x", sum) 12 | 13 | } 14 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/common/utility/uuid.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | ) 8 | 9 | func GenerateUUID() string { 10 | f, err := os.Open("/dev/urandom") 11 | if err != nil { 12 | log.Println("Encountered the following error when attempting to generate an UUID: ", err) 13 | return "" 14 | } 15 | b := make([]byte, 16) 16 | f.Read(b) 17 | f.Close() 18 | uuid := fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:]) 19 | return uuid 20 | } 21 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/endpoints/createpost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func CreatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the create post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/endpoints/deletepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func DeletePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the delete post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/endpoints/updatepost.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "net/http" 4 | 5 | func UpdatePostEndpoint(w http.ResponseWriter, r *http.Request) { 6 | 7 | // TODO: Implement the update post endpoint 8 | 9 | } 10 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/gopherface: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section4/gopherface/gopherface -------------------------------------------------------------------------------- /volume3/section4/gopherface/handlers/feed.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/EngineerKamesh/gofullstack/volume3/section4/gopherface/common" 7 | 8 | "go.isomorphicgo.org/go/isokit" 9 | ) 10 | 11 | func FeedHandler(env *common.Env) http.HandlerFunc { 12 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 13 | m := make(map[string]string) 14 | m["PageTitle"] = "Feed" 15 | env.TemplateSet.Render("feed_page", &isokit.RenderParams{Writer: w, Data: m}) 16 | }) 17 | } 18 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/handlers/find.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FindHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/handlers/foo.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func FooHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | fooID := r.Context().Value("fooID").(string) 10 | w.Write([]byte(fooID)) 11 | 12 | } 13 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/handlers/friends.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go.isomorphicgo.org/go/isokit" 7 | 8 | "github.com/EngineerKamesh/gofullstack/volume3/section4/gopherface/common" 9 | ) 10 | 11 | func FriendsHandler(env *common.Env) http.HandlerFunc { 12 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 13 | m := make(map[string]string) 14 | m["PageTitle"] = "Friends" 15 | env.TemplateSet.Render("friends_page", &isokit.RenderParams{Writer: w, Data: m}) 16 | }) 17 | } 18 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/handlers/handlers.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "os" 4 | 5 | var WebAppRoot = os.Getenv("GOPHERFACE_APP_ROOT") 6 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/handlers/home.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func HomeHandler(w http.ResponseWriter, r *http.Request) { 9 | 10 | fmt.Println("home page handler reached") 11 | } 12 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/handlers/logout.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/EngineerKamesh/gofullstack/volume3/section4/gopherface/common/authenticate" 7 | ) 8 | 9 | func LogoutHandler(w http.ResponseWriter, r *http.Request) { 10 | 11 | authenticate.ExpireUserSession(w, r) 12 | authenticate.ExpireSecureCookie(w, r) 13 | } 14 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/handlers/myprofile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go.isomorphicgo.org/go/isokit" 7 | 8 | "github.com/EngineerKamesh/gofullstack/volume3/section4/gopherface/common" 9 | ) 10 | 11 | func MyProfileHandler(env *common.Env) http.HandlerFunc { 12 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 13 | 14 | m := make(map[string]string) 15 | m["PageTitle"] = "My Profile" 16 | env.TemplateSet.Render("profile_page", &isokit.RenderParams{Writer: w, Data: m}) 17 | }) 18 | } 19 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/handlers/panic.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func TriggerPanicHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | panic("Triggering a Panic!") 10 | } 11 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/handlers/profile.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func ProfileHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | w.Write([]byte("profile")) 10 | 11 | } 12 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/handlers/register.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func RegisterHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/middleware/panicrecovery.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | ) 7 | 8 | func PanicRecoveryHandler(next http.Handler) http.Handler { 9 | 10 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 11 | 12 | defer func() { 13 | 14 | if err := recover(); err != nil { 15 | log.Printf("Encountered panic: %+v", err) 16 | http.Error(w, http.StatusText(500), 500) 17 | } 18 | 19 | }() 20 | 21 | next.ServeHTTP(w, r) 22 | 23 | }) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/models/socialmedia/moodstate_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=MoodState"; DO NOT EDIT 2 | 3 | package socialmedia 4 | 5 | import "fmt" 6 | 7 | const _MoodState_name = "MoodStateNeutralMoodStateHappyMoodStateSadMoodStateAngryMoodStateHopefulMoodStateThrilledMoodStateBoredMoodStateShyMoodStateComicalMoodStateOnCloudNine" 8 | 9 | var _MoodState_index = [...]uint8{0, 16, 30, 42, 56, 72, 89, 103, 115, 131, 151} 10 | 11 | func (i MoodState) String() string { 12 | if i < 0 || i >= MoodState(len(_MoodState_index)-1) { 13 | return fmt.Sprintf("MoodState(%d)", i) 14 | } 15 | return _MoodState_name[_MoodState_index[i]:_MoodState_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/static/imageset/0083d2f4a81588ed85c06679e68d9855754b498d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section4/gopherface/static/imageset/0083d2f4a81588ed85c06679e68d9855754b498d.png -------------------------------------------------------------------------------- /volume3/section4/gopherface/static/imageset/142cb526f8d5602ec97b674804768d4eb9c1d8b3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section4/gopherface/static/imageset/142cb526f8d5602ec97b674804768d4eb9c1d8b3.png -------------------------------------------------------------------------------- /volume3/section4/gopherface/static/imageset/21ea6a171c98374b61ffceea7146da1ecaef14d9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section4/gopherface/static/imageset/21ea6a171c98374b61ffceea7146da1ecaef14d9.png -------------------------------------------------------------------------------- /volume3/section4/gopherface/static/imageset/68e3075133cf704244c2b2a61d78fa9adabdf678.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section4/gopherface/static/imageset/68e3075133cf704244c2b2a61d78fa9adabdf678.png -------------------------------------------------------------------------------- /volume3/section4/gopherface/static/imageset/85a586dc6db1483f6014819972e6d709a03e7801.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section4/gopherface/static/imageset/85a586dc6db1483f6014819972e6d709a03e7801.png -------------------------------------------------------------------------------- /volume3/section4/gopherface/static/imageset/8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section4/gopherface/static/imageset/8f8a8c9921ed370dbf405d3c3d7d6e73b82a8ac5.png -------------------------------------------------------------------------------- /volume3/section4/gopherface/static/imageset/a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section4/gopherface/static/imageset/a3d046688ad17ab84d6c6fe79d2167aceba49f7f.png -------------------------------------------------------------------------------- /volume3/section4/gopherface/static/imageset/c1e4861d325e29731efd9e9abc760eacf3d9be8b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section4/gopherface/static/imageset/c1e4861d325e29731efd9e9abc760eacf3d9be8b.png -------------------------------------------------------------------------------- /volume3/section4/gopherface/static/imageset/c923378f14eba979d8e81db2fa8259f211af4870.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section4/gopherface/static/imageset/c923378f14eba979d8e81db2fa8259f211af4870.png -------------------------------------------------------------------------------- /volume3/section4/gopherface/static/js/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section4/gopherface/static/js/.gitkeep -------------------------------------------------------------------------------- /volume3/section4/gopherface/static/uploads/images/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded image files. 2 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/static/uploads/videos/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded video files. 2 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/static/videoset/3DGopher.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section4/gopherface/static/videoset/3DGopher.mp4 -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/feed_content.html: -------------------------------------------------------------------------------- 1 |

{{.PageTitle}}

2 | 3 |

Social media feed goes here.

4 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/feed_page.html: -------------------------------------------------------------------------------- 1 | {{ define "pagecontent" }} 2 | {{template "feed_content" .}} 3 | {{end}} 4 | {{template "webpage" . }} 5 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/friends_content.html: -------------------------------------------------------------------------------- 1 |

{{.PageTitle}}

2 | 3 |

List of friends goes here.

4 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/friends_page.html: -------------------------------------------------------------------------------- 1 | {{ define "pagecontent" }} 2 | {{template "friends_content" .}} 3 | {{end}} 4 | {{template "webpage" . }} 5 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - {{.PageTitle}} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/imagepreview.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 |

{{.PageTitle}}

3 |
4 | 5 |
6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 | 16 | {{template "footer.html" .}} 17 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section4/gopherface/templates/index.html -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/profile_content.html: -------------------------------------------------------------------------------- 1 |

{{.PageTitle}}

2 | 3 |

My profile goes here.

4 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/profile_page.html: -------------------------------------------------------------------------------- 1 | {{ define "pagecontent" }} 2 | {{template "profile_content" .}} 3 | {{end}} 4 | {{template "webpage" . }} 5 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/signupconfirmation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - Sign Up Confirmation 4 | 5 | 6 | 7 |

GopherFace - Sign Up Confirmation

8 | 9 | 10 |

Thank you {{.Fields.firstName}}!

11 |

We have received your form submission!

12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/uploadimageform.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 | 3 |

 

4 | 5 |
6 |
7 |
8 | 9 |
10 | 11 | 12 |
13 | 14 | 15 | 16 |
17 | 18 |
19 | 20 | {{template "footer.html" .}} 21 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/videopreview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

GopherFace - Video Preview

8 | 9 |
10 | 11 |
12 | 13 | 14 |
15 | 16 |
17 | 21 |
22 | 23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /volume3/section4/gopherface/templates/webpage.html: -------------------------------------------------------------------------------- 1 | {{ template "gatedheader" . }} 2 |
3 | {{ template "pagecontent" . }} 4 |
5 | {{ template "footer" . }} 6 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/client/common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "go.isomorphicgo.org/go/isokit" 5 | "honnef.co/go/js/dom" 6 | ) 7 | 8 | type Env struct { 9 | TemplateSet *isokit.TemplateSet 10 | Window dom.Window 11 | Document dom.Document 12 | PrimaryContent dom.Element 13 | } 14 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/client/handlers/handlers.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "honnef.co/go/js/dom" 4 | 5 | var D = dom.GetWindow().Document().(dom.HTMLDocument) 6 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/common/asyncq/task.go: -------------------------------------------------------------------------------- 1 | package asyncq 2 | 3 | type Task interface { 4 | Perform() 5 | } 6 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "github.com/EngineerKamesh/gofullstack/volume3/section5/gopherface/common/datastore" 5 | "go.isomorphicgo.org/go/isokit" 6 | ) 7 | 8 | type Env struct { 9 | DB datastore.Datastore 10 | TemplateSet *isokit.TemplateSet 11 | } 12 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/common/utility/sha256.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "crypto/sha256" 5 | "fmt" 6 | ) 7 | 8 | func SHA256OfString(input string) string { 9 | 10 | sum := sha256.Sum256([]byte(input)) 11 | return fmt.Sprintf("%x", sum) 12 | 13 | } 14 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/common/utility/uuid.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | ) 8 | 9 | func GenerateUUID() string { 10 | f, err := os.Open("/dev/urandom") 11 | if err != nil { 12 | log.Println("Encountered the following error when attempting to generate an UUID: ", err) 13 | return "" 14 | } 15 | b := make([]byte, 16) 16 | f.Read(b) 17 | f.Close() 18 | uuid := fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:]) 19 | return uuid 20 | } 21 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/endpoints/endpoints.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "os" 4 | 5 | var WebAppRoot = os.Getenv("GOPHERFACE_APP_ROOT") 6 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/handlers/find.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FindHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/handlers/foo.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func FooHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | fooID := r.Context().Value("fooID").(string) 10 | w.Write([]byte(fooID)) 11 | 12 | } 13 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/handlers/friends.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go.isomorphicgo.org/go/isokit" 7 | 8 | "github.com/EngineerKamesh/gofullstack/volume3/section5/gopherface/common" 9 | ) 10 | 11 | func FriendsHandler(env *common.Env) http.HandlerFunc { 12 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 13 | m := make(map[string]string) 14 | m["PageTitle"] = "Friends" 15 | env.TemplateSet.Render("friends_page", &isokit.RenderParams{Writer: w, Data: m}) 16 | }) 17 | } 18 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/handlers/handlers.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "os" 4 | 5 | var WebAppRoot = os.Getenv("GOPHERFACE_APP_ROOT") 6 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/handlers/home.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func HomeHandler(w http.ResponseWriter, r *http.Request) { 9 | 10 | fmt.Println("home page handler reached") 11 | } 12 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/handlers/logout.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/EngineerKamesh/gofullstack/volume3/section5/gopherface/common/authenticate" 7 | ) 8 | 9 | func LogoutHandler(w http.ResponseWriter, r *http.Request) { 10 | 11 | authenticate.ExpireUserSession(w, r) 12 | authenticate.ExpireSecureCookie(w, r) 13 | } 14 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/handlers/panic.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func TriggerPanicHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | panic("Triggering a Panic!") 10 | } 11 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/handlers/register.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func RegisterHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/middleware/panicrecovery.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | ) 7 | 8 | func PanicRecoveryHandler(next http.Handler) http.Handler { 9 | 10 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 11 | 12 | defer func() { 13 | 14 | if err := recover(); err != nil { 15 | log.Printf("Encountered panic: %+v", err) 16 | http.Error(w, http.StatusText(500), 500) 17 | } 18 | 19 | }() 20 | 21 | next.ServeHTTP(w, r) 22 | 23 | }) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/models/gopher.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | type Gopher struct { 4 | UUID string `json:"uuid" bson:"uuid"` 5 | Username string `json:"username" bson:"username"` 6 | FirstName string `json:"firstName" bson:"firstName"` 7 | LastName string `json:"lastName" bson:"lastName"` 8 | Location string `json:"location" bson:"location"` 9 | ProfileImagePath string `json:"profileImagePath" bson:"profileImagePath"` 10 | } 11 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/models/socialmedia/moodstate_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=MoodState"; DO NOT EDIT 2 | 3 | package socialmedia 4 | 5 | import "fmt" 6 | 7 | const _MoodState_name = "MoodStateNeutralMoodStateHappyMoodStateSadMoodStateAngryMoodStateHopefulMoodStateThrilledMoodStateBoredMoodStateShyMoodStateComicalMoodStateOnCloudNine" 8 | 9 | var _MoodState_index = [...]uint8{0, 16, 30, 42, 56, 72, 89, 103, 115, 131, 151} 10 | 11 | func (i MoodState) String() string { 12 | if i < 0 || i >= MoodState(len(_MoodState_index)-1) { 13 | return fmt.Sprintf("MoodState(%d)", i) 14 | } 15 | return _MoodState_name[_MoodState_index[i]:_MoodState_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/models/userprofile.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import "github.com/EngineerKamesh/gofullstack/volume3/section5/gopherface/forms" 4 | 5 | type UserProfile struct { 6 | PageTitle string `json:"pageTitle", bson:"pageTitle"` 7 | UUID string `json:"uuid" bson:"uuid"` 8 | Username string `json:"username" bson:"username"` 9 | About string `json:"about" bson:"about"` 10 | Location string `json:"location" bson:"location"` 11 | Interests string `json:"interests" bson:"interests"` 12 | ProfileImagePath string `json:"profileImagePath" bson:"profileImagePath"` 13 | Form *forms.MyProfileForm 14 | } 15 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/images/.gitkeep -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/images/gogopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/images/gogopher.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/imageset/3DGopher_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/imageset/3DGopher_blue.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/imageset/3DGopher_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/imageset/3DGopher_green.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/imageset/3DGopher_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/imageset/3DGopher_red.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/imageset/3DGopher_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/imageset/3DGopher_yellow.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/imageset/Aerol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/imageset/Aerol.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/imageset/Case.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/imageset/Case.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/imageset/Flatline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/imageset/Flatline.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/imageset/Jane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/imageset/Jane.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/imageset/Linda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/imageset/Linda.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/imageset/Marie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/imageset/Marie.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/imageset/Molly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/imageset/Molly.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/imageset/Riviera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/imageset/Riviera.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/imageset/Wintermute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/imageset/Wintermute.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/js/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/js/.gitkeep -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/0ef62347-cead-bfbf-6d23-7cdd84f8b080.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/0ef62347-cead-bfbf-6d23-7cdd84f8b080.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/0ef62347-cead-bfbf-6d23-7cdd84f8b080_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/0ef62347-cead-bfbf-6d23-7cdd84f8b080_thumb.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/2c2ef747-38b9-9968-8215-ce28099a8b63.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/2c2ef747-38b9-9968-8215-ce28099a8b63.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/2c2ef747-38b9-9968-8215-ce28099a8b63_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/2c2ef747-38b9-9968-8215-ce28099a8b63_thumb.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/38a52ac9-7704-60e7-b690-abfec7309162.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/38a52ac9-7704-60e7-b690-abfec7309162.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/38a52ac9-7704-60e7-b690-abfec7309162_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/38a52ac9-7704-60e7-b690-abfec7309162_thumb.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6_thumb.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/5a4cd16c-93f1-5bff-cefb-5173e6d8f941.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/5a4cd16c-93f1-5bff-cefb-5173e6d8f941.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/5a4cd16c-93f1-5bff-cefb-5173e6d8f941_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/5a4cd16c-93f1-5bff-cefb-5173e6d8f941_thumb.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/605f6d17-d3f2-9090-ada7-27e72d1ebf72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/605f6d17-d3f2-9090-ada7-27e72d1ebf72.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/605f6d17-d3f2-9090-ada7-27e72d1ebf72_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/605f6d17-d3f2-9090-ada7-27e72d1ebf72_thumb.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/6f3196b0-ccdc-c335-3984-f1e6b206e6a1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/6f3196b0-ccdc-c335-3984-f1e6b206e6a1.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/6f3196b0-ccdc-c335-3984-f1e6b206e6a1_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/6f3196b0-ccdc-c335-3984-f1e6b206e6a1_thumb.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/8440908b-d565-e3ec-a16c-0b3560c806a2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/8440908b-d565-e3ec-a16c-0b3560c806a2.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/8440908b-d565-e3ec-a16c-0b3560c806a2_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/8440908b-d565-e3ec-a16c-0b3560c806a2_thumb.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/b2dcbd58-9489-132e-b393-9965aa40d146.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/b2dcbd58-9489-132e-b393-9965aa40d146.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/b2dcbd58-9489-132e-b393-9965aa40d146_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/b2dcbd58-9489-132e-b393-9965aa40d146_thumb.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/c868ac58-d7b6-f0b4-93f1-4d7249f55226.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/c868ac58-d7b6-f0b4-93f1-4d7249f55226.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/c868ac58-d7b6-f0b4-93f1-4d7249f55226_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/c868ac58-d7b6-f0b4-93f1-4d7249f55226_thumb.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/f79db6c9-3189-20c0-f0fc-bbe5e5f57335.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/f79db6c9-3189-20c0-f0fc-bbe5e5f57335.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/f79db6c9-3189-20c0-f0fc-bbe5e5f57335_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/uploads/images/f79db6c9-3189-20c0-f0fc-bbe5e5f57335_thumb.png -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/images/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded image files. 2 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/uploads/videos/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded video files. 2 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/static/videoset/3DGopher.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/static/videoset/3DGopher.mp4 -------------------------------------------------------------------------------- /volume3/section5/gopherface/templates/feed_page.html: -------------------------------------------------------------------------------- 1 | {{ define "pagecontent" }} 2 | {{template "feed_content" .}} 3 | {{end}} 4 | {{template "webpage" . }} 5 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/templates/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/templates/friends_content.html: -------------------------------------------------------------------------------- 1 |

{{.PageTitle}}

2 | 3 |

Use the search field to find new friends!

4 | 5 |
6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/templates/friends_page.html: -------------------------------------------------------------------------------- 1 | {{ define "pagecontent" }} 2 | {{template "friends_content" .}} 3 | {{end}} 4 | {{template "webpage" . }} 5 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/templates/gopherprofile_page.html: -------------------------------------------------------------------------------- 1 | {{ define "pagecontent" }} 2 | {{template "gopherprofile_content" .}} 3 | {{end}} 4 | {{template "webpage" . }} 5 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/templates/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - {{.PageTitle}} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/templates/imagepreview.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 |

{{.PageTitle}}

3 |
4 | 5 |
6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 | 16 | {{template "footer.html" .}} 17 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/templates/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume3/section5/gopherface/templates/index.html -------------------------------------------------------------------------------- /volume3/section5/gopherface/templates/myprofile_page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ define "pagecontent" }} 4 | {{template "myprofile_content" .}} 5 | {{end}} 6 | {{template "webpage" . }} 7 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/templates/signupconfirmation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - Sign Up Confirmation 4 | 5 | 6 | 7 |

GopherFace - Sign Up Confirmation

8 | 9 | 10 |

Thank you {{.Fields.firstName}}!

11 |

We have received your form submission!

12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/templates/uploadimageform.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 | 3 |

 

4 | 5 |
6 |
7 |
8 | 9 |
10 | 11 | 12 |
13 | 14 | 15 | 16 |
17 | 18 |
19 | 20 | {{template "footer.html" .}} 21 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/templates/videopreview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

GopherFace - Video Preview

8 | 9 |
10 | 11 |
12 | 13 | 14 |
15 | 16 |
17 | 21 |
22 | 23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /volume3/section5/gopherface/templates/webpage.html: -------------------------------------------------------------------------------- 1 | {{ template "gatedheader" . }} 2 |
3 | {{ template "pagecontent" . }} 4 |
5 | {{ template "footer" . }} 6 | -------------------------------------------------------------------------------- /volume4/section1/config/iptables.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Restore iptables firewall rules 3 | Before=network-pre.target 4 | 5 | [Service] 6 | Type=oneshot 7 | ExecStart=/sbin/iptables-restore -n /etc/iptables.conf 8 | 9 | [Install] 10 | WantedBy=multi-user.target 11 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/client/common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "go.isomorphicgo.org/go/isokit" 5 | "honnef.co/go/js/dom" 6 | ) 7 | 8 | type Env struct { 9 | TemplateSet *isokit.TemplateSet 10 | Window dom.Window 11 | Document dom.Document 12 | PrimaryContent dom.Element 13 | } 14 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/client/handlers/handlers.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "honnef.co/go/js/dom" 4 | 5 | var D = dom.GetWindow().Document().(dom.HTMLDocument) 6 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/common/asyncq/task.go: -------------------------------------------------------------------------------- 1 | package asyncq 2 | 3 | type Task interface { 4 | Perform() 5 | } 6 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "github.com/EngineerKamesh/gofullstack/volume4/section2/gopherface/common/datastore" 5 | "go.isomorphicgo.org/go/isokit" 6 | ) 7 | 8 | type Env struct { 9 | DB datastore.Datastore 10 | TemplateSet *isokit.TemplateSet 11 | } 12 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/common/utility/sha256.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "crypto/sha256" 5 | "fmt" 6 | ) 7 | 8 | func SHA256OfString(input string) string { 9 | 10 | sum := sha256.Sum256([]byte(input)) 11 | return fmt.Sprintf("%x", sum) 12 | 13 | } 14 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/common/utility/uuid.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | ) 8 | 9 | func GenerateUUID() string { 10 | f, err := os.Open("/dev/urandom") 11 | if err != nil { 12 | log.Println("Encountered the following error when attempting to generate an UUID: ", err) 13 | return "" 14 | } 15 | b := make([]byte, 16) 16 | f.Read(b) 17 | f.Close() 18 | uuid := fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:]) 19 | return uuid 20 | } 21 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/config/gopherface.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=GOPHERFACE 3 | [Service] 4 | USER=gopherface 5 | GROUP=gopherface 6 | Environment=GOPHERFACE_APP_ROOT=/home/gopherface/gopherface 7 | Environment=GOPHERFACE_HASH_KEY=CRKVBJs0kfyeQ9Y1 8 | Environment=GOPHERFACE_BLOCK_KEY=9LtmRLzVH27CwxrO 9 | WorkingDirectory=/home/gopherface/gopherface 10 | ExecStart=/home/gopherface/gopherface/gopherface 11 | Restart=always 12 | [Install] 13 | WantedBy=multi-user.target 14 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/endpoints/endpoints.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "os" 4 | 5 | var WebAppRoot = os.Getenv("GOPHERFACE_APP_ROOT") 6 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/handlers/find.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FindHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/handlers/foo.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func FooHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | fooID := r.Context().Value("fooID").(string) 10 | w.Write([]byte(fooID)) 11 | 12 | } 13 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/handlers/friends.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go.isomorphicgo.org/go/isokit" 7 | 8 | "github.com/EngineerKamesh/gofullstack/volume4/section2/gopherface/common" 9 | ) 10 | 11 | func FriendsHandler(env *common.Env) http.HandlerFunc { 12 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 13 | m := make(map[string]string) 14 | m["PageTitle"] = "Friends" 15 | env.TemplateSet.Render("friends_page", &isokit.RenderParams{Writer: w, Data: m}) 16 | }) 17 | } 18 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/handlers/handlers.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "os" 4 | 5 | var WebAppRoot = os.Getenv("GOPHERFACE_APP_ROOT") 6 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/handlers/home.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func HomeHandler(w http.ResponseWriter, r *http.Request) { 9 | 10 | fmt.Println("home page handler reached") 11 | } 12 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/handlers/logout.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/EngineerKamesh/gofullstack/volume4/section2/gopherface/common/authenticate" 7 | ) 8 | 9 | func LogoutHandler(w http.ResponseWriter, r *http.Request) { 10 | 11 | authenticate.ExpireUserSession(w, r) 12 | authenticate.ExpireSecureCookie(w, r) 13 | } 14 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/handlers/panic.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func TriggerPanicHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | panic("Triggering a Panic!") 10 | } 11 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/handlers/register.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func RegisterHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/middleware/panicrecovery.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | ) 7 | 8 | func PanicRecoveryHandler(next http.Handler) http.Handler { 9 | 10 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 11 | 12 | defer func() { 13 | 14 | if err := recover(); err != nil { 15 | log.Printf("Encountered panic: %+v", err) 16 | http.Error(w, http.StatusText(500), 500) 17 | } 18 | 19 | }() 20 | 21 | next.ServeHTTP(w, r) 22 | 23 | }) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/models/gopher.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | type Gopher struct { 4 | UUID string `json:"uuid" bson:"uuid"` 5 | Username string `json:"username" bson:"username"` 6 | FirstName string `json:"firstName" bson:"firstName"` 7 | LastName string `json:"lastName" bson:"lastName"` 8 | Location string `json:"location" bson:"location"` 9 | ProfileImagePath string `json:"profileImagePath" bson:"profileImagePath"` 10 | } 11 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/models/socialmedia/moodstate_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=MoodState"; DO NOT EDIT 2 | 3 | package socialmedia 4 | 5 | import "fmt" 6 | 7 | const _MoodState_name = "MoodStateNeutralMoodStateHappyMoodStateSadMoodStateAngryMoodStateHopefulMoodStateThrilledMoodStateBoredMoodStateShyMoodStateComicalMoodStateOnCloudNine" 8 | 9 | var _MoodState_index = [...]uint8{0, 16, 30, 42, 56, 72, 89, 103, 115, 131, 151} 10 | 11 | func (i MoodState) String() string { 12 | if i < 0 || i >= MoodState(len(_MoodState_index)-1) { 13 | return fmt.Sprintf("MoodState(%d)", i) 14 | } 15 | return _MoodState_name[_MoodState_index[i]:_MoodState_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/models/userprofile.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import "github.com/EngineerKamesh/gofullstack/volume4/section2/gopherface/forms" 4 | 5 | type UserProfile struct { 6 | PageTitle string `json:"pageTitle", bson:"pageTitle"` 7 | UUID string `json:"uuid" bson:"uuid"` 8 | Username string `json:"username" bson:"username"` 9 | About string `json:"about" bson:"about"` 10 | Location string `json:"location" bson:"location"` 11 | Interests string `json:"interests" bson:"interests"` 12 | ProfileImagePath string `json:"profileImagePath" bson:"profileImagePath"` 13 | Form *forms.MyProfileForm 14 | } 15 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/images/.gitkeep -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/images/gogopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/images/gogopher.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/imageset/3DGopher_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/imageset/3DGopher_blue.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/imageset/3DGopher_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/imageset/3DGopher_green.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/imageset/3DGopher_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/imageset/3DGopher_red.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/imageset/3DGopher_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/imageset/3DGopher_yellow.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/imageset/Aerol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/imageset/Aerol.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/imageset/Case.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/imageset/Case.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/imageset/Flatline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/imageset/Flatline.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/imageset/Jane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/imageset/Jane.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/imageset/Linda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/imageset/Linda.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/imageset/Marie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/imageset/Marie.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/imageset/Molly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/imageset/Molly.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/imageset/Riviera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/imageset/Riviera.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/imageset/Wintermute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/imageset/Wintermute.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/js/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/js/.gitkeep -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/0ef62347-cead-bfbf-6d23-7cdd84f8b080.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/0ef62347-cead-bfbf-6d23-7cdd84f8b080.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/0ef62347-cead-bfbf-6d23-7cdd84f8b080_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/0ef62347-cead-bfbf-6d23-7cdd84f8b080_thumb.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/2c2ef747-38b9-9968-8215-ce28099a8b63.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/2c2ef747-38b9-9968-8215-ce28099a8b63.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/2c2ef747-38b9-9968-8215-ce28099a8b63_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/2c2ef747-38b9-9968-8215-ce28099a8b63_thumb.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/38a52ac9-7704-60e7-b690-abfec7309162.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/38a52ac9-7704-60e7-b690-abfec7309162.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/38a52ac9-7704-60e7-b690-abfec7309162_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/38a52ac9-7704-60e7-b690-abfec7309162_thumb.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6_thumb.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/5a4cd16c-93f1-5bff-cefb-5173e6d8f941.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/5a4cd16c-93f1-5bff-cefb-5173e6d8f941.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/5a4cd16c-93f1-5bff-cefb-5173e6d8f941_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/5a4cd16c-93f1-5bff-cefb-5173e6d8f941_thumb.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/605f6d17-d3f2-9090-ada7-27e72d1ebf72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/605f6d17-d3f2-9090-ada7-27e72d1ebf72.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/605f6d17-d3f2-9090-ada7-27e72d1ebf72_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/605f6d17-d3f2-9090-ada7-27e72d1ebf72_thumb.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/6f3196b0-ccdc-c335-3984-f1e6b206e6a1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/6f3196b0-ccdc-c335-3984-f1e6b206e6a1.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/6f3196b0-ccdc-c335-3984-f1e6b206e6a1_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/6f3196b0-ccdc-c335-3984-f1e6b206e6a1_thumb.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/8440908b-d565-e3ec-a16c-0b3560c806a2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/8440908b-d565-e3ec-a16c-0b3560c806a2.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/8440908b-d565-e3ec-a16c-0b3560c806a2_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/8440908b-d565-e3ec-a16c-0b3560c806a2_thumb.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/b2dcbd58-9489-132e-b393-9965aa40d146.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/b2dcbd58-9489-132e-b393-9965aa40d146.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/b2dcbd58-9489-132e-b393-9965aa40d146_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/b2dcbd58-9489-132e-b393-9965aa40d146_thumb.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/c3265e18-bf0c-fcd4-8581-d688c289e773.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/c3265e18-bf0c-fcd4-8581-d688c289e773.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/c3265e18-bf0c-fcd4-8581-d688c289e773_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/c3265e18-bf0c-fcd4-8581-d688c289e773_thumb.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/c868ac58-d7b6-f0b4-93f1-4d7249f55226.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/c868ac58-d7b6-f0b4-93f1-4d7249f55226.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/c868ac58-d7b6-f0b4-93f1-4d7249f55226_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/c868ac58-d7b6-f0b4-93f1-4d7249f55226_thumb.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/f79db6c9-3189-20c0-f0fc-bbe5e5f57335.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/f79db6c9-3189-20c0-f0fc-bbe5e5f57335.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/f79db6c9-3189-20c0-f0fc-bbe5e5f57335_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/uploads/images/f79db6c9-3189-20c0-f0fc-bbe5e5f57335_thumb.png -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/images/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded image files. 2 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/uploads/videos/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded video files. 2 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/static/videoset/3DGopher.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/static/videoset/3DGopher.mp4 -------------------------------------------------------------------------------- /volume4/section2/gopherface/templates/feed_page.html: -------------------------------------------------------------------------------- 1 | {{ define "pagecontent" }} 2 | {{template "feed_content" .}} 3 | {{end}} 4 | {{template "webpage" . }} 5 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/templates/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/templates/friends_content.html: -------------------------------------------------------------------------------- 1 |

{{.PageTitle}}

2 | 3 |

Use the search field to find new friends!

4 | 5 |
6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/templates/friends_page.html: -------------------------------------------------------------------------------- 1 | {{ define "pagecontent" }} 2 | {{template "friends_content" .}} 3 | {{end}} 4 | {{template "webpage" . }} 5 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/templates/gopherprofile_page.html: -------------------------------------------------------------------------------- 1 | {{ define "pagecontent" }} 2 | {{template "gopherprofile_content" .}} 3 | {{end}} 4 | {{template "webpage" . }} 5 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/templates/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - {{.PageTitle}} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/templates/imagepreview.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 |

{{.PageTitle}}

3 |
4 | 5 |
6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 | 16 | {{template "footer.html" .}} 17 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/templates/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section2/gopherface/templates/index.html -------------------------------------------------------------------------------- /volume4/section2/gopherface/templates/myprofile_page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ define "pagecontent" }} 4 | {{template "myprofile_content" .}} 5 | {{end}} 6 | {{template "webpage" . }} 7 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/templates/signupconfirmation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - Sign Up Confirmation 4 | 5 | 6 | 7 |

GopherFace - Sign Up Confirmation

8 | 9 | 10 |

Thank you {{.Fields.firstName}}!

11 |

We have received your form submission!

12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/templates/uploadimageform.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 | 3 |

 

4 | 5 |
6 |
7 |
8 | 9 |
10 | 11 | 12 |
13 | 14 | 15 | 16 |
17 | 18 |
19 | 20 | {{template "footer.html" .}} 21 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/templates/videopreview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

GopherFace - Video Preview

8 | 9 |
10 | 11 |
12 | 13 | 14 |
15 | 16 |
17 | 21 |
22 | 23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /volume4/section2/gopherface/templates/webpage.html: -------------------------------------------------------------------------------- 1 | {{ template "gatedheader" . }} 2 |
3 | {{ template "pagecontent" . }} 4 |
5 | {{ template "footer" . }} 6 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/client/common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "go.isomorphicgo.org/go/isokit" 5 | "honnef.co/go/js/dom" 6 | ) 7 | 8 | type Env struct { 9 | TemplateSet *isokit.TemplateSet 10 | Window dom.Window 11 | Document dom.Document 12 | PrimaryContent dom.Element 13 | } 14 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/client/handlers/handlers.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "honnef.co/go/js/dom" 4 | 5 | var D = dom.GetWindow().Document().(dom.HTMLDocument) 6 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/common/asyncq/task.go: -------------------------------------------------------------------------------- 1 | package asyncq 2 | 3 | type Task interface { 4 | Perform() 5 | } 6 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "github.com/EngineerKamesh/gofullstack/volume4/section3/gopherface/common/datastore" 5 | "go.isomorphicgo.org/go/isokit" 6 | ) 7 | 8 | type Env struct { 9 | DB datastore.Datastore 10 | TemplateSet *isokit.TemplateSet 11 | } 12 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/common/utility/sha256.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "crypto/sha256" 5 | "fmt" 6 | ) 7 | 8 | func SHA256OfString(input string) string { 9 | 10 | sum := sha256.Sum256([]byte(input)) 11 | return fmt.Sprintf("%x", sum) 12 | 13 | } 14 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/common/utility/uuid.go: -------------------------------------------------------------------------------- 1 | package utility 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | ) 8 | 9 | func GenerateUUID() string { 10 | f, err := os.Open("/dev/urandom") 11 | if err != nil { 12 | log.Println("Encountered the following error when attempting to generate an UUID: ", err) 13 | return "" 14 | } 15 | b := make([]byte, 16) 16 | f.Read(b) 17 | f.Close() 18 | uuid := fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:]) 19 | return uuid 20 | } 21 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/config/gopherface-docker.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Dockerized GopherFace 3 | After=docker.service 4 | Requires=docker.service 5 | [Service] 6 | Type=oneshot 7 | RemainAfterExit=yes 8 | WorkingDirectory=/opt/gofullstack/volume4/section3/gopherface 9 | ExecStart=/usr/local/bin/docker-compose -f /opt/gofullstack/volume4/section3/gopherface/docker-compose.yml up -d 10 | ExecStop=/usr/local/bin/docker-compose -f /opt/gofullstack/volume4/section3/gopherface/docker-compose.yml down 11 | [Install] 12 | WantedBy=multi-user.target 13 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/endpoints/endpoints.go: -------------------------------------------------------------------------------- 1 | package endpoints 2 | 3 | import "os" 4 | 5 | var WebAppRoot = os.Getenv("GOPHERFACE_APP_ROOT") 6 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/handlers/find.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func FindHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/handlers/foo.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func FooHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | fooID := r.Context().Value("fooID").(string) 10 | w.Write([]byte(fooID)) 11 | 12 | } 13 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/handlers/friends.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go.isomorphicgo.org/go/isokit" 7 | 8 | "github.com/EngineerKamesh/gofullstack/volume4/section3/gopherface/common" 9 | ) 10 | 11 | func FriendsHandler(env *common.Env) http.HandlerFunc { 12 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 13 | m := make(map[string]string) 14 | m["PageTitle"] = "Friends" 15 | env.TemplateSet.Render("friends_page", &isokit.RenderParams{Writer: w, Data: m}) 16 | }) 17 | } 18 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/handlers/handlers.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "os" 4 | 5 | var WebAppRoot = os.Getenv("GOPHERFACE_APP_ROOT") 6 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/handlers/home.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func HomeHandler(w http.ResponseWriter, r *http.Request) { 9 | 10 | fmt.Println("home page handler reached") 11 | } 12 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/handlers/logout.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/EngineerKamesh/gofullstack/volume4/section3/gopherface/common/authenticate" 7 | ) 8 | 9 | func LogoutHandler(w http.ResponseWriter, r *http.Request) { 10 | 11 | authenticate.ExpireUserSession(w, r) 12 | authenticate.ExpireSecureCookie(w, r) 13 | } 14 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/handlers/panic.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import ( 4 | "net/http" 5 | ) 6 | 7 | func TriggerPanicHandler(w http.ResponseWriter, r *http.Request) { 8 | 9 | panic("Triggering a Panic!") 10 | } 11 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/handlers/register.go: -------------------------------------------------------------------------------- 1 | package handlers 2 | 3 | import "net/http" 4 | 5 | func RegisterHandler(w http.ResponseWriter, r *http.Request) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/middleware/panicrecovery.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | ) 7 | 8 | func PanicRecoveryHandler(next http.Handler) http.Handler { 9 | 10 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 11 | 12 | defer func() { 13 | 14 | if err := recover(); err != nil { 15 | log.Printf("Encountered panic: %+v", err) 16 | http.Error(w, http.StatusText(500), 500) 17 | } 18 | 19 | }() 20 | 21 | next.ServeHTTP(w, r) 22 | 23 | }) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/models/gopher.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | type Gopher struct { 4 | UUID string `json:"uuid" bson:"uuid"` 5 | Username string `json:"username" bson:"username"` 6 | FirstName string `json:"firstName" bson:"firstName"` 7 | LastName string `json:"lastName" bson:"lastName"` 8 | Location string `json:"location" bson:"location"` 9 | ProfileImagePath string `json:"profileImagePath" bson:"profileImagePath"` 10 | } 11 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/models/socialmedia/moodstate_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=MoodState"; DO NOT EDIT 2 | 3 | package socialmedia 4 | 5 | import "fmt" 6 | 7 | const _MoodState_name = "MoodStateNeutralMoodStateHappyMoodStateSadMoodStateAngryMoodStateHopefulMoodStateThrilledMoodStateBoredMoodStateShyMoodStateComicalMoodStateOnCloudNine" 8 | 9 | var _MoodState_index = [...]uint8{0, 16, 30, 42, 56, 72, 89, 103, 115, 131, 151} 10 | 11 | func (i MoodState) String() string { 12 | if i < 0 || i >= MoodState(len(_MoodState_index)-1) { 13 | return fmt.Sprintf("MoodState(%d)", i) 14 | } 15 | return _MoodState_name[_MoodState_index[i]:_MoodState_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/models/userprofile.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import "github.com/EngineerKamesh/gofullstack/volume4/section3/gopherface/forms" 4 | 5 | type UserProfile struct { 6 | PageTitle string `json:"pageTitle", bson:"pageTitle"` 7 | UUID string `json:"uuid" bson:"uuid"` 8 | Username string `json:"username" bson:"username"` 9 | About string `json:"about" bson:"about"` 10 | Location string `json:"location" bson:"location"` 11 | Interests string `json:"interests" bson:"interests"` 12 | ProfileImagePath string `json:"profileImagePath" bson:"profileImagePath"` 13 | Form *forms.MyProfileForm 14 | } 15 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/images/.gitkeep -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/images/gogopher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/images/gogopher.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/imageset/3DGopher_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/imageset/3DGopher_blue.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/imageset/3DGopher_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/imageset/3DGopher_green.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/imageset/3DGopher_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/imageset/3DGopher_red.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/imageset/3DGopher_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/imageset/3DGopher_yellow.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/imageset/Aerol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/imageset/Aerol.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/imageset/Case.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/imageset/Case.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/imageset/Flatline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/imageset/Flatline.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/imageset/Jane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/imageset/Jane.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/imageset/Linda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/imageset/Linda.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/imageset/Marie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/imageset/Marie.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/imageset/Molly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/imageset/Molly.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/imageset/Riviera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/imageset/Riviera.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/imageset/Wintermute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/imageset/Wintermute.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/js/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/js/.gitkeep -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/0ef62347-cead-bfbf-6d23-7cdd84f8b080.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/0ef62347-cead-bfbf-6d23-7cdd84f8b080.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/0ef62347-cead-bfbf-6d23-7cdd84f8b080_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/0ef62347-cead-bfbf-6d23-7cdd84f8b080_thumb.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/2c2ef747-38b9-9968-8215-ce28099a8b63.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/2c2ef747-38b9-9968-8215-ce28099a8b63.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/2c2ef747-38b9-9968-8215-ce28099a8b63_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/2c2ef747-38b9-9968-8215-ce28099a8b63_thumb.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/38a52ac9-7704-60e7-b690-abfec7309162.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/38a52ac9-7704-60e7-b690-abfec7309162.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/38a52ac9-7704-60e7-b690-abfec7309162_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/38a52ac9-7704-60e7-b690-abfec7309162_thumb.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/3cc3af2b-9fb2-86b5-05b5-80e32a08b9d6_thumb.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/5a4cd16c-93f1-5bff-cefb-5173e6d8f941.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/5a4cd16c-93f1-5bff-cefb-5173e6d8f941.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/5a4cd16c-93f1-5bff-cefb-5173e6d8f941_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/5a4cd16c-93f1-5bff-cefb-5173e6d8f941_thumb.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/605f6d17-d3f2-9090-ada7-27e72d1ebf72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/605f6d17-d3f2-9090-ada7-27e72d1ebf72.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/605f6d17-d3f2-9090-ada7-27e72d1ebf72_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/605f6d17-d3f2-9090-ada7-27e72d1ebf72_thumb.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/6f3196b0-ccdc-c335-3984-f1e6b206e6a1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/6f3196b0-ccdc-c335-3984-f1e6b206e6a1.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/6f3196b0-ccdc-c335-3984-f1e6b206e6a1_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/6f3196b0-ccdc-c335-3984-f1e6b206e6a1_thumb.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/8440908b-d565-e3ec-a16c-0b3560c806a2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/8440908b-d565-e3ec-a16c-0b3560c806a2.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/8440908b-d565-e3ec-a16c-0b3560c806a2_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/8440908b-d565-e3ec-a16c-0b3560c806a2_thumb.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/b2dcbd58-9489-132e-b393-9965aa40d146.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/b2dcbd58-9489-132e-b393-9965aa40d146.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/b2dcbd58-9489-132e-b393-9965aa40d146_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/b2dcbd58-9489-132e-b393-9965aa40d146_thumb.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/c3265e18-bf0c-fcd4-8581-d688c289e773.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/c3265e18-bf0c-fcd4-8581-d688c289e773.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/c3265e18-bf0c-fcd4-8581-d688c289e773_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/c3265e18-bf0c-fcd4-8581-d688c289e773_thumb.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/c868ac58-d7b6-f0b4-93f1-4d7249f55226.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/c868ac58-d7b6-f0b4-93f1-4d7249f55226.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/c868ac58-d7b6-f0b4-93f1-4d7249f55226_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/c868ac58-d7b6-f0b4-93f1-4d7249f55226_thumb.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/f79db6c9-3189-20c0-f0fc-bbe5e5f57335.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/f79db6c9-3189-20c0-f0fc-bbe5e5f57335.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/f79db6c9-3189-20c0-f0fc-bbe5e5f57335_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/uploads/images/f79db6c9-3189-20c0-f0fc-bbe5e5f57335_thumb.png -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/images/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded image files. 2 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/uploads/videos/readme.txt: -------------------------------------------------------------------------------- 1 | This directory will store uploaded video files. 2 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/static/videoset/3DGopher.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/static/videoset/3DGopher.mp4 -------------------------------------------------------------------------------- /volume4/section3/gopherface/templates/feed_page.html: -------------------------------------------------------------------------------- 1 | {{ define "pagecontent" }} 2 | {{template "feed_content" .}} 3 | {{end}} 4 | {{template "webpage" . }} 5 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/templates/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/templates/friends_content.html: -------------------------------------------------------------------------------- 1 |

{{.PageTitle}}

2 | 3 |

Use the search field to find new friends!

4 | 5 |
6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/templates/friends_page.html: -------------------------------------------------------------------------------- 1 | {{ define "pagecontent" }} 2 | {{template "friends_content" .}} 3 | {{end}} 4 | {{template "webpage" . }} 5 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/templates/gopherprofile_page.html: -------------------------------------------------------------------------------- 1 | {{ define "pagecontent" }} 2 | {{template "gopherprofile_content" .}} 3 | {{end}} 4 | {{template "webpage" . }} 5 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/templates/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - {{.PageTitle}} 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/templates/imagepreview.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 |

{{.PageTitle}}

3 |
4 | 5 |
6 | 7 | 8 |
9 | 10 |
11 | 12 |
13 | 14 |
15 | 16 | {{template "footer.html" .}} 17 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/templates/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EngineerKamesh/gofullstack/d41341d7d4eec643e6fad0451278a66e6008e26d/volume4/section3/gopherface/templates/index.html -------------------------------------------------------------------------------- /volume4/section3/gopherface/templates/myprofile_page.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ define "pagecontent" }} 4 | {{template "myprofile_content" .}} 5 | {{end}} 6 | {{template "webpage" . }} 7 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/templates/signupconfirmation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | GopherFace - Sign Up Confirmation 4 | 5 | 6 | 7 |

GopherFace - Sign Up Confirmation

8 | 9 | 10 |

Thank you {{.Fields.firstName}}!

11 |

We have received your form submission!

12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/templates/uploadimageform.html: -------------------------------------------------------------------------------- 1 | {{template "gatedheader.html" .}} 2 | 3 |

 

4 | 5 |
6 |
7 |
8 | 9 |
10 | 11 | 12 |
13 | 14 | 15 | 16 |
17 | 18 |
19 | 20 | {{template "footer.html" .}} 21 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/templates/videopreview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

GopherFace - Video Preview

8 | 9 |
10 | 11 |
12 | 13 | 14 |
15 | 16 |
17 | 21 |
22 | 23 |
24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /volume4/section3/gopherface/templates/webpage.html: -------------------------------------------------------------------------------- 1 | {{ template "gatedheader" . }} 2 |
3 | {{ template "pagecontent" . }} 4 |
5 | {{ template "footer" . }} 6 | --------------------------------------------------------------------------------