Skip to main content

Posts

Showing posts with the label libray

Creating 2d games with golang and gontuz/prototype

Golang was created as server language. But with the time and curiosity of people, golang has covered GUI application and game development as well. I am sharing here one of the available golang library, on top of which you can create 2d games. Its gonutz/prototype . Sample video Gonutz/prototype is very small and easy to learn library. It's cross-platform , that means the game your are creating in one platform will be able to run on other platforms without any change in code ( in normal case ).  This package currently supports windows , mac and linux. gonutz/prototype features Support for keyboard input Support for mouse input Support for 2d drawing Support for image and sprite-sheets Support for sound  Want to learn more about this package.  Follow my youtube video playlist "2d game development in golang" Video tutorial playlist:   https://www.youtube.com/playlist?list=PLub5C2vM5SjJIF0f561mAON7nFG2nKHD9

golang secure api with jwt

Jwt + Golang For Secured Api For jwt authnetication i am using the  dgrijalva/jwt-go package with my golang project.  First of all fetch packge from repository go get github.com/dgrijalva/jwt-go Now you are ready to use the jwt I am sharing here  my basic code to create secure routes using jwt Here you can see that we have used jwtcheck function as middleware. It processes the request before passing it forward. If request has a valid jwt token than that request get forwarded to the intended function otherwise that request does not forwarded. Hope you find it usefull. If you have any question just ask in comments.

Use Bleve as full text search engine for go app

Bleve Bleve is full-text search library written in go. You can read this article if you are curious to know more about it Short Introduction To Bleve  (medium.com) There are lots of stuff that gives the info about bleve functionality but the problem is they don't provide the way to implement in your project and it is quite difficult for beginners. I am writing this to show how to use bleve with your project for the full text search. There are Four Operations 1. Create index files 2. Index the valid entities. 3. Search through the indices  for output 4. Delete invalid entities. Creating the index files Index the valid entities  You can ( and should ) create multiple index files according to data , need of search and performance You can increase performance by using the go routines to search throgh the mulitple indices concurrently. Search throught the indices for output Using the go routines to search throgh the mulitple indices concurre...