December 20, 2024

Deploying Telegram Bot to AWS Lambda with Function URL

This article is a continuation of “Building an AI Telegram Bot with Go, Gemini API, and AWS Lambda” and contains detailed instructions for setting up and deploying a Telegram bot to AWS Lambda using Function URL.

Read More → Go Telegram Aws Lambda Deploy Function-Url Cli
December 19, 2024

Building an AI Telegram Bot with Go, Gemini API, and AWS Lambda

In this article, we’ll explore how to build an intelligent Telegram bot using Go that acts as a proxy between users and Google’s Gemini API. The bot will handle two primary functions: answering user messages and generating images. While this mechanism can be significantly extended with additional capabilities like voice and video generation, we’ll focus on these two request types for simplicity.

Read More → Go Telegram Gemini Ai Aws Lambda Bot
July 1, 2020

Remote debugging with Delve

Previously we discussed local debugging with GoLand IDE. Now we’ll discuss how to remotely debug a program running inside a Docker container using Visual Studio Code and GoLand IDE.

Read More → Docker Debugger Delve Vscode Goland
July 1, 2020

Deploy docker swarm from Gitlab CI

Docker container deployment has many advantages over binary deployment. Let’s dive into advantages and see how we can implement docker container deployment from Gitlab CI. Let’s talk about how standard docker can help us. Any docker orchestration tools (Kubernetes, for example) will be observed in future articles.

Deploy docker swarm from Gitlab CI
Read More → Docker Deploy Gitlab Ci/Cd
June 30, 2020

net-wait-go utility / library

Both utility and Go package to wait for ports to open (TCP, UDP).

net-wait-go utility / library
Read More → Tcp Udp Docker
June 29, 2020

Building Minimal Docker Images for Go Applications

Let’s discuss how to build a minimal Docker image for a Go program.

Building Minimal Docker Images for Go Applications
Read More → Docker Compilation Upx Ldflags
May 8, 2020

Compilation and deploy via SSH in Gitlab CI

Let’s take a look at how Go compilation works and how to use GitLab CI for that.

Compilation and deploy via SSH in Gitlab CI
Read More → Gitlab Compilation Deploy Ssh Modules Vendor Ci/Cd
May 2, 2020

HTTP

All examples from the article are located in the github repository.

Let’s take a look at HTTP tools in GO.

Read More → Http Client Server Middleware
May 2, 2020

sync.Map

Let’s take a look at sync.Map usage and its source code.

sync.Map
Read More → Sync.map Map Concurrency
April 23, 2020

Profiling Go: Basics and Practice

Go has rich profiling tools from the very beginning — the pprof package and go tool pprof. Let’s discuss why profiling is useful, how to work with it, and what’s new in this area.

Profiling Go: Basics and Practice
Read More → Profiling Pprof Benchmark Ab Cpu Allocation Remote
April 21, 2020

Dependency injection in GO

Let’s talk about dependency injection pattern and dependency management in large programs.

Dependency injection in GO
Read More → Dependency Injection Container Singleton Multiton
April 9, 2020

GO Templates: Principles and Usage

Packages text/template and html/template are part of the Go standard library. Go templates are used in many Go-programmed software — Docker, Kubernetes, Helm. Many third-party libraries are integrated with Go templates, for example Echo. Knowing Go template syntax is very useful.

This article consists of text/template package documentation and a couple of author’s solutions. After describing Go template syntax, we’ll dive into text/template and html/template sources.

GO Templates: Principles and Usage
Read More → Templates Html Text Sources
April 7, 2020

Filtering by a list of values with GORM

When you need to filter data by a list of values (for example, IDs: 1, 2, 3), you should use the ANY operator combined with pq.Array from the PostgreSQL driver.

Read More → Gorm Sql Postgresql
April 4, 2020

Principles of slice type in GO

The Go blog describes how to use slices. Let’s take a look at slice internals.

Principles of slice type in GO
Read More → Slice Allocation Sources
April 2, 2020

Data handling in concurrent programs

In Go, we have goroutines functionality out of the box. We can run code in parallel. However, in our parallel running code we can work with shared variables, and it is not clear how exactly Go handles such situations.

Data handling in concurrent programs
Read More → Map Sources
April 2, 2020

Principles of map type in GO

The map programming interface in Go is described in the Go blog. We just need to recall that a map is a key-value storage and it should retrieve values by key as fast as possible.

Principles of map type in GO
Read More → Map Sources
March 30, 2020

Coding a Simple TCP Chat in Go

An example of a simple TCP chat in Go with logic explanation.

Read More → Tcp Server Chat
March 30, 2020

Golang regexp: matching newline

Why regular expressions with dot (".") work differently in Go compared to PHP and JavaScript.

Golang regexp: matching newline
Read More → Regular Expressions Sources
March 30, 2020

GORM: filter entity by linked entity

This task is not that simple, especially with GORM.

Read More → Gorm Sql Postgresql
March 24, 2020

Why and how to use a debugger with Go

A debugger is a very helpful and powerful tool. It can help you understand exactly what is happening in your code, explore new projects, and avoid unnecessary debug code changes.

Read More → Debugger Goland