Skip to main content

Create MVC Pattern Using Echo Framework #GolangDev

pixabay.com

Hi, Back again. today I am gonna share about Go Language, yes it is a new programming language that really fast growing this day, so many startup using it, especially in indonesia, there is a Gojek, Dana, Tiket and many more. Go Lang is a programming language found by google engineer, this language is a multi paradigm language, you could use it as functional programming or treat it like an OOP bases.

Echo is an framework that use Golang as a main language, to use a fast and reliable backend/web apps, as you know Golang has a really fast performance than other language, one of the reason is because its compiled not interpreted, so the Echo claim that its 10x faster. insane right ? Actually I didn't test the performance yet, but yeah for newbie like me in golang its not the main thing that you must understand, so the thing that we should know is how we actually can do with Golang. 

I am person with MVC bases, before jump to golang, I have experience with Laravel, you know its typically MVC pattern bases, so to make me comfortable with new environment, I try to treat Golang to be a MVC bases to make a web apps. Hence Golang could do the seem thing without overwhelming to built as MVC.

Firstly install the Echo Framework using go get command, look at the documentation here.

I am using Echo because this framework is already present a router, controller, view unfortunately not the model, so if you need a models, I recomend you to use Gorm. Gorm is a package to manage a model and migration, you could define table and relation in one file model, just like a ORM do. if you dont know ORM, maybe this article will help you. another best thing is Gorm could be your migration too, so you could define a table and column name in the model, and apply the migration from the seem file. it's really good approach and applied DRY principal.

If you already have gorm installed, now you could create fundamental MVC folder structure to grouping the Models, Controller, and Views files.

Because I am people who really like the laravel structure folder, so I put any folder from laravel that I think it might be required. then the structure just link this.




If you know Laravel or Ruby on Rails, you might be familiar.

see the complete code here. Happy coding ^_^

Popular posts from this blog

The Advantage of Using HTTP Default Authorization Scheme #DigitalSecurity

pixabay.com Hello Everyone, This day I would like to introduce you to the default header for authorization in HTTP. HTTP auth scheme is a guide or standardization scheme for the authorization header in the HTTP protocol. this standard is using key Authorization in the header and followed by a value that usually filled by key or token. for example : Authorization : <type> <key/token> this standard is the solution of the key header for authorization that really random was provided by developers to build an authorization header for their application, in my experience, developers used to "token" for their key in the header that usually followed by the hash value. the random key makes developers using more time for writing code for getting header key and validating the value which is you could use the library and focus on writing the logic of your application. Depend on Mozilla site , HTTP auth scheme divided by 4 types, such as : Basic  (see  RF

Laravel Tips : Membuat Model, Migration dan Controller dengan Sekali Jalan

  php artisan adalah generator laravel yang berfungsi untuk membuat file kodingan dengan mudah, seperti membuat controller, model, seeder, migration dan masih banyak lagi. artisan hanya bisa di lakukan di dalam lingkungan console, seperti cmd dan terminal. berikut akan saya tunjukan cara membuat controller, model, migration menggunakan php artisan. # membuat controller ketikkan perintah di bawah ini php artisan make:controller BlogController # membuat model ketikkan perintah di bawah ini php artisan make:model Blog # membuat migration ketikkan perintah di bawah ini php artisan make:migration blog # membuat seeder ketikkan perintah di bawah ini php artisan make:seeder BlogSeeder # membuat migration, controller, dan model sekaligus ketikkan perintah di bawah ini php artisan make:model -crm Blog perintah di atas akan mengenerate controller dengan nama BlogController dengan keadaan Resource method tertulis, model

Typer shark Deluxe free full crack

Typer shark Deluxe : software yang akan membantu kita untuk belajar mengetik keyboard dengan cara 10jari, untuk agan2 yang baru belajar komputer pasti teknik pertama yang dilakukan adalah dengan 11jari (kanan 1 + kiri 1 = 11)hahahaha, softaware ini sangat menarik, karna kita belajar 10jari dengan bermain game.. n gamenya interaktif,,, pkoqnya yang tadinya mengetik 11jari, dalam waktu seminggu pasti bisa lancar 10jari... syaratnya harus tekunn...  kalo agan mau ngunduh silahkan : Download screenshot: