Posts

Building API test client as a Ruby gem

Intro To not be confused, these are not API tests. As title says, this guide will show you how to build API client using Ruby and export it as a gem. This type of client is often needed for some testing purposes. API client in this guide will use server created in my other guide,…

Selenium WebDriver test automation using Golang

Automating web browser is pretty common and it’s nothing new. Selenium is de facto industry standard and there are libraries for various programming languages with most common being Java and Ruby. What’s less common is writing Selenium automated tests using Golang, so this blog post will be exactly about that. Most of the code is…

Fyne (Golang) desktop app with goroutines

Golang is really not the best choice when it comes to developing desktop apps, but it is still possible. One example of viable use case for Golang desktop app would be to quickly add graphical interface for existing CLI app. And Fyne is great framework for that purpose. As stated on their official GitHub page,…

Go modules and private GIT repositories

Some time ago i stumbled upon an issue that was giving me a headache. I had to download and import private Go module, and as it turns out, that can be little tricky. I’m using SSH keys for authenticating with my repositories, so this solution is applied only for that type of authentication.Of course, i…

React Gin Blog (19/19): Docker deploy

Our server is finished and almost ready for deploy, which will be done using Docker. Notice that i said it’s almost ready, so let’s see what is missing. This whole time we used React development server which is listening on port 3000 and redirecting all requests to our backend on port 8080. That makes sense…

React Gin Blog (18/19): Tests

Writing unit and integration tests is important part of software development and it’s something ideally done during development, but in this guide i dedicated one chapter for that since there are some prerequisites required before we can start to write tests. For instance, main thing to do is to create test database. This will be…

React Gin Blog (17/19): Graceful shutdown

If our server process gets signal to shut it down, we would like to finish the request currently handling before that happens. For that we will use graceful shutdown provided by Gin. This example is explained in detail on Gin GitHub with description in comments, so i will not go into details myself. Our internal/server/server.go…

React Gin Blog (16/19): Custom database errors

Custom validation errors are added in previous chapter, but what about database errors? If you try to create account with already existing username, you will get error ERROR #23505 duplicate key value violates unique constraint “users_username_key”. Unfortunately, there is no validator involved here and pg module returns most of the errors as map[byte]string so this…

React Gin Blog (15/19): Custom validation errors

If you try to create new account using too short password, you will get error Key: ‘User.Password’ Error:Field validation for ‘Password’ failed on the ‘min’ tag. This is not really user friendly, so it should be changed for better user experience. Let’s see how we can transform that to our own custom error messages. For…

React Gin Blog (14/19): Add user posts

With authentication in place, it is time to start using it. We will need authentication to create, read, update and delete user’s blog posts. Let’s start by adding new database migration which will create required data table with columns. Create new migration file migrations/2_addPostsTable.go: And then run migrations with: Now we create structure to hold…

Loading…

Something went wrong. Please refresh the page and/or try again.


Follow My Blog

Get new content delivered directly to your inbox.

%d bloggers like this: