<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arsy Opraza on Medium]]></title>
        <description><![CDATA[Stories by Arsy Opraza on Medium]]></description>
        <link>https://medium.com/@arasopraza?source=rss-c2e570d6d519------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*22G9EWfMoiJ4JCjt0f_8iQ.jpeg</url>
            <title>Stories by Arsy Opraza on Medium</title>
            <link>https://medium.com/@arasopraza?source=rss-c2e570d6d519------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 03:27:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arasopraza/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Hubungkan Hermes Agent ke Telegram dalam 4 Langkah]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://arasopraza.medium.com/hubungkan-hermes-agent-ke-telegram-dalam-4-langkah-9d45d3555c4a?source=rss-c2e570d6d519------2"><img src="https://cdn-images-1.medium.com/max/1672/1*QWp22BqKaHvbgkj08wz07A.png" width="1672"></a></p><p class="medium-feed-snippet">Sampai titik ini, Hermes Agent kamu sudah terpasang dan bisa diajak ngobrol lewat terminal.</p><p class="medium-feed-link"><a href="https://arasopraza.medium.com/hubungkan-hermes-agent-ke-telegram-dalam-4-langkah-9d45d3555c4a?source=rss-c2e570d6d519------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://arasopraza.medium.com/hubungkan-hermes-agent-ke-telegram-dalam-4-langkah-9d45d3555c4a?source=rss-c2e570d6d519------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d45d3555c4a</guid>
            <category><![CDATA[hermes-agent]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Arsy Opraza]]></dc:creator>
            <pubDate>Sun, 26 Jul 2026 06:19:45 GMT</pubDate>
            <atom:updated>2026-07-26T06:19:45.931Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Cara Install Hermes Agent di Laptop dan HP (Panduan Langkah demi Langkah)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://arasopraza.medium.com/cara-install-hermes-agent-di-laptop-dan-hp-panduan-langkah-demi-langkah-6110bd09222c?source=rss-c2e570d6d519------2"><img src="https://cdn-images-1.medium.com/max/1672/1*6pyBeCGaWYpamb9vQEILug.png" width="1672"></a></p><p class="medium-feed-snippet">Satu baris teks. Semua platform.</p><p class="medium-feed-link"><a href="https://arasopraza.medium.com/cara-install-hermes-agent-di-laptop-dan-hp-panduan-langkah-demi-langkah-6110bd09222c?source=rss-c2e570d6d519------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://arasopraza.medium.com/cara-install-hermes-agent-di-laptop-dan-hp-panduan-langkah-demi-langkah-6110bd09222c?source=rss-c2e570d6d519------2</link>
            <guid isPermaLink="false">https://medium.com/p/6110bd09222c</guid>
            <category><![CDATA[telegram]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[hermes-agent]]></category>
            <dc:creator><![CDATA[Arsy Opraza]]></dc:creator>
            <pubDate>Fri, 03 Jul 2026 08:13:31 GMT</pubDate>
            <atom:updated>2026-07-03T08:13:31.452Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Cara mengelola diri untuk seorang longlife learner]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://arasopraza.medium.com/cara-mengelola-diri-untuk-seorang-longlife-learner-45436602679c?source=rss-c2e570d6d519------2"><img src="https://cdn-images-1.medium.com/max/2600/0*YQFu3WPJcxYNlbSD" width="5462"></a></p><p class="medium-feed-snippet">Sebagai knowledge worker (pekerja yang menggunakan pengetahuan atau keahlian) belajar di sepanjang hayat perlu dilakukan. Tak hanya&#x2026;</p><p class="medium-feed-link"><a href="https://arasopraza.medium.com/cara-mengelola-diri-untuk-seorang-longlife-learner-45436602679c?source=rss-c2e570d6d519------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://arasopraza.medium.com/cara-mengelola-diri-untuk-seorang-longlife-learner-45436602679c?source=rss-c2e570d6d519------2</link>
            <guid isPermaLink="false">https://medium.com/p/45436602679c</guid>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[lifelong-learning]]></category>
            <category><![CDATA[personal-growth]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[career-development]]></category>
            <dc:creator><![CDATA[Arsy Opraza]]></dc:creator>
            <pubDate>Thu, 02 Jul 2026 09:47:15 GMT</pubDate>
            <atom:updated>2026-07-02T09:47:15.059Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Hermes Agent: Apa dan Kenapa Kamu Perlu Tahu.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://arasopraza.medium.com/hermes-agent-apa-dan-kenapa-kamu-perlu-tahu-01e7531832ad?source=rss-c2e570d6d519------2"><img src="https://cdn-images-1.medium.com/max/1672/1*_pk3GSyG6VbjamExXkuHCg.png" width="1672"></a></p><p class="medium-feed-snippet">Saya mulai pakai Hermes Agent bukan karena saya ahli AI.</p><p class="medium-feed-link"><a href="https://arasopraza.medium.com/hermes-agent-apa-dan-kenapa-kamu-perlu-tahu-01e7531832ad?source=rss-c2e570d6d519------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://arasopraza.medium.com/hermes-agent-apa-dan-kenapa-kamu-perlu-tahu-01e7531832ad?source=rss-c2e570d6d519------2</link>
            <guid isPermaLink="false">https://medium.com/p/01e7531832ad</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[small-business]]></category>
            <category><![CDATA[business-strategy]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Arsy Opraza]]></dc:creator>
            <pubDate>Wed, 24 Jun 2026 13:58:37 GMT</pubDate>
            <atom:updated>2026-06-24T13:58:37.834Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Enhancing Your Back-End System with Amazon SQS]]></title>
            <link>https://levelup.gitconnected.com/enhancing-your-back-end-system-with-amazon-sqs-2e4e5f32a75b?source=rss-c2e570d6d519------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e4e5f32a75b</guid>
            <category><![CDATA[message-queue]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Arsy Opraza]]></dc:creator>
            <pubDate>Tue, 31 Dec 2024 20:40:38 GMT</pubDate>
            <atom:updated>2024-12-31T20:40:38.925Z</atom:updated>
            <content:encoded><![CDATA[<p>I have free time during the year-end holidays, and I need some fun to escape from my daily work routine. In my day-to-day life, I write code in JavaScript/TypeScript and Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dx5Z25hVH84kG0Jj0NX34A.jpeg" /><figcaption>Bali Airport</figcaption></figure><p>A few months ago, I learned and worked on a project using Go, and today, I’m returning to coding with Go (I really love Go, to be honest). So, I’ve decided to explore some fun projects during the holiday and dive into the topic of message queues.</p><p>The first thing I did was explore the structure for Go projects. I came across a repository, <a href="https://github.com/golang-standards/project-layout">https://github.com/golang-standards/project-layout</a>, which shares insights about a standard project layout for Go. (Although, to be fair, there isn’t an official standard for project structure in Go.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/1*MXL_eMXNZQEesUKx887imw.png" /><figcaption>Structure Project</figcaption></figure><p>After that, I created a new project for a RESTful API. The API is simple, featuring a function that allows users to register a new account. Users who successfully register will receive a welcome email.</p><ul><li>cmd is the main application</li><li>db to store the migrations</li><li>internal private application code such as config</li><li>store the directory to we write the application code. Inside this, we have use case and repository.</li></ul><p>The architecture I use is microservices, consisting of two services:</p><ol><li>The first service handles user registration.</li><li>The second service sends a welcome email to the user.</li></ol><p>Basically, we could achieve this with a monolithic architecture or a single service. However, why did we separate it into different services? Simply because we want to decouple our services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6jyUhLpbVRa3sSaq" /></figure><p>Decoupling can reduce the risk of failures, such as when the back-end server becomes overloaded, can no longer handle requests, and eventually goes down or crashes. Therefore, the solution to this problem is that we must eliminate dependencies between components in the application architecture. How do we do that?</p><p>We can use a message queue. Message queues are a form of asynchronous communication between services and are commonly used in microservices architectures.</p><p>The idea of using a message queue isn’t solely tied to microservices. In our case (sending emails), it might not be necessary to send the email immediately or in real-time. Instead, we can take an asynchronous approach, which is why we chose to use a message queue.</p><p>We can use tools for message queues, such as RabbitMQ. However, when using RabbitMQ, we need to manage the infrastructure ourselves. If you prefer not to handle software management or maintain infrastructure, you can opt for Amazon SQS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/0*oIAIbWhRlhKvinPx" /><figcaption>Amazon SQS</figcaption></figure><p><strong>Amazon Simple Queue Service (Amazon SQS)</strong> offers a secure, durable, and available hosted queue that lets you integrate and decouple distributed software systems and components.</p><h4>Why we use Amazon SQS?</h4><p>Because we want to simplify our infrastructure and we want to avoid managing it. Amazon SQS provides a simple and reliable way for customers to decouple and connect components (microservices) together using queues.</p><h4>Feature of Amazon SQS</h4><ul><li>Amazon SQS have a two type, Standard and FIFO (First In, First out). <br>Unlimited messages and queue.</li><li>Encrypted message, protect the contents of messages in Amazon SQS queues using keys managed in the AWS Key Management Service (AWS KMS).</li><li>Integrate with other Amazon Services</li><li>Batches: send, receive, or delete messages in batches of up to 10 messages or 256KB.</li></ul><h4>Prerequisites</h4><ul><li>AWS Account</li><li>AWS access keys</li></ul><blockquote>To help you, you can use the starter project: <a href="https://github.com/arasopraza/go-rest">https://github.com/arasopraza/go-rest</a></blockquote><p>So, lets jump to the code ~~</p><p>In the first service RESTful API project, install the AWS config and SQS service SDK v2 for Go using the following command:</p><pre>go get github.com/aws/aws-sdk-go-v2/config<br>go get github.com/aws/aws-sdk-go-v2/service/sqs</pre><p>Then, create new directory inside the internal directory called “<strong><em>sqs</em></strong>”.</p><p>Inside the directory, create new file called “<strong><em>sqs.go</em></strong>”</p><p>Then, write this code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c27423163f502bb06f78cb7b6146e73f/href">https://medium.com/media/c27423163f502bb06f78cb7b6146e73f/href</a></iframe><p>The NewClient function init the client for SQS with load the configuration that we have in local. The SendMessage function to store the message to SQS.</p><p>At main.goimport the SQS client like this:</p><pre>queueUrl := os.Getenv(&quot;SQS_URL&quot;)<br>sqsClient := sqs.NewClient(queueUrl)</pre><blockquote>Make sure you are already create some queue in Amazon SQS.</blockquote><p>Amazon SQS supports two types of queues: standard queues and FIFO queues. Here are the key differences between them:</p><ul><li><strong>Standard Queue</strong>: Guarantees <strong>at-least-once delivery</strong>, meaning your message may be consumed more than once. Use this if message order is not a priority.</li><li><strong>FIFO Queue</strong>: Guarantees <strong>exactly-once delivery</strong> and maintains the order of messages. Use this if you need to ensure messages are delivered in the correct order.</li></ul><p>Because message order is not a priority in this case, we will use the standard queue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ptD1iEVGW9zuMBRptqObqQ.png" /><figcaption>Amazon SQS Queue Dashboard</figcaption></figure><p>Next, open your use case. In this case, we write the use case like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8790df922901cf4c1302198ac0601cdd/href">https://medium.com/media/8790df922901cf4c1302198ac0601cdd/href</a></iframe><p>In this scenario, we want to send an email after the user successfully registers. So, we add the SQS client as a dependency for the user use case.</p><p>Inside the CreateUser function, after the user successfully registers, we call the SQS service and send a message to Amazon SQS containing the user&#39;s email. The user&#39;s email sent to Amazon SQS will then be consumed by our second service.</p><h4>Set up our second service</h4><p>Create the second service to send a welcome email to the user. This service is very simple — it only performs one task: sending the email.</p><p>Similar to the first service, we need to install dependencies. Run this command to install the required dependencies:</p><pre>go get github.com/aws/aws-sdk-go-v2/config<br>go get github.com/aws/aws-sdk-go-v2/service/sqs</pre><p>The first thing we do is set up the email using the net/smtp package.</p><p>Create a file called send_email.goinside new directory called “<strong><em>actions</em></strong>”. Write the code like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fe13ea13c2d9dfff8add8d3f45fec51/href">https://medium.com/media/2fe13ea13c2d9dfff8add8d3f45fec51/href</a></iframe><p>Next, create new file get_message.go inside the actions directory.</p><p>Open the file and write the code as follows:</p><pre>package actions<br><br>import (<br> &quot;context&quot;<br> &quot;log&quot;<br><br> &quot;github.com/aws/aws-sdk-go-v2/aws&quot;<br> &quot;github.com/aws/aws-sdk-go-v2/service/sqs&quot;<br> &quot;github.com/aws/aws-sdk-go-v2/service/sqs/types&quot;<br>)<br><br>type SqsActions struct {<br> SqsClient *sqs.Client<br>}<br><br>func (actor SqsActions) GetMessages(ctx context.Context, queueUrl string, maxMessages int32, waitTime int32) ([]types.Message, error) {<br> var messages []types.Message<br> result, err := actor.SqsClient.ReceiveMessage(ctx, &amp;sqs.ReceiveMessageInput{<br>  QueueUrl:            aws.String(queueUrl),<br>  MaxNumberOfMessages: maxMessages,<br>  WaitTimeSeconds:     waitTime,<br> })<br> if err != nil {<br>  log.Printf(&quot;Couldn&#39;t get messages from queue %v. Here&#39;s why: %v\n&quot;, queueUrl, err)<br> } else {<br>  messages = result.Messages<br> }<br> return messages, err<br>}<br><br>func (actor SqsActions) DeleteMessage(ctx context.Context, queueUrl string, receiptHandle string) (*sqs.DeleteMessageOutput, error) {<br> return actor.SqsClient.DeleteMessage(ctx, &amp;sqs.DeleteMessageInput{<br>  QueueUrl:      aws.String(queueUrl),<br>  ReceiptHandle: aws.String(receiptHandle),<br> })<br>}</pre><p>We create two functions, GetMessages and DeleteMessage . GetMessages retrieves messages from the specified SQS queue. DeleteMessagewill deletes a specific message from the SQS queue using its receipt handle after consuming it.</p><blockquote>Remember: A message in standard queue Amazon SQS may be delivered more than once due to retries or delays. That’s why it’s important to delete the message after consuming it to prevent multiple deliveries.</blockquote><p>After that, create file main.go and write code like this:</p><pre>package main<br><br>import (<br> &quot;context&quot;<br> &quot;log&quot;<br><br> &quot;github.com/joho/godotenv&quot;<br>)<br><br>func main() {<br> ctx := context.Background()<br><br> err := godotenv.Load(&quot;../.env&quot;)<br> if err != nil {<br>  log.Fatal(err)<br> }<br>}</pre><p>Then, in main.go add function processMessage.</p><pre>func processMessage(sqsActions actions.SqsActions, queueUrl string) error {<br> messages, err := sqsActions.GetMessages(context.Background(), queueUrl, int32(10), int32(20))<br> if err != nil {<br>  log.Fatalf(&quot;Failed to receive messages: %v&quot;, err)<br> }<br><br> // // Check if there are no messages in the queue<br> if len(messages) == 0 {<br>  fmt.Println(&quot;No new messages in the queue.&quot;)<br>  return nil<br> }<br><br> // // Print the messages<br> for _, message := range messages {<br>  err = actions.SendMail(*message.Body)<br>  if err != nil {<br>   log.Fatal(err.Error())<br>   continue<br>  }<br><br>  _, err = sqsActions.DeleteMessage(context.Background(), queueUrl, *message.ReceiptHandle)<br>  if err != nil {<br>   log.Printf(&quot;Failed to delete message: %v&quot;, err)<br>  } else {<br>   log.Printf(&quot;Message deleted: %s&quot;, *message.Body)<br>  }<br><br>  fmt.Printf(&quot;Email sent successfully for message: %s\n&quot;, *message.Body)<br> }<br><br> return nil<br>}</pre><p>Next, inside main.go function, write this:</p><pre> sdkConfig, err := config.LoadDefaultConfig(ctx, config.WithRegion(&quot;ap-southeast-1&quot;))<br> if err != nil {<br>  fmt.Println(err)<br>  return<br> }<br><br> // Create an SQS client<br> sqsClient := sqs.NewFromConfig(sdkConfig)<br><br> // Create an instance of SqsActions<br> sqsActions := actions.SqsActions{SqsClient: sqsClient}<br><br> // Define parameters<br> queueUrl := os.Getenv(&quot;SQS_URL&quot;)<br><br> log.Println(&quot;Consumer service running...&quot;)<br> for {<br>  err := processMessage(sqsActions, queueUrl)<br>  if err != nil {<br>   log.Printf(&quot;Error processing messages: %v&quot;, err)<br>  }<br>  time.Sleep(5 * time.Second)<br> }</pre><p>We configure the SDK Config and the Amazon SQS client. Then, we call the processMessage function to retrieve messages from Amazon SQS.</p><p>This is the complete code in main.go</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8e8908fba900b0d18578cd65d7f9325e/href">https://medium.com/media/8e8908fba900b0d18578cd65d7f9325e/href</a></iframe><h4>Testing</h4><p>Finally, we can run our services.</p><p>In first service, run this command make run app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*Y2-VSfka_9m0iS1VBJ1TNA.png" /></figure><p>In the second services, run this command go run main.go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/785/1*Q1n9b2oZYoAQVgfTWcJSKQ.png" /></figure><p>The second services will listen to the Amazon SQS.</p><p>If there is a message, the service immediately consumes it. Inside the message, there is the user’s email address, which was successfully registered. From there, the second service uses the email as the recipient.</p><p>Hit the endpoint localhost:3000/api/v1/user. Write the body request like this example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V51Bb5LOZimJqOvIneuhyg.png" /></figure><p>The body request contain user name and email.</p><p>Run the HTTP request, if success, you will get the response like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mJF03W8PiLP2RzNkQxkdfg.png" /></figure><p>Then, go to your second service and observe the logs in the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*JZbirEjL61LOAItPbsFeCw.png" /></figure><p>When there is a message in Amazon SQS, the services will consume it and perform its task, which is, sending the email.</p><p>To ensure the email is sent, we can check the email inbox (we use Mailtrap for this testing).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zo4CY2rMxdeRCsNEIeZ6rg.png" /></figure><p>Cool!</p><p>The user successfully receives the welcome email.</p><p>In the AWS Console, you can also monitor your queue by accessing this link: <a href="https://console.aws.amazon.com/sqs/">https://console.aws.amazon.com/sqs/</a>. Navigate to one of your queues, then choose the <strong>Monitoring</strong> tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GKWQQQLkn8VWPhSKCZrTyg.png" /><figcaption>Monitoring Amazon SQS</figcaption></figure><p>Additionally, you can integrate Amazon SQS with Amazon CloudWatch to monitor more detailed metrics and enable logging for enhanced visibility.</p><p>Thanks for reading ~~</p><pre>Want to connect?<br>https://www.linkedin.com/in/arasopraza/<br>https://github.com/arasopraza<br>https://twitter.com/arsyopraza<br>https://arsyopraza.com</pre><p>Reference:</p><ul><li><a href="https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/using-sqs-with-go-sdk.html">Amazon SQS Examples Using the AWS SDK for Go</a></li><li><a href="https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/welcome.html">What is the AWS SDK for Go v2?</a></li><li><a href="https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/sqs#pkg-overview">sqs</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e4e5f32a75b" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/enhancing-your-back-end-system-with-amazon-sqs-2e4e5f32a75b">Enhancing Your Back-End System with Amazon SQS</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securely Storing Images on Amazon S3 with Presigned URLs in Golang]]></title>
            <link>https://arasopraza.medium.com/securely-storing-images-on-amazon-s3-with-presigned-urls-in-golang-18f96af44e8c?source=rss-c2e570d6d519------2</link>
            <guid isPermaLink="false">https://medium.com/p/18f96af44e8c</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Arsy Opraza]]></dc:creator>
            <pubDate>Sat, 07 Dec 2024 02:13:19 GMT</pubDate>
            <atom:updated>2024-12-07T02:13:19.179Z</atom:updated>
            <content:encoded><![CDATA[<p>Several weeks ago, I was mentoring a capstone team at Bangkit Academy when I received a question about how to store images in the back-end. That’s why I decided to write this article.</p><p>When building a REST API, you might need an upload feature for files such as images, videos, audio, or documents. You can save the data locally. However, the problem with this approach is that you need a large amount of disk space to store files like images or videos.</p><h4>So, What is the Solution?</h4><p>Amazon S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*I1m9mVFH0P05r5ST.png" /></figure><p>Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.</p><p>Some terminology in Amazon S3 is a <em>object</em> and <em>bucket</em>. An <em>object</em> is a file and any metadata that describes the file. A <em>bucket</em> is a container for objects.</p><p>To save object in Amazon S3, you need create a bucket if you don’t have. Then, specify a bucket name and AWS Region. Each object has a <em>key</em> (or <em>key name</em>), which is the unique identifier for the object within the bucket.</p><h4>Feature of Amazon S3</h4><ul><li>Storage Classes<br>By default, objects in S3 are stored in the S3 Standard storage class. Amazon S3 offers storage classes that match your use case, such as S3 Standard, S3 Standard-IA, S3 Intelligent-Tiering, and more.</li><li>Storage Management<br>Amazon S3 offers storage management features to help manage costs, meet compliance requirements, and reduce latency. With storage management, you can utilize features such as S3 Lifecycle, S3 Object Lock, S3 Replication, and S3 Batch Operations.</li><li>Access Management and Security<br>Amazon S3 has features to manage access to your objects. These features include S3 Block Public Access, Access Control Lists, and more.</li><li>Data Processing<br>To process data, you can use feature S3 Object Lambda and Event notifications.</li><li>Storage Logging and Monitoring<br>You can monitor your object on Bucket with Amazon CloudTrail and Amazon CloudWatch.</li><li>Analytics and insights<br>To understand, analyze, and optimize your usage in S3, AWS have a feature Amazon S3 Storage Lens. Or, you can use Storage Class Analysis.</li><li>Strong consistency<br>Don’t worry about your data consistency because S3 have a strong consistency for PUT and DELETE object. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html#ConsistencyModel">Amazon S3 data consistency model</a>.</li></ul><p>That’s a brief summary of some Amazon S3 features. Let’s look at the implementation of S3 in the case study.</p><p>Before we start, make sure you have the following requirements:</p><ul><li>An AWS Account</li><li>Access to Amazon S3</li><li>AWS Secret Key and Access Key</li></ul><h4>Case Study</h4><p>I have a simple REST API built with Go. The REST API includes a feature to support uploading user profile photos. Let’s say we have an endpoint v1/image with the POST method. In the request body, we include a form-data field with the name file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ADLUyDhvz4BtACEQJga2AA.png" /></figure><p>So, lets go to the code 😄</p><p>We will build a REST API using the Echo Framework. In this project, we will have a handler, repository, and use case.</p><p>In handler.go, i wrote code like this.</p><pre>func (h *handlerUser) UploadImage(c echo.Context) error {<br><br> _, err := h.jwtAccess.GetUserIdFromToken(c)<br><br> if err != nil {<br>  return c.JSON(http.StatusUnauthorized, &quot;Unauthorized&quot;)<br> }<br><br> file, err := c.FormFile(&quot;file&quot;)<br> if err != nil {<br>  return c.JSON(http.StatusBadRequest, &quot;bad request&quot;)<br> }<br> <br> // Validate content type<br> if file.Header.Get(&quot;Content-Type&quot;) != &quot;image/jpeg&quot; &amp;&amp; file.Header.Get(&quot;Content-Type&quot;) != &quot;image/jpg&quot; {<br>  return c.JSON(http.StatusBadRequest, &quot;Invalid file format. Must be in JPEG or JPG format.&quot;)<br> }<br><br> // Validate file size<br> if file.Size &gt; 2*1024*1024 {<br>  return c.JSON(http.StatusBadRequest, &quot;File size exceeds the limit. Maximum file size is 2MB.&quot;)<br> }<br><br> // Validate minimum file size<br> if file.Size &lt; 10*1024 {<br>  return c.JSON(http.StatusBadRequest, &quot;File size is too small. Minimum file size is 10KB.&quot;)<br> }<br><br> src, err := file.Open()<br> if err != nil {<br>  return c.JSON(http.StatusBadRequest, &quot;bad request&quot;)<br> }<br> defer src.Close()<br><br> bucket, err := h.usecase.UploadImage(src, file)<br><br> if err != nil {<br>  return c.JSON(http.StatusInternalServerError, &quot;failed to upload image&quot;)<br> }<br><br> return h.formatResponse.FormatJson(c, http.StatusOK, &quot;success&quot;, map[string]interface{}{<br>  &quot;imageUrl&quot;: bucket,<br> })<br>}</pre><p>The UploadImage function handles an image upload, validate the content type and file size. The file will be process through usecase.UploadImage.</p><p>So, let’s jump to usecase.go.</p><pre>func (u *usecase) UploadImage(file multipart.File, fileHeader *multipart.FileHeader) (url string, err error) {<br><br> buf := bytes.NewBuffer(nil)<br> if _, err := buf.ReadFrom(file); err != nil {<br>  return &quot;&quot;, fmt.Errorf(&quot;failed to read file: %v&quot;, err)<br> }<br><br> fileType := fileHeader.Header.Get(&quot;Content-Type&quot;)<br><br> key := utils.GenerateUUID()<br> key += &quot;.jpg&quot;<br><br> cfg, err := config.LoadDefaultConfig(context.TODO())<br> if err != nil {<br>  log.Fatalf(&quot;failed to load configuration, %v&quot;, err)<br> }<br><br> svc := v2.NewFromConfig(cfg)<br><br> _, err = svc.PutObject(context.TODO(), &amp;v2.PutObjectInput{<br>  Bucket: awsv2.String(os.Getenv(&quot;AWS_BUCKET&quot;)),<br>  Key:    awsv2.String(key),<br>  Body:          bytes.NewReader(buf.Bytes()),<br>  ContentLength: awsv2.Int64(fileHeader.Size),<br>  ContentType:   awsv2.String(fileType),<br> })<br><br> if err != nil {<br>  log.Fatalf(&quot;failed to put object, %v&quot;, err)<br> }<br><br> sess, err := session.NewSession(&amp;aws.Config{<br>  Region: aws.String(os.Getenv(&quot;AWS_REGION&quot;))},<br> )<br><br> if err != nil {<br>  log.Fatalf(&quot;failed to create session, %v&quot;, err)<br> }<br><br> client := s3.New(sess)<br><br> urlBucket, _ := client.GetObjectRequest(&amp;s3.GetObjectInput{<br>  Bucket: aws.String(os.Getenv(&quot;AWS_BUCKET&quot;)),<br>  Key:    aws.String(key),<br> })<br><br> urlStr, err := urlBucket.Presign(15 * time.Minute)<br><br> if err != nil {<br>  log.Println(&quot;Failed to sign request&quot;, err)<br> }<br><br> url = urlStr<br><br> return<br>}</pre><p>The UploadImage function in usecase handles the process of uploading an image to an AWS S3 bucket. It reads the file into a buffer, generates a unique key for the image, and uses AWS SDK for Go v2 to upload the file to S3.</p><p>Look at this code.</p><pre>_, err = svc.PutObject(context.TODO(), &amp;v2.PutObjectInput{<br>  Bucket: awsv2.String(os.Getenv(&quot;AWS_BUCKET&quot;)),<br>  Key:    awsv2.String(key),<br>  Body:          bytes.NewReader(buf.Bytes()),<br>  ContentLength: awsv2.Int64(fileHeader.Size),<br>  ContentType:   awsv2.String(fileType),<br> })</pre><p>We use the AWS SDK v2 and the PutObjectInput method with parameters such as Bucket (retrieved from the environment) and Key (a unique key for the file name).</p><p>Next, look at to this block code.</p><pre>urlBucket, _ := client.GetObjectRequest(&amp;s3.GetObjectInput{<br>  Bucket: aws.String(os.Getenv(&quot;AWS_BUCKET&quot;)),<br>  Key:    aws.String(key),<br> })<br><br> urlStr, err := urlBucket.Presign(15 * time.Minute)</pre><p>After the file is uploaded, we create a presigned URL for accessing the image with a 15-minute expiration time, which will be returned as the result of the function.</p><p>By default, all Amazon S3 objects are private, only the object owner has permission to access them. You can use presigned URLs to grant time-limited access to objects in Amazon S3 without updating your bucket policy. A presigned URL can be entered in a browser or used by a program to download an object. The credentials used by the presigned URL are those of the AWS user who generated the URL.</p><h4>Testing</h4><p>We can test uploading the image to the endpoint. If successful, you will get a result like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MHh0fi7AHh-kj1_8y7dvjA.png" /></figure><p>If you want to access the image you uploaded, you can copy the link from the response and paste it into your browser. You will then see the image you uploaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NJ1tYj2pCDwedLvzHoiOjg.png" /></figure><p><em>Voila</em>! We success upload the image to the Amazon S3.</p><p>Thanks for reading ~~</p><p>Reference:</p><ul><li><a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/GetStartedWithS3.html">Getting started with Amazon S3</a></li><li><a href="https://aws.github.io/aws-sdk-go-v2/docs/getting-started/">Getting Started with the AWS SDK for Go V2</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18f96af44e8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginner guides: Deploy Backend Applications to Cloud Run]]></title>
            <link>https://levelup.gitconnected.com/beginner-guides-deploy-backend-applications-to-cloud-run-cfe264ebdd1e?source=rss-c2e570d6d519------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfe264ebdd1e</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Arsy Opraza]]></dc:creator>
            <pubDate>Sun, 23 Jun 2024 16:50:26 GMT</pubDate>
            <atom:updated>2024-06-24T01:14:03.933Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we’ll explore effortless deployment of your Node.js REST API as container images to Google Cloud Run using Artifact Registry.</p><p>I have a story from when I experienced deploying a website. Initially, I used a VM to run my website in production. I created, configured, and managed the VM without any issues. However, as traffic to the website increased, I needed to scale the server. I upgraded the server specifications and even created new VMs to handle the traffic.</p><p>Everything was fine until I started feeling tired of managing the servers. It became a drain on my productivity because I had to split my time between coding and server management. Managing both became quite a challenge, haha!</p><p>As a software engineer, you’ll likely need to deploy your own app, especially if your team doesn’t have an infrastructure or DevOps team. It doesn’t matter if you’re a Front-End Engineer; you need to learn how to deploy apps to a server. For Back-End Engineers, it’s a must.</p><p>For some people, deploying an app can be tough. The journey to get your app into production can be long and challenging. Running a website in production involves setting up, creating, and managing VMs, clusters, pods, and services. This is fine for complex apps, but if you’re just trying to run a simple website, it’s a lot of unnecessary overhead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*urJGP5UmndAlv4tI" /><figcaption>generate by DALL-E</figcaption></figure><p>If you want to deploy an app to your VM by yourself, you need to be familiar with the command line, Linux, and SSH. If you’re using CI/CD tools like Jenkins or GitHub Actions, you need to master those tools first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F0lFzyHbusHYd1WW.gif" /><figcaption><a href="https://substackcdn.com/image/fetch/f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbd63be9d-8457-4e1c-9aca-d185dba88732_1280x1664.gif">source</a></figcaption></figure><p>We’re just talking about deployment, and it’s already hard and takes a lot of effort, right? So, is there an easier way to deploy with minimal effort? Yes, we can use a service from Google Cloud Platform called Cloud Run.</p><p><strong>In this article, you’ll discover how to:</strong></p><ul><li>Build a Docker image using a Dockerfile</li><li>Upload images to Artifact Registry</li><li>Deploy Docker images to Cloud Run</li><li>Manage your Cloud Run deployments</li></ul><h4>What is Cloud Run?</h4><p>Cloud Run is a managed compute platform that allows you to run containers directly on Google’s scalable infrastructure. Because Cloud Run uses container technology, you can deploy applications in any programming language. When using Cloud Run, you benefit from features such as auto-scaling, zero instances when there is no traffic, and cost savings because you only pay for what you use.</p><p>We can focus on write code and more productive without manage infrastructure. We don’t need experience in infrastructure because Cloud Run will handle it. On Cloud Run, you can choose to run your code as a service or as a job.</p><p>Cloud Run services, used to run code that responds to web requests, or events. Cloud Run jobs, used to run code that performs work (a job) and quits when the work is done. There are two pricing models you can enable:</p><ul><li>Request-based: If an instance is not processing requests, the CPU is not allocated and you’re not charged. Additionally, you pay a per-request fee.</li><li>Instance-based: You’re charged for the entire lifetime of an instance and the CPU is always allocated. There’s no per-request fee.</li></ul><h4>Introduction to Container and Docker</h4><p>Cloud Run runs your app as a container, so you’ll need to containerize your app. If you’re unfamiliar with these technologies, we can discuss them in this section. Feel free to skip this section if you’re already familiar with containers and Docker.</p><p><strong>What is Container?</strong></p><p>A container is an executable software unit in which application code, libraries, and dependencies are packaged, so that it can be run anywhere and is easy and fast to move between environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*HRtc2SUDMWON9M6F.png" /><figcaption><a href="https://www.docker.com/resources/what-container/">source</a></figcaption></figure><p>We will package our app as a docker image and run the image container in Cloud Run. If you’re using Go, Node.js, Python, Java, .NET Core, or Ruby, you can use the <a href="https://cloud.google.com/run/docs/deploying-source-code">source-based deployment</a> option that builds the container for you.</p><p><strong>What is Docker?</strong></p><p>Docker is an open platform for developing, shipping, and running applications. Docker allows you to separate your applications from your infrastructure so you can deliver software quickly. What is correlation between Docker, Container, and Cloud Run?</p><p>We will use Docker to ship our app as image, then run as a container so Cloud Run can deploy and running our app. Docker image that we build, will push to Artifact Registry later because Cloud Run will only get image from Artifact Registry.</p><p>Let’s go to practice!</p><p>This section i will create step by step, so if you want to follow the step you need to:</p><ul><li>Have a GCP account.</li><li>Installed Docker in Local</li><li>REST API project with Node.js</li></ul><h4>Build Image</h4><p>First, you need to create a Dockerfile to automatically build images for your app. Because we’ll build a Node.js app, so the Dockerfile will look like this:</p><pre>FROM node:20-alpine<br><br>WORKDIR /usr/src/app<br><br>COPY package*.json ./<br><br>RUN npm install<br><br>COPY . .<br><br>EXPOSE 3000<br>CMD [ &quot;node&quot;, &quot;src/server.js&quot; ]</pre><p>Build the images with this command:</p><pre>docker build -t be:latest .</pre><p>The image named ‘be:latest’ will be created. Once the image is successfully built, you can test your app locally to ensure it’s running correctly. After confirming that your app works locally, we can move on to the next step.</p><h4>Artifact Registry</h4><p>We have successfully built the images with Docker. Next, we’ll use Artifact Registry. Artifact Registry allows you to centrally store artifacts and build dependencies as part of an integrated Google Cloud experience.</p><p><strong>Why we need artifact registry?</strong></p><p>Because Cloud Run need a container images, and Cloud Run can only pull container images from Artifact Registry. That’s the reason why we’ll use Artifact Registry.</p><p>To create a repository in Artifact Registry, you can use either the <a href="https://console.cloud.google.com/">Google Cloud Console </a>or the Google Cloud CLI. In this example, I’ll use the Google Cloud CLI. Run this command in your terminal.</p><pre>gcloud artifacts repositories create &lt;repository-name&gt; \<br>        --repository-format=docker \<br>        --location=&lt;your-region&gt; \<br>        --description=&lt;your-description&gt; \<br>        --immutable-tags \<br>        --async</pre><p>The result will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w6d5XfS5eHbtosZImeuXDw.png" /><figcaption>gcloud artifacts repositories creating</figcaption></figure><p>After successfully creating the repository, the next step is to grant Docker access to Artifact Registry.</p><h4>Grant Access Registry to Docker</h4><p>As a default, Docker doesn’t have access to the Registry. To grant Docker access to our repository in Artifact Registry, run this command:</p><pre>gcloud auth configure-docker &lt;location&gt;-docker.pkg.dev</pre><p>Feel free to set the location to the region of your choice. In this example, I’m using asia-southeast2. Your result should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZKuHpIzVWMFfOaH9hw5AsQ.png" /><figcaption>grant access docker to registry</figcaption></figure><p>Don’t forget to type Y.</p><h4>Build Image with Artifact Registry</h4><p>We use the same command to build the images, but this time we add the Image URL as a tag. The Image URL is the URL to your image stored in Artifact Registry. Execute this command:</p><pre>docker build . --tag asia-southeast2-docker.pkg.dev/back-end-gcp-exploration/back-end-app-demo/be-app:1.0.0</pre><p>The URL has the shape:</p><pre>LOCATION-docker.pkg.dev/PROJECT_ID/REPO_NAME/PATH:TAG</pre><p>If success, you will see the result like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ld1dbQfsZwbCxLP9qqWrpA.png" /><figcaption>docker build</figcaption></figure><p>After successfully building the images, the next step is to push the image to Artifact Registry.</p><pre>docker push asia-southeast2-docker.pkg.dev/back-end-gcp-exploration/back-end-app-demo/be-app:1.0.0</pre><p>The output will look like this if everything went smoothly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KM6K-AtyY-6O4LdGe_jAww.png" /><figcaption>push image to registry</figcaption></figure><p>You can also check the result by navigating to the Artifact Registry in the Google Cloud Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ErsWFVCE6CXZIwp2grKeSA.png" /></figure><p>Nice, we’ve completed building and pushing the image to Artifact Registry.</p><h4>Deploy the container to Cloud Run</h4><p>The next step is to deploy the application. To deploy the application, we can use the gcloud run deploy command like this:</p><pre>gcloud run deploy back-end-app --image &lt;your-image-url&gt; --region &lt;your-region&gt;</pre><p>Wait until the process is complete. If successful, you will see a result like the following image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dj1Jc2g7T9rEV8Z8DHFFYA.png" /></figure><p>Actually, the deployment process is quite fast. In this example, it took me less than a minute. To verify that the deployment was successful, run this command:</p><pre>gcloud run services list</pre><p>You can see the list of services in Cloud Run, where you can find the URL and service name of your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NR7EbEXIc2YCrpjv2kN6Gw.png" /></figure><p>You can also verify the result in the Google Cloud Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P4DYBp4bZSLbAVaWeMllLg.png" /></figure><p>Finally, you can access and test the app by visiting the URL in browser or Postman.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4772oZa7v1SDOiBfh3Z9Jg.png" /></figure><p>We get a response from our application, which means we have successfully deployed the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*sDlTKBugCwhZoQel.png" /></figure><h4>Manage Application Version</h4><p>Can we only deploy one version? Absolutely not. We can add multiple versions of the application. For instance, if we need to update an already deployed application, it’s entirely feasible. Here are the steps to create another version of an existing application:</p><p><strong>First</strong>, build the images with this command:</p><pre>docker build . --tag asia-southeast2-docker.pkg.dev/back-end-gcp-exploration/back-end-app-demo/be-app:1.0.1</pre><p>Note, you need to change the tag, for example i change to 1.0.1.</p><p><strong>Then</strong>, push your image to Artifact Registry with following command:</p><pre>docker push asia-southeast2-docker.pkg.dev/back-end-gcp-exploration/back-end-app-demo/be-app:1.0.1</pre><p><strong>Finally</strong>, deploy your app with this command:</p><pre>gcloud run deploy back-end-app --image &lt;your-image-url&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hIzKmdcvRTK5CJ19Lp6SRQ.png" /></figure><p>Cool! <br>The new version of the app has been successfully deployed. To ensure your app is deployed correctly, access the URL, and voilà, the result will look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zzYz3lyc2dGoET4LyYxSCA.png" /></figure><p>To view details on the Cloud Run Dashboard, follow these steps:</p><ol><li>Navigate to the Cloud Run service.</li><li>Select your ‘back-end-app’ service.</li><li>On the Service Details page, click on the Revisions tab.</li><li>You should now see 2 revisions listed.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*25DCr8akLTKqxhYYXVxO8g.png" /></figure><h4>So, what’s next?</h4><p>We only deploy simple REST API and dont use database. Next, you can integrate your back-end into database, Redis, and any other tools. You can read here to integrate your app with <a href="https://cloud.google.com/sql/docs/postgres/connect-run">Cloud SQL</a> (managed MySQL, PostgreSQL, and SQL Server), <a href="https://cloud.google.com/memorystore/docs/redis/connect-redis-instance-cloud-run">Memorystore</a> (managed Redis and Memcached), Firestore, Spanner, Cloud Storage, and more.</p><p>Initially, we only deployed a simple REST API without using a database. Next, you can integrate your backend with databases like <a href="https://cloud.google.com/sql/docs/postgres/connect-run">Cloud SQL</a> (managed MySQL, PostgreSQL, and SQL Server), caching tools like Memorystore (managed Redis and Memcached), as well as Firestore, Spanner, Cloud Storage, and more.</p><pre>Want to connect?<br>https://www.linkedin.com/in/arasopraza/<br>https://github.com/arasopraza<br>https://twitter.com/arsyopraza</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfe264ebdd1e" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/beginner-guides-deploy-backend-applications-to-cloud-run-cfe264ebdd1e">Beginner guides: Deploy Backend Applications to Cloud Run</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cara mengelola diri untuk seorang longlife learner]]></title>
            <link>https://arasopraza.medium.com/cara-mengelola-diri-untuk-seorang-longlife-learner-d4eaabb476a8?source=rss-c2e570d6d519------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4eaabb476a8</guid>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[personal-development]]></category>
            <category><![CDATA[self-awareness]]></category>
            <category><![CDATA[personal-growth]]></category>
            <category><![CDATA[learning-and-development]]></category>
            <dc:creator><![CDATA[Arsy Opraza]]></dc:creator>
            <pubDate>Sun, 31 Mar 2024 07:00:08 GMT</pubDate>
            <atom:updated>2024-03-31T07:00:08.942Z</atom:updated>
            <content:encoded><![CDATA[<p>Sebagai <em>knowledge</em> <em>worker</em> (pekerja yang menggunakan pengetahuan atau keahlian) belajar di sepanjang hayat perlu dilakukan. Tak hanya belajar, selalu <em>update</em> pada bidang yang sudah dikuasai pun juga wajib dilakukan. Dua hal ini perlu dilakukan, terlebih pada kondisi gempuran kecerdasan buatan (Artificial Intelligence) saat ini yang mungkin mengancam pekerjaan kita sebagai knowledge worker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*1wVj2LbJp2M6b5Ax" /><figcaption>Bertumbuh seperti tanaman</figcaption></figure><p>Selain itu, salah satu karakter dari knowledge worker adalah <em>perpetual</em> <em>learner</em> (pribadi yang terus belajar). Tujuan untuk selalu belajar adalah agar selalu relevan dengan kondisi saat ini dan adaptif terhadap perubahan. Jika tidak relevan dan adaptif, kita akan tertinggal dan jangan kaget pekerjaan kita tergantikan oleh profesi atau orang lain bahkan oleh kecerdasan buatan.</p><p>Perpetual learner saja tak cukup, kita juga perlu untuk belajar mengelola diri (dalam konteks mengembangkan<em> </em>diri). Orang yang <em>great archiver </em>dan sukses mampu untuk mengelola diri mereka. Mereka mampu untuk mengembangkan diri mereka dengan baik, belajar keahlian baru, selalu <em>update</em> dengan bidang mereka dan mampu untuk berkontribusi ke lingkungan sekitar mereka sesuai dengan value mereka. Lalu, bagaimana cara mengelola diri?</p><p>Mengelola diri dalam tujuan untuk mengembangkan diri dapat dilakukan dengan langkah berikut:</p><h4>Mengenali kelebihan diri sendiri</h4><p>Yang perlu dilakukan pertama kali adalah mengenali kelebihan diri. Ketika mengenali kelebihan diri, kita akan mudah untuk mengembangkan diri. Mengenali kelebihan membuat kita fokus pada area yang memang menjadi kekuatan kita.</p><p>Ketika fokus hanya pada keahlian atau bidang tertentu dapat membantu kita untuk berkembang lebih jauh. Selain itu, hal tersebut dapat menjadikan kita sebagai pakar dalam suatu keahlian atau bidang. Orang dapat menjadi pakar ketika fokus pada area yang memang menjadi kelebihannya.</p><p>Berfokuslah dan curahkan semua energi dan waktu untuk mencari dan mengenali kelebihan diri, kemudian kembangkan kelebihan tersebut hingga menjadi pakar.</p><blockquote>We need to know our strengths in order to know where we belong.</blockquote><h4>Mengenali <em>the best way</em></h4><p>Dalam melakukan atau mengerjakan sesuatu, kita akan memiliki cara masing-masing. Sama halnya dengan kelebihan, cara melakukan sesuatu setiap orang unik. Oleh karena itu, perlu untuk mengenali <em>the best way</em>-nya kita.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*EMWXdbrS_962vLtl" /><figcaption>Kompas sebagai panduan</figcaption></figure><p>Dengan mengenali the best way dalam mengerjakan pekerjaan atau hal lainnya, hasilnya akan menjadi lebih baik. Banyak orang yang salah dalam mengerjakannya sehingga membuat mereka terlihat tidak kompeten. Orang akan mencapai tujuan dan mengerjakan sesuatu dengan cara terbaik mereka.</p><p>Dalam bekerja, ada beberapa tipe orang, tipe listener dan reader. Tipe listener akan cenderung mendengarkan dan tipe reader akan lebih banyak membaca. Orang yang bertipe listener tidak akan maksimal jika dipaksakan melakukan sesuatu seperti cara orang yang bertipe reader dan sebaliknya.</p><p>Dalam belajar pun, orang juga memiliki tipe. Ada yang memiliki tipe belajar dari listening, reading atau speaking. Mengetahui cara belajar penting, tapi yang lebih penting lagi adalah menerapkan cara belajar yang sesuai dengan kita.</p><p>Temukan the best way mu dalam bekerja dan belajar untuk mendapatkan hasil yang maksimal. Meskipun the best way dapat diubah, namun tidak bisa diubah sepenuhnya.</p><blockquote>Do not try to change yourself — you are unlikely to succeed. Work to improve the way you perform.</blockquote><p>Kesimpulan, agar dapat mengembangkan diri, perlu adanya keahlian untuk mengelola diri. Mengelola diri setidaknya dapat dilakukan dengan dua cara diatas, mengenali kelebihan diri dan the best way.</p><p><em>Rekemondasi buku tentang mengelola diri</em>, <a href="https://www.goodreads.com/en/book/show/2477223">Managing Oneself</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4eaabb476a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Go Series #3 — Operator, Perulangan dan Seleksi Kondisi]]></title>
            <link>https://arasopraza.medium.com/go-series-3-operator-perulangan-dan-seleksi-kondisi-0e42424fde31?source=rss-c2e570d6d519------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e42424fde31</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[golang-tutorial]]></category>
            <category><![CDATA[golang-development]]></category>
            <dc:creator><![CDATA[Arsy Opraza]]></dc:creator>
            <pubDate>Wed, 13 Mar 2024 03:04:36 GMT</pubDate>
            <atom:updated>2024-03-13T03:04:36.990Z</atom:updated>
            <content:encoded><![CDATA[<h3>Go Series #3 — Operator, Perulangan dan Seleksi Kondisi</h3><p>Di series sebelumnya, kita sudah mengetahui tipe data yang dimiliki oleh Go. Selanjutnya, kita akan bahas mengenai operator apa saja yang ada di Go, Perulangan dan Seleksi Kondisi. Mari kita bahas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*HgsOg1AbJzSK-fVr.jpeg" /></figure><h3>Operator</h3><h4>Operator Aritmatika</h4><p>Operator aritmatika di Go sama saja seperti operator yang ada di bahasa pemrograman umumnya. Operator aritmatika di Go terdiri dari: <strong>+</strong> untuk penjumlahan, <strong>—</strong> untuk pengurangan, <strong>*</strong> untuk perkalian, <strong>/</strong> untuk pembagian, dan <strong>%</strong> untuk modulus. Berikut contoh penggunaan pada kode.</p><pre>price := 1000<br>tax := float32(0.10) * float32(price)<br>total := price + int(tax)<br>fmt.Println(total)</pre><p>Kode diatas akan menghasilkan nilai 1100.</p><h4>Operator Perbandingan</h4><p>Operator perbandingan di Go terdiri dari:</p><p>== sama dengan</p><p>!= tidak sama dengan</p><p>&lt; lebih kecil dari</p><p>&gt; lebih besar dari</p><p>≤ lebih kecil atau sama dengan</p><p>≥ lebih besar atau sama dengan</p><p>Penggunaannya di kode seperti berikut:</p><pre>var total = 1000<br>var isEqual = (total &lt;= 1000)<br>fmt.Printf(&quot;Apakah %d == 1000? %t \n&quot;, total, isEqual)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*vyX6hjiPdkXAApJtAB1XHw.png" /></figure><h4>Operator Logika</h4><p>Go memiliki beberapa operator logika, yaitu:</p><ul><li>&amp;&amp; = and operator</li><li>|| = or operator</li><li>! = negasi</li></ul><p>Contoh penggunaan operator logika:</p><pre>var isDiscount = true<br>var isMember = true<br><br>var result = isDiscount &amp;&amp; isMember<br>fmt.Println(result)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*1GianYG8phTKh1rl5lr1sw.png" /></figure><h3>Perulangan</h3><p>Perulangan di Go hanya menggunakan keyword for.</p><h4>Perulangan menggunakan <em>for</em></h4><p>Untuk melakukan perulangan dengan for dapat dilakukan seperti berikut:</p><pre>for i := 1; i &lt;= 5; i++ {<br>  fmt.Println(&quot;Item&quot;, i)<br>}</pre><p>Kode perulangan di atas hasilnya akan seperti berikut ini.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*SmqD_lZhoKxW_2MRVegR1A.png" /></figure><h4>Perulangan menggunakan for tanpa variabel counter</h4><p>Di Go, variabel counter dapat dituliskan di dalam blok yang mirip seperti <em>while</em> di bahasa pemrograman lain.</p><pre>var i = 1<br><br>for i &lt; 5 {<br> fmt.Println(&quot;Item&quot;, i)<br> i++<br>}</pre><p>Hasilnya akan sama seperti cara sebelumnya:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*RkvPNZXcXmNS7dpbNwYaCA.png" /></figure><h4>Perulangan menggunakan for — range</h4><p>for range dapat digunakan untuk melakukan <em>looping</em> terhadap data yang bervariasi, yaitu <em>array</em>, <em>slice</em>, <em>string</em> dan sebagainya.</p><pre>numbers := [5]int{1, 2, 3, 4, 5}<br><br>for index, item := range numbers {<br>  fmt.Printf(&quot;numbers[%d] = %d \n&quot;, index, item)<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*YJAW-sSXozs5jacylgpRmA.png" /></figure><h3>Seleksi Kondisi</h3><p>Seleksi kondisi di Go terdiri dari beberapa jenis.</p><h4>If/Else</h4><p>Penggunaan if/else di Go sama saja seperti bahasa pemrograman lainnya, perbedaan hanya pada tanda kurung yang ada di if. Berikut contoh sederhana penggunaan if/else.</p><pre>var point = 8<br>if point == 10 {<br> fmt.Println(&quot;Lulus dengan nilai baik&quot;)<br>} else {<br> fmt.Println(&quot;Lulus&quot;)<br>}</pre><p>Seleksi kondisi if juga dapat ditulis tanpa blok else.</p><pre>var point = 9<br>if point &gt; 5 {<br> fmt.Println(&quot;Lulus dengan nilai memuaskan&quot;)<br>}</pre><h4>Switch</h4><p>Switch di Go sama seperti di bahasa pemrograman lainnya. Hanya saja, perbedaannya terdiri dari, tidak perlu menuliskan <em>break</em> di setiap blok <em>switch</em>, dan nilai yang digunakan pada switch tidak harus integer. Contoh sederhana penggunaan <em>switch.</em></p><pre>var score = 8<br>switch score {<br>case 10:<br> fmt.Println(&quot;Awesome!&quot;)<br>case 8:<br> fmt.Println(&quot;Good!&quot;)<br>default:<br> fmt.Println(&quot;Not Bad!&quot;)<br>}</pre><p>Karena <em>score </em>bernilai 8, dilayar akan tampil tulisan Good!</p><p>Demikian pembahasan mengenai operator, perulangan dan seleksi kondisi. Terima kasih sudah membaca Go series yang ketiga. Nantikan Go series selanjutnya, bye!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0e42424fde31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Go Series #2 — Variabel, Constanta dan Tipe Data]]></title>
            <link>https://arasopraza.medium.com/go-series-2-variabel-constanta-dan-tipe-data-2d275eec0f3f?source=rss-c2e570d6d519------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d275eec0f3f</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[golang-tutorial]]></category>
            <category><![CDATA[golang-development]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Arsy Opraza]]></dc:creator>
            <pubDate>Wed, 06 Mar 2024 03:36:45 GMT</pubDate>
            <atom:updated>2025-01-14T12:51:47.308Z</atom:updated>
            <content:encoded><![CDATA[<h3>Go Series #2 — Variabel, Constanta dan Tipe Data</h3><p>Sebelumnya kita sudah bisa menjalankan program pertama dengan Go. Di series ini, akan berfokus mengenai variabel dan tipe data yang ada di Go.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/391/1*4yjHRsGaa6_LU1UtXb8uLw.png" /></figure><h4>Variabel</h4><p>Deklarasi variabel di Golang menggunakan keyword var dan dapat dilakukan dengan beberapa cara, diantaranya:</p><h4>Variabel dengan tipe data</h4><p>Contoh:</p><pre>var email string = &quot;test@gmail.com&quot;<br>var username string = &quot;developer&quot;</pre><p>Deklarasi dengan tipe data ini disebut dengan <em>manifest typing</em>.</p><h4>Variabel tanpa tipe data</h4><p>Contoh:</p><pre>var fullname = &quot;Developer Go&quot;</pre><p>Deklarasi tanpa tipe data disebut dengan <em>type inference</em>. Variabel dengan type inference juga dapat ditulis seperti berikut ini.</p><pre>age := 17</pre><p>Dengan gaya type inference, keyword var tidak perlu ditulis. Kemudian, untuk meng-assign nilai ke dalam variabel, operand = diganti menjadi := sehingga menjadi lebih ringkas.</p><p>Selain itu, yang menariknya dari Go adalah deklarasi multi variabel seperti berikut.</p><pre>var country, city string = &quot;Indonesia&quot;, &quot;Jakarta&quot;<br>var status, hoby = &quot;Single&quot;, &quot;Running&quot;<br>email, phone := &quot;dev@test.com&quot;, 62867673</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*kNKpheaK_jKFI6XEnWEG4Q.png" /></figure><h4>Constanta</h4><p>Contanta adalah jenis variabel yang nilainya tidak dapat diubah, beda halnya dengan variabel yang nilainya dapat diubah.</p><p>Untuk membuat Constanta caranya adalah menggunakan keyword <strong><em>const</em></strong>. Contoh:</p><pre>const amount = 100</pre><p>Setelah constanta diinisialisasi, kemudian di-assign sebuah nilai ke dalamnya seperti berikut ini akan menyebabkan error.</p><pre>const amount = 100<br>amount = 90</pre><h4>Tipe Data</h4><p>Go memiliki beberapa tipe data diantaranya:</p><p><strong>String</strong><br>String diapit oleh double quote “ “ atau oleh backticks (`) contoh:</p><pre>var name string = &quot;Dev&quot;</pre><p><strong>Numerik</strong><br>Tipe data numerik terbagi menjadi non desimal dan desimal.</p><ul><li><strong>Tipe data non desimal </strong>terbagi menjadi dua: uint dan int. <br>Jenis ini terbagi lagi menjadi beberapa jenis, tergantung range dari datanya, seperti uint8 untuk range data 0 -&gt; 255 dan int8 untuk range -128 -&gt; 128. Contoh:</li></ul><pre>var score uint8 = 200<br>var total int8 = -100</pre><ul><li><strong>Tipe data desimal </strong>tediri dari<strong> </strong>float32 dan float64<br>Sama halnya dengan tipe data non desimal, tipe data ini terbagi menjadi beberapa jenis seperti float32 dan float64. Yang membedakan diantara keduanya ialah range datanya.</li></ul><pre>var price float32 = 3,5</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*sIeUV_HkF43-_5mV1mqlYQ.png" /></figure><p>Perlu diingat bahwa alokasi memori dipengaruhi oleh tipe data yang dipilih. Oleh karena itu, pikirkan secara matang ketika menentukan tipe data.</p><p><strong>Boolean<br></strong>Tipe data boolean di Go menggunakan keyword <strong><em>bool</em></strong> dan berisi nilai true atau false. Contoh:</p><pre>var isValid bool = true<br>var exist = false</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*csADckHSj1sR0qsxCz9Hiw.png" /></figure><p>Demikianlah Go Series yang kedua, semoga bermanfaat. ¡Muchas gracias!</p><p>Versi video dapat ditonton di youtube berikut ini.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUoEKqy4ZIoA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUoEKqy4ZIoA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUoEKqy4ZIoA%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/21b7a6ed3ba94ce01bb819abf221f998/href">https://medium.com/media/21b7a6ed3ba94ce01bb819abf221f998/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d275eec0f3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>