[{"data":1,"prerenderedAt":2642},["ShallowReactive",2],{"blog-aws-s3-golang":3,"blog-all-for-related":2148},{"id":4,"title":5,"author":6,"body":7,"cardAlt":5,"categories":2133,"description":2136,"draft":2137,"extension":2138,"headerImage":2139,"keywords":2140,"meta":2141,"name":2142,"navigation":315,"path":2143,"seo":2144,"series":6,"stem":2145,"updated":6,"year":2146,"__hash__":2147},"blog\u002Fblog\u002Faws-s3-golang.md","Uploading images to AWS S3 in Golang",null,{"type":8,"value":9,"toc":2123},"minimark",[10,14,17,2119],[11,12,13],"p",{},"Recently I came across a use case where I had to store and manage images on backend. AWS (Amazon Web Service) provides with S3 storage for this purpose. AWS is one of the most popular cloud services provider and is used by a large companies like Netflix, Uber, etc.",[11,15,16],{},"In this tutorial I'll cover how to upload, fetch and manage other operations for objects on AWS S3 in Golang. Let's get started!",[18,19,20,23,28,39,48,56,59,89,91,95,98,105,178,189,191,195,206,280,282,286,293,536,538,542,549,616,618,622,629,1104,1106,1110,1117,1520,1522,1526,1533,1871],"ads",{},[21,22],"hr",{},[24,25,27],"h2",{"id":26},"setting-up-aws-s3","Setting up AWS S3",[11,29,30,31,38],{},"AWS comes with a free trial to help you gain hands-on experience with the AWS platform, products, and services for free. You can signup for AWS ",[32,33,37],"a",{"href":34,"rel":35},"https:\u002F\u002Faws.amazon.com\u002Ffree",[36],"nofollow","here",".",[11,40,41,42,47],{},"Next you need to create a s3 bucket. Since there are a couple of tutorials explaining this, I'll skip this. You can ",[32,43,46],{"href":44,"rel":45},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fquickstarts\u002Flatest\u002Fs3backup\u002Fstep-1-create-bucket.html",[36],"follow this"," for setting up s3 account.",[11,49,50,51,38],{},"I am assuming you have a basic Golang app in place. So next step is to fetch the ",[32,52,55],{"href":53,"rel":54},"https:\u002F\u002Fgithub.com\u002Faws\u002Faws-sdk-go",[36],"official AWS SDK for Golang",[11,57,58],{},"Run the following command -",[60,61,66],"pre",{"className":62,"code":63,"language":64,"meta":65,"style":65},"language-bash shiki shiki-themes github-light github-dark","go get -u github.com\u002Faws\u002Faws-sdk-go\u002F...\n","bash","",[67,68,69],"code",{"__ignoreMap":65},[70,71,74,78,82,86],"span",{"class":72,"line":73},"line",1,[70,75,77],{"class":76},"sScJk","go",[70,79,81],{"class":80},"sZZnC"," get",[70,83,85],{"class":84},"sj4cs"," -u",[70,87,88],{"class":80}," github.com\u002Faws\u002Faws-sdk-go\u002F...\n",[21,90],{},[24,92,94],{"id":93},"configuring-environment-variables","Configuring environment variables",[11,96,97],{},"AWS S3 requires to create a session before we make any further request. This is basically for authentication for calls that will be made in this session.",[11,99,100,101,38],{},"While you setup your S3, you would have saved your secret key and ID. Also, AWS has multiple regions, you can check your region ",[32,102,37],{"href":103,"rel":104},"https:\u002F\u002Fs3.console.aws.amazon.com\u002Fs3\u002Fhome",[36],[60,106,108],{"className":62,"code":107,"language":64,"meta":65,"style":65},"AWS_REGION = ap-south-1\nAWS_ACCESS_KEY_ID = \u003CYOUR ACCESS ID> #AKIAIOSFODNN7EXAMPLE\nAWS_SECRET_ACCESS_KEY = \u003CYOUR ACCESS KEY> #wJalrXUtnFEMI\u002FK7MDENG\u002FbPxRfiCYEXAMPLEKEY\n",[67,109,110,121,153],{"__ignoreMap":65},[70,111,112,115,118],{"class":72,"line":73},[70,113,114],{"class":76},"AWS_REGION",[70,116,117],{"class":80}," =",[70,119,120],{"class":80}," ap-south-1\n",[70,122,124,127,129,133,136,139,142,146,149],{"class":72,"line":123},2,[70,125,126],{"class":76},"AWS_ACCESS_KEY_ID",[70,128,117],{"class":80},[70,130,132],{"class":131},"szBVR"," \u003C",[70,134,135],{"class":80},"YOUR",[70,137,138],{"class":80}," ACCESS",[70,140,141],{"class":80}," I",[70,143,145],{"class":144},"sVt8B","D",[70,147,148],{"class":131},">",[70,150,152],{"class":151},"sJ8bj"," #AKIAIOSFODNN7EXAMPLE\n",[70,154,156,159,161,163,165,167,170,173,175],{"class":72,"line":155},3,[70,157,158],{"class":76},"AWS_SECRET_ACCESS_KEY",[70,160,117],{"class":80},[70,162,132],{"class":131},[70,164,135],{"class":80},[70,166,138],{"class":80},[70,168,169],{"class":80}," KE",[70,171,172],{"class":144},"Y",[70,174,148],{"class":131},[70,176,177],{"class":151}," #wJalrXUtnFEMI\u002FK7MDENG\u002FbPxRfiCYEXAMPLEKEY\n",[11,179,180,181,184,185,188],{},"You can add configs either in you ",[67,182,183],{},".env"," file, ",[67,186,187],{},"yaml"," or other formats.",[21,190],{},[24,192,194],{"id":193},"coding-out-s3-operations","Coding out S3 operations",[11,196,197,198,201,202,205],{},"So I use ",[67,199,200],{},"applications.yml"," to manage configs for environment variables. Here is the ",[67,203,204],{},"AWSConfig"," struct which contains all the information related to AWS required for fetching S3 operations.",[60,207,210],{"className":208,"code":209,"language":77,"meta":65,"style":65},"language-go shiki shiki-themes github-light github-dark","type AWSConfig struct {\n    AccessKeyID     string\n    AccessKeySecret string\n    Region          string\n    BucketName      string\n    UploadTimeout   int\n    BaseURL         string\n}\n",[67,211,212,226,234,241,249,257,266,274],{"__ignoreMap":65},[70,213,214,217,220,223],{"class":72,"line":73},[70,215,216],{"class":131},"type",[70,218,219],{"class":76}," AWSConfig",[70,221,222],{"class":131}," struct",[70,224,225],{"class":144}," {\n",[70,227,228,231],{"class":72,"line":123},[70,229,230],{"class":144},"    AccessKeyID     ",[70,232,233],{"class":131},"string\n",[70,235,236,239],{"class":72,"line":155},[70,237,238],{"class":144},"    AccessKeySecret ",[70,240,233],{"class":131},[70,242,244,247],{"class":72,"line":243},4,[70,245,246],{"class":144},"    Region          ",[70,248,233],{"class":131},[70,250,252,255],{"class":72,"line":251},5,[70,253,254],{"class":144},"    BucketName      ",[70,256,233],{"class":131},[70,258,260,263],{"class":72,"line":259},6,[70,261,262],{"class":144},"    UploadTimeout   ",[70,264,265],{"class":131},"int\n",[70,267,269,272],{"class":72,"line":268},7,[70,270,271],{"class":144},"    BaseURL         ",[70,273,233],{"class":131},[70,275,277],{"class":72,"line":276},8,[70,278,279],{"class":144},"}\n",[21,281],{},[24,283,285],{"id":284},"creating-a-session","Creating a session",[11,287,288,289,292],{},"AWS requires to create a session before making API calls. This acts as an authentication layer. Create a new file ",[67,290,291],{},"s3.go"," . Here is a method to setup session -",[60,294,296],{"className":208,"code":295,"language":77,"meta":65,"style":65},"\u002F\u002F s3.go\npackage s3\n\nimport (\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Faws\"\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Faws\u002Fcredentials\"\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Faws\u002Fsession\"\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Fservice\u002Fs3\"\n)\n\n\u002F\u002F This function creates session and requires AWS credentials\nfunc CreateSession(awsConfig config.AWSConfig) *session.Session {\n    sess := session.Must(session.NewSession(\n        &aws.Config{\n            Region: aws.String(awsConfig.Region),\n            Credentials: credentials.NewStaticCredentials(\n                awsConfig.AccessKeyID,\n                awsConfig.AccessKeySecret,\n                \"\",\n            ),\n        },\n    ))\n    return sess\n}\n",[67,297,298,303,311,317,325,336,345,354,363,369,374,380,419,443,460,472,483,489,495,504,510,516,522,531],{"__ignoreMap":65},[70,299,300],{"class":72,"line":73},[70,301,302],{"class":151},"\u002F\u002F s3.go\n",[70,304,305,308],{"class":72,"line":123},[70,306,307],{"class":131},"package",[70,309,310],{"class":76}," s3\n",[70,312,313],{"class":72,"line":155},[70,314,316],{"emptyLinePlaceholder":315},true,"\n",[70,318,319,322],{"class":72,"line":243},[70,320,321],{"class":131},"import",[70,323,324],{"class":144}," (\n",[70,326,327,330,333],{"class":72,"line":251},[70,328,329],{"class":80},"    \"",[70,331,332],{"class":76},"github.com\u002Faws\u002Faws-sdk-go\u002Faws",[70,334,335],{"class":80},"\"\n",[70,337,338,340,343],{"class":72,"line":259},[70,339,329],{"class":80},[70,341,342],{"class":76},"github.com\u002Faws\u002Faws-sdk-go\u002Faws\u002Fcredentials",[70,344,335],{"class":80},[70,346,347,349,352],{"class":72,"line":268},[70,348,329],{"class":80},[70,350,351],{"class":76},"github.com\u002Faws\u002Faws-sdk-go\u002Faws\u002Fsession",[70,353,335],{"class":80},[70,355,356,358,361],{"class":72,"line":276},[70,357,329],{"class":80},[70,359,360],{"class":76},"github.com\u002Faws\u002Faws-sdk-go\u002Fservice\u002Fs3",[70,362,335],{"class":80},[70,364,366],{"class":72,"line":365},9,[70,367,368],{"class":144},")\n",[70,370,372],{"class":72,"line":371},10,[70,373,316],{"emptyLinePlaceholder":315},[70,375,377],{"class":72,"line":376},11,[70,378,379],{"class":151},"\u002F\u002F This function creates session and requires AWS credentials\n",[70,381,383,386,389,392,396,399,401,403,406,409,412,414,417],{"class":72,"line":382},12,[70,384,385],{"class":131},"func",[70,387,388],{"class":76}," CreateSession",[70,390,391],{"class":144},"(",[70,393,395],{"class":394},"s4XuR","awsConfig",[70,397,398],{"class":76}," config",[70,400,38],{"class":144},[70,402,204],{"class":76},[70,404,405],{"class":144},") ",[70,407,408],{"class":131},"*",[70,410,411],{"class":76},"session",[70,413,38],{"class":144},[70,415,416],{"class":76},"Session",[70,418,225],{"class":144},[70,420,422,425,428,431,434,437,440],{"class":72,"line":421},13,[70,423,424],{"class":144},"    sess ",[70,426,427],{"class":131},":=",[70,429,430],{"class":144}," session.",[70,432,433],{"class":76},"Must",[70,435,436],{"class":144},"(session.",[70,438,439],{"class":76},"NewSession",[70,441,442],{"class":144},"(\n",[70,444,446,449,452,454,457],{"class":72,"line":445},14,[70,447,448],{"class":131},"        &",[70,450,451],{"class":76},"aws",[70,453,38],{"class":144},[70,455,456],{"class":76},"Config",[70,458,459],{"class":144},"{\n",[70,461,463,466,469],{"class":72,"line":462},15,[70,464,465],{"class":144},"            Region: aws.",[70,467,468],{"class":76},"String",[70,470,471],{"class":144},"(awsConfig.Region),\n",[70,473,475,478,481],{"class":72,"line":474},16,[70,476,477],{"class":144},"            Credentials: credentials.",[70,479,480],{"class":76},"NewStaticCredentials",[70,482,442],{"class":144},[70,484,486],{"class":72,"line":485},17,[70,487,488],{"class":144},"                awsConfig.AccessKeyID,\n",[70,490,492],{"class":72,"line":491},18,[70,493,494],{"class":144},"                awsConfig.AccessKeySecret,\n",[70,496,498,501],{"class":72,"line":497},19,[70,499,500],{"class":80},"                \"\"",[70,502,503],{"class":144},",\n",[70,505,507],{"class":72,"line":506},20,[70,508,509],{"class":144},"            ),\n",[70,511,513],{"class":72,"line":512},21,[70,514,515],{"class":144},"        },\n",[70,517,519],{"class":72,"line":518},22,[70,520,521],{"class":144},"    ))\n",[70,523,525,528],{"class":72,"line":524},23,[70,526,527],{"class":131},"    return",[70,529,530],{"class":144}," sess\n",[70,532,534],{"class":72,"line":533},24,[70,535,279],{"class":144},[21,537],{},[24,539,541],{"id":540},"creating-s3-session","Creating S3 Session",[11,543,544,545,548],{},"In the previous step we create a AWS session. But for using S3 we need to create ",[67,546,547],{},"s3 session",". Following is a function to create that. You can combine it with previous method too.",[60,550,552],{"className":208,"code":551,"language":77,"meta":65,"style":65},"func CreateS3Session(sess *session.Session) *s3.S3 {\n    s3Session := s3.New(sess)\n    return s3Session\n}\n",[67,553,554,589,605,612],{"__ignoreMap":65},[70,555,556,558,561,563,566,569,571,573,575,577,579,582,584,587],{"class":72,"line":73},[70,557,385],{"class":131},[70,559,560],{"class":76}," CreateS3Session",[70,562,391],{"class":144},[70,564,565],{"class":394},"sess",[70,567,568],{"class":131}," *",[70,570,411],{"class":76},[70,572,38],{"class":144},[70,574,416],{"class":76},[70,576,405],{"class":144},[70,578,408],{"class":131},[70,580,581],{"class":76},"s3",[70,583,38],{"class":144},[70,585,586],{"class":76},"S3",[70,588,225],{"class":144},[70,590,591,594,596,599,602],{"class":72,"line":123},[70,592,593],{"class":144},"    s3Session ",[70,595,427],{"class":131},[70,597,598],{"class":144}," s3.",[70,600,601],{"class":76},"New",[70,603,604],{"class":144},"(sess)\n",[70,606,607,609],{"class":72,"line":155},[70,608,527],{"class":131},[70,610,611],{"class":144}," s3Session\n",[70,613,614],{"class":72,"line":243},[70,615,279],{"class":144},[21,617],{},[24,619,621],{"id":620},"uploading-images-to-s3","Uploading images to S3",[11,623,624,625,628],{},"Once we have s3 session, we can start with uploading images now. The method below creates new Uploader instance that uses the ",[67,626,627],{},"Upload"," method to upload the object to S3.",[60,630,632],{"className":208,"code":631,"language":77,"meta":65,"style":65},"\u002F\u002F upload_objects_s3.go\npackage s3\n\nimport (\n    \"s3_blog\u002Finternal\u002Fconfig\"\n    \"s3_blog\u002Fpkg\u002Flogger\"\n    \"fmt\"\n    \"os\"\n\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Faws\"\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Faws\u002Fawserr\"\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Faws\u002Frequest\"\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Faws\u002Fsession\"\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Fservice\u002Fs3\u002Fs3manager\"\n)\n\n\u002F\u002F bucket: name of your s3 bucket\n\u002F\u002F filePath: path to file you want to upload\n\u002F\u002F fileName: name with which it will be present on s3\nfunc UploadObject(bucket string, filePath string, fileName string, sess *session.Session, awsConfig config.AWSConfig) error {\n\n    \u002F\u002F Open file to upload\n    file, err := os.Open(filePath)\n    if err != nil {\n        logger.Error(\"Unable to open file %q, %v\", err)\n        return err\n    }\n    defer file.Close()\n\n    \u002F\u002F Upload to s3\n    uploader := s3manager.NewUploader(sess)\n    _, err = uploader.Upload(&s3manager.UploadInput{\n        Bucket: aws.String(bucket),\n        Key:    aws.String(fileName),\n        Body:   file,\n    })\n\n    if err != nil {\n        logger.Error(os.Stderr, \"failed to upload object, %v\\n\", err)\n        return err\n    }\n\n    fmt.Printf(\"Successfully uploaded %q to %q\\n\", fileName, bucket)\n    return nil\n}\n",[67,633,634,639,645,649,655,664,673,682,691,695,703,712,721,729,738,742,746,751,756,761,820,824,829,845,861,889,898,904,919,924,930,946,975,986,997,1003,1009,1014,1027,1047,1054,1059,1064,1091,1099],{"__ignoreMap":65},[70,635,636],{"class":72,"line":73},[70,637,638],{"class":151},"\u002F\u002F upload_objects_s3.go\n",[70,640,641,643],{"class":72,"line":123},[70,642,307],{"class":131},[70,644,310],{"class":76},[70,646,647],{"class":72,"line":155},[70,648,316],{"emptyLinePlaceholder":315},[70,650,651,653],{"class":72,"line":243},[70,652,321],{"class":131},[70,654,324],{"class":144},[70,656,657,659,662],{"class":72,"line":251},[70,658,329],{"class":80},[70,660,661],{"class":76},"s3_blog\u002Finternal\u002Fconfig",[70,663,335],{"class":80},[70,665,666,668,671],{"class":72,"line":259},[70,667,329],{"class":80},[70,669,670],{"class":76},"s3_blog\u002Fpkg\u002Flogger",[70,672,335],{"class":80},[70,674,675,677,680],{"class":72,"line":268},[70,676,329],{"class":80},[70,678,679],{"class":76},"fmt",[70,681,335],{"class":80},[70,683,684,686,689],{"class":72,"line":276},[70,685,329],{"class":80},[70,687,688],{"class":76},"os",[70,690,335],{"class":80},[70,692,693],{"class":72,"line":365},[70,694,316],{"emptyLinePlaceholder":315},[70,696,697,699,701],{"class":72,"line":371},[70,698,329],{"class":80},[70,700,332],{"class":76},[70,702,335],{"class":80},[70,704,705,707,710],{"class":72,"line":376},[70,706,329],{"class":80},[70,708,709],{"class":76},"github.com\u002Faws\u002Faws-sdk-go\u002Faws\u002Fawserr",[70,711,335],{"class":80},[70,713,714,716,719],{"class":72,"line":382},[70,715,329],{"class":80},[70,717,718],{"class":76},"github.com\u002Faws\u002Faws-sdk-go\u002Faws\u002Frequest",[70,720,335],{"class":80},[70,722,723,725,727],{"class":72,"line":421},[70,724,329],{"class":80},[70,726,351],{"class":76},[70,728,335],{"class":80},[70,730,731,733,736],{"class":72,"line":445},[70,732,329],{"class":80},[70,734,735],{"class":76},"github.com\u002Faws\u002Faws-sdk-go\u002Fservice\u002Fs3\u002Fs3manager",[70,737,335],{"class":80},[70,739,740],{"class":72,"line":462},[70,741,368],{"class":144},[70,743,744],{"class":72,"line":474},[70,745,316],{"emptyLinePlaceholder":315},[70,747,748],{"class":72,"line":485},[70,749,750],{"class":151},"\u002F\u002F bucket: name of your s3 bucket\n",[70,752,753],{"class":72,"line":491},[70,754,755],{"class":151},"\u002F\u002F filePath: path to file you want to upload\n",[70,757,758],{"class":72,"line":497},[70,759,760],{"class":151},"\u002F\u002F fileName: name with which it will be present on s3\n",[70,762,763,765,768,770,773,776,779,782,784,786,789,791,793,795,797,799,801,803,805,807,809,811,813,815,818],{"class":72,"line":506},[70,764,385],{"class":131},[70,766,767],{"class":76}," UploadObject",[70,769,391],{"class":144},[70,771,772],{"class":394},"bucket",[70,774,775],{"class":131}," string",[70,777,778],{"class":144},", ",[70,780,781],{"class":394},"filePath",[70,783,775],{"class":131},[70,785,778],{"class":144},[70,787,788],{"class":394},"fileName",[70,790,775],{"class":131},[70,792,778],{"class":144},[70,794,565],{"class":394},[70,796,568],{"class":131},[70,798,411],{"class":76},[70,800,38],{"class":144},[70,802,416],{"class":76},[70,804,778],{"class":144},[70,806,395],{"class":394},[70,808,398],{"class":76},[70,810,38],{"class":144},[70,812,204],{"class":76},[70,814,405],{"class":144},[70,816,817],{"class":131},"error",[70,819,225],{"class":144},[70,821,822],{"class":72,"line":512},[70,823,316],{"emptyLinePlaceholder":315},[70,825,826],{"class":72,"line":518},[70,827,828],{"class":151},"    \u002F\u002F Open file to upload\n",[70,830,831,834,836,839,842],{"class":72,"line":524},[70,832,833],{"class":144},"    file, err ",[70,835,427],{"class":131},[70,837,838],{"class":144}," os.",[70,840,841],{"class":76},"Open",[70,843,844],{"class":144},"(filePath)\n",[70,846,847,850,853,856,859],{"class":72,"line":533},[70,848,849],{"class":131},"    if",[70,851,852],{"class":144}," err ",[70,854,855],{"class":131},"!=",[70,857,858],{"class":84}," nil",[70,860,225],{"class":144},[70,862,864,867,870,872,875,878,880,883,886],{"class":72,"line":863},25,[70,865,866],{"class":144},"        logger.",[70,868,869],{"class":76},"Error",[70,871,391],{"class":144},[70,873,874],{"class":80},"\"Unable to open file ",[70,876,877],{"class":84},"%q",[70,879,778],{"class":80},[70,881,882],{"class":84},"%v",[70,884,885],{"class":80},"\"",[70,887,888],{"class":144},", err)\n",[70,890,892,895],{"class":72,"line":891},26,[70,893,894],{"class":131},"        return",[70,896,897],{"class":144}," err\n",[70,899,901],{"class":72,"line":900},27,[70,902,903],{"class":144},"    }\n",[70,905,907,910,913,916],{"class":72,"line":906},28,[70,908,909],{"class":131},"    defer",[70,911,912],{"class":144}," file.",[70,914,915],{"class":76},"Close",[70,917,918],{"class":144},"()\n",[70,920,922],{"class":72,"line":921},29,[70,923,316],{"emptyLinePlaceholder":315},[70,925,927],{"class":72,"line":926},30,[70,928,929],{"class":151},"    \u002F\u002F Upload to s3\n",[70,931,933,936,938,941,944],{"class":72,"line":932},31,[70,934,935],{"class":144},"    uploader ",[70,937,427],{"class":131},[70,939,940],{"class":144}," s3manager.",[70,942,943],{"class":76},"NewUploader",[70,945,604],{"class":144},[70,947,949,952,955,958,960,962,965,968,970,973],{"class":72,"line":948},32,[70,950,951],{"class":144},"    _, err ",[70,953,954],{"class":131},"=",[70,956,957],{"class":144}," uploader.",[70,959,627],{"class":76},[70,961,391],{"class":144},[70,963,964],{"class":131},"&",[70,966,967],{"class":76},"s3manager",[70,969,38],{"class":144},[70,971,972],{"class":76},"UploadInput",[70,974,459],{"class":144},[70,976,978,981,983],{"class":72,"line":977},33,[70,979,980],{"class":144},"        Bucket: aws.",[70,982,468],{"class":76},[70,984,985],{"class":144},"(bucket),\n",[70,987,989,992,994],{"class":72,"line":988},34,[70,990,991],{"class":144},"        Key:    aws.",[70,993,468],{"class":76},[70,995,996],{"class":144},"(fileName),\n",[70,998,1000],{"class":72,"line":999},35,[70,1001,1002],{"class":144},"        Body:   file,\n",[70,1004,1006],{"class":72,"line":1005},36,[70,1007,1008],{"class":144},"    })\n",[70,1010,1012],{"class":72,"line":1011},37,[70,1013,316],{"emptyLinePlaceholder":315},[70,1015,1017,1019,1021,1023,1025],{"class":72,"line":1016},38,[70,1018,849],{"class":131},[70,1020,852],{"class":144},[70,1022,855],{"class":131},[70,1024,858],{"class":84},[70,1026,225],{"class":144},[70,1028,1030,1032,1034,1037,1040,1043,1045],{"class":72,"line":1029},39,[70,1031,866],{"class":144},[70,1033,869],{"class":76},[70,1035,1036],{"class":144},"(os.Stderr, ",[70,1038,1039],{"class":80},"\"failed to upload object, ",[70,1041,1042],{"class":84},"%v\\n",[70,1044,885],{"class":80},[70,1046,888],{"class":144},[70,1048,1050,1052],{"class":72,"line":1049},40,[70,1051,894],{"class":131},[70,1053,897],{"class":144},[70,1055,1057],{"class":72,"line":1056},41,[70,1058,903],{"class":144},[70,1060,1062],{"class":72,"line":1061},42,[70,1063,316],{"emptyLinePlaceholder":315},[70,1065,1067,1070,1073,1075,1078,1080,1083,1086,1088],{"class":72,"line":1066},43,[70,1068,1069],{"class":144},"    fmt.",[70,1071,1072],{"class":76},"Printf",[70,1074,391],{"class":144},[70,1076,1077],{"class":80},"\"Successfully uploaded ",[70,1079,877],{"class":84},[70,1081,1082],{"class":80}," to ",[70,1084,1085],{"class":84},"%q\\n",[70,1087,885],{"class":80},[70,1089,1090],{"class":144},", fileName, bucket)\n",[70,1092,1094,1096],{"class":72,"line":1093},44,[70,1095,527],{"class":131},[70,1097,1098],{"class":84}," nil\n",[70,1100,1102],{"class":72,"line":1101},45,[70,1103,279],{"class":144},[21,1105],{},[24,1107,1109],{"id":1108},"downloading-images-from-s3","Downloading images from S3",[11,1111,1112,1113,1116],{},"We can download the image we have uploaded using the method below. Here we create new Downloader instance to fetch objects from S3. Then we use the ",[67,1114,1115],{},"Download"," method that downloads the object.",[60,1118,1120],{"className":208,"code":1119,"language":77,"meta":65,"style":65},"\u002F\u002F download_objects_s3.go\npackage s3\n\nimport (\n    \"s3_blog\u002Finternal\u002Fconfig\"\n    \"s3_blog\u002Fpkg\u002Flogger\"\n    \"fmt\"\n    \"os\"\n\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Faws\"\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Faws\u002Fsession\"\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Fservice\u002Fs3\"\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Fservice\u002Fs3\u002Fs3manager\"\n)\n\n\u002F\u002F bucket: name of your s3 bucket\n\u002F\u002F item: name of object on s3 that you want to download\n\u002F\u002F fileName: name of file where this object will be downloaded\nfunc DownloadObject(bucket string, item string, fileName string, sess *session.Session, awsConfig config.AWSConfig) error {\n    \u002F\u002F open file to save contents to\n    file, err := os.Open(fileName)\n    if err != nil {\n        logger.Error(\"Unable to open file %q, %v\", err)\n        return err\n    }\n    defer file.Close()\n\n    \u002F\u002F Download from s3\n    downloader := s3manager.NewDownloader(sess)\n    numBytes, err := downloader.Download(file,\n        &s3.GetObjectInput{\n            Bucket: aws.String(bucket),\n            Key:    aws.String(item),\n        },\n    )\n    if err != nil {\n        logger.Error(\"Unable to download item %q, %v\", item, err)\n        return err\n    }\n\n    fmt.Println(\"Downloaded\", file.Name(), numBytes, \"bytes\")\n    return nil\n}\n",[67,1121,1122,1127,1133,1137,1143,1151,1159,1167,1175,1179,1187,1195,1203,1211,1215,1219,1223,1228,1233,1287,1292,1305,1317,1337,1343,1347,1357,1361,1366,1380,1395,1408,1417,1427,1431,1436,1448,1470,1476,1480,1484,1510,1516],{"__ignoreMap":65},[70,1123,1124],{"class":72,"line":73},[70,1125,1126],{"class":151},"\u002F\u002F download_objects_s3.go\n",[70,1128,1129,1131],{"class":72,"line":123},[70,1130,307],{"class":131},[70,1132,310],{"class":76},[70,1134,1135],{"class":72,"line":155},[70,1136,316],{"emptyLinePlaceholder":315},[70,1138,1139,1141],{"class":72,"line":243},[70,1140,321],{"class":131},[70,1142,324],{"class":144},[70,1144,1145,1147,1149],{"class":72,"line":251},[70,1146,329],{"class":80},[70,1148,661],{"class":76},[70,1150,335],{"class":80},[70,1152,1153,1155,1157],{"class":72,"line":259},[70,1154,329],{"class":80},[70,1156,670],{"class":76},[70,1158,335],{"class":80},[70,1160,1161,1163,1165],{"class":72,"line":268},[70,1162,329],{"class":80},[70,1164,679],{"class":76},[70,1166,335],{"class":80},[70,1168,1169,1171,1173],{"class":72,"line":276},[70,1170,329],{"class":80},[70,1172,688],{"class":76},[70,1174,335],{"class":80},[70,1176,1177],{"class":72,"line":365},[70,1178,316],{"emptyLinePlaceholder":315},[70,1180,1181,1183,1185],{"class":72,"line":371},[70,1182,329],{"class":80},[70,1184,332],{"class":76},[70,1186,335],{"class":80},[70,1188,1189,1191,1193],{"class":72,"line":376},[70,1190,329],{"class":80},[70,1192,351],{"class":76},[70,1194,335],{"class":80},[70,1196,1197,1199,1201],{"class":72,"line":382},[70,1198,329],{"class":80},[70,1200,360],{"class":76},[70,1202,335],{"class":80},[70,1204,1205,1207,1209],{"class":72,"line":421},[70,1206,329],{"class":80},[70,1208,735],{"class":76},[70,1210,335],{"class":80},[70,1212,1213],{"class":72,"line":445},[70,1214,368],{"class":144},[70,1216,1217],{"class":72,"line":462},[70,1218,316],{"emptyLinePlaceholder":315},[70,1220,1221],{"class":72,"line":474},[70,1222,750],{"class":151},[70,1224,1225],{"class":72,"line":485},[70,1226,1227],{"class":151},"\u002F\u002F item: name of object on s3 that you want to download\n",[70,1229,1230],{"class":72,"line":491},[70,1231,1232],{"class":151},"\u002F\u002F fileName: name of file where this object will be downloaded\n",[70,1234,1235,1237,1240,1242,1244,1246,1248,1251,1253,1255,1257,1259,1261,1263,1265,1267,1269,1271,1273,1275,1277,1279,1281,1283,1285],{"class":72,"line":497},[70,1236,385],{"class":131},[70,1238,1239],{"class":76}," DownloadObject",[70,1241,391],{"class":144},[70,1243,772],{"class":394},[70,1245,775],{"class":131},[70,1247,778],{"class":144},[70,1249,1250],{"class":394},"item",[70,1252,775],{"class":131},[70,1254,778],{"class":144},[70,1256,788],{"class":394},[70,1258,775],{"class":131},[70,1260,778],{"class":144},[70,1262,565],{"class":394},[70,1264,568],{"class":131},[70,1266,411],{"class":76},[70,1268,38],{"class":144},[70,1270,416],{"class":76},[70,1272,778],{"class":144},[70,1274,395],{"class":394},[70,1276,398],{"class":76},[70,1278,38],{"class":144},[70,1280,204],{"class":76},[70,1282,405],{"class":144},[70,1284,817],{"class":131},[70,1286,225],{"class":144},[70,1288,1289],{"class":72,"line":506},[70,1290,1291],{"class":151},"    \u002F\u002F open file to save contents to\n",[70,1293,1294,1296,1298,1300,1302],{"class":72,"line":512},[70,1295,833],{"class":144},[70,1297,427],{"class":131},[70,1299,838],{"class":144},[70,1301,841],{"class":76},[70,1303,1304],{"class":144},"(fileName)\n",[70,1306,1307,1309,1311,1313,1315],{"class":72,"line":518},[70,1308,849],{"class":131},[70,1310,852],{"class":144},[70,1312,855],{"class":131},[70,1314,858],{"class":84},[70,1316,225],{"class":144},[70,1318,1319,1321,1323,1325,1327,1329,1331,1333,1335],{"class":72,"line":524},[70,1320,866],{"class":144},[70,1322,869],{"class":76},[70,1324,391],{"class":144},[70,1326,874],{"class":80},[70,1328,877],{"class":84},[70,1330,778],{"class":80},[70,1332,882],{"class":84},[70,1334,885],{"class":80},[70,1336,888],{"class":144},[70,1338,1339,1341],{"class":72,"line":533},[70,1340,894],{"class":131},[70,1342,897],{"class":144},[70,1344,1345],{"class":72,"line":863},[70,1346,903],{"class":144},[70,1348,1349,1351,1353,1355],{"class":72,"line":891},[70,1350,909],{"class":131},[70,1352,912],{"class":144},[70,1354,915],{"class":76},[70,1356,918],{"class":144},[70,1358,1359],{"class":72,"line":900},[70,1360,316],{"emptyLinePlaceholder":315},[70,1362,1363],{"class":72,"line":906},[70,1364,1365],{"class":151},"    \u002F\u002F Download from s3\n",[70,1367,1368,1371,1373,1375,1378],{"class":72,"line":921},[70,1369,1370],{"class":144},"    downloader ",[70,1372,427],{"class":131},[70,1374,940],{"class":144},[70,1376,1377],{"class":76},"NewDownloader",[70,1379,604],{"class":144},[70,1381,1382,1385,1387,1390,1392],{"class":72,"line":926},[70,1383,1384],{"class":144},"    numBytes, err ",[70,1386,427],{"class":131},[70,1388,1389],{"class":144}," downloader.",[70,1391,1115],{"class":76},[70,1393,1394],{"class":144},"(file,\n",[70,1396,1397,1399,1401,1403,1406],{"class":72,"line":932},[70,1398,448],{"class":131},[70,1400,581],{"class":76},[70,1402,38],{"class":144},[70,1404,1405],{"class":76},"GetObjectInput",[70,1407,459],{"class":144},[70,1409,1410,1413,1415],{"class":72,"line":948},[70,1411,1412],{"class":144},"            Bucket: aws.",[70,1414,468],{"class":76},[70,1416,985],{"class":144},[70,1418,1419,1422,1424],{"class":72,"line":977},[70,1420,1421],{"class":144},"            Key:    aws.",[70,1423,468],{"class":76},[70,1425,1426],{"class":144},"(item),\n",[70,1428,1429],{"class":72,"line":988},[70,1430,515],{"class":144},[70,1432,1433],{"class":72,"line":999},[70,1434,1435],{"class":144},"    )\n",[70,1437,1438,1440,1442,1444,1446],{"class":72,"line":1005},[70,1439,849],{"class":131},[70,1441,852],{"class":144},[70,1443,855],{"class":131},[70,1445,858],{"class":84},[70,1447,225],{"class":144},[70,1449,1450,1452,1454,1456,1459,1461,1463,1465,1467],{"class":72,"line":1011},[70,1451,866],{"class":144},[70,1453,869],{"class":76},[70,1455,391],{"class":144},[70,1457,1458],{"class":80},"\"Unable to download item ",[70,1460,877],{"class":84},[70,1462,778],{"class":80},[70,1464,882],{"class":84},[70,1466,885],{"class":80},[70,1468,1469],{"class":144},", item, err)\n",[70,1471,1472,1474],{"class":72,"line":1016},[70,1473,894],{"class":131},[70,1475,897],{"class":144},[70,1477,1478],{"class":72,"line":1029},[70,1479,903],{"class":144},[70,1481,1482],{"class":72,"line":1049},[70,1483,316],{"emptyLinePlaceholder":315},[70,1485,1486,1488,1491,1493,1496,1499,1502,1505,1508],{"class":72,"line":1056},[70,1487,1069],{"class":144},[70,1489,1490],{"class":76},"Println",[70,1492,391],{"class":144},[70,1494,1495],{"class":80},"\"Downloaded\"",[70,1497,1498],{"class":144},", file.",[70,1500,1501],{"class":76},"Name",[70,1503,1504],{"class":144},"(), numBytes, ",[70,1506,1507],{"class":80},"\"bytes\"",[70,1509,368],{"class":144},[70,1511,1512,1514],{"class":72,"line":1061},[70,1513,527],{"class":131},[70,1515,1098],{"class":84},[70,1517,1518],{"class":72,"line":1066},[70,1519,279],{"class":144},[21,1521],{},[24,1523,1525],{"id":1524},"listing-objects-on-s3","Listing objects on S3",[11,1527,1528,1529,1532],{},"You can list out objects present on s3 using ",[67,1530,1531],{},"ListObjectsV2",". This will list down all the objects in specific bucket.",[60,1534,1536],{"className":208,"code":1535,"language":77,"meta":65,"style":65},"\u002F\u002F list_objects_s3.go\npackage s3\n\nimport (\n    \"s3_blog\u002Finternal\u002Fconfig\"\n    \"s3_blog\u002Fpkg\u002Flogger\"\n    \"fmt\"\n\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Faws\"\n    \"github.com\u002Faws\u002Faws-sdk-go\u002Fservice\u002Fs3\"\n)\n\n\u002F\u002F bucket: name of your s3 bucket\n\u002F\u002F svc is the s3 session we created\nfunc ListObjects(svc *s3.S3, bucket string, awsConfig config.AWSConfig) error {\n\n    resp, err := svc.ListObjectsV2(&s3.ListObjectsV2Input{\n        Bucket: aws.String(bucket),\n    })\n\n    if err != nil {\n        logger.Error(\"Unable to list items in bucket %q, %v\", bucket, err)\n        return err\n    }\n\n    for _, item := range resp.Contents {\n        fmt.Println(\"Name:         \", *item.Key)\n        fmt.Println(\"Last modified:\", *item.LastModified)\n        fmt.Println(\"Size:         \", *item.Size)\n        fmt.Println(\"Storage class:\", *item.StorageClass)\n        fmt.Println(\"\")\n    }\n    return nil\n}\n",[67,1537,1538,1543,1549,1553,1559,1567,1575,1583,1587,1595,1603,1607,1611,1615,1620,1662,1666,1691,1699,1703,1707,1719,1741,1747,1751,1755,1771,1790,1808,1826,1844,1857,1861,1867],{"__ignoreMap":65},[70,1539,1540],{"class":72,"line":73},[70,1541,1542],{"class":151},"\u002F\u002F list_objects_s3.go\n",[70,1544,1545,1547],{"class":72,"line":123},[70,1546,307],{"class":131},[70,1548,310],{"class":76},[70,1550,1551],{"class":72,"line":155},[70,1552,316],{"emptyLinePlaceholder":315},[70,1554,1555,1557],{"class":72,"line":243},[70,1556,321],{"class":131},[70,1558,324],{"class":144},[70,1560,1561,1563,1565],{"class":72,"line":251},[70,1562,329],{"class":80},[70,1564,661],{"class":76},[70,1566,335],{"class":80},[70,1568,1569,1571,1573],{"class":72,"line":259},[70,1570,329],{"class":80},[70,1572,670],{"class":76},[70,1574,335],{"class":80},[70,1576,1577,1579,1581],{"class":72,"line":268},[70,1578,329],{"class":80},[70,1580,679],{"class":76},[70,1582,335],{"class":80},[70,1584,1585],{"class":72,"line":276},[70,1586,316],{"emptyLinePlaceholder":315},[70,1588,1589,1591,1593],{"class":72,"line":365},[70,1590,329],{"class":80},[70,1592,332],{"class":76},[70,1594,335],{"class":80},[70,1596,1597,1599,1601],{"class":72,"line":371},[70,1598,329],{"class":80},[70,1600,360],{"class":76},[70,1602,335],{"class":80},[70,1604,1605],{"class":72,"line":376},[70,1606,368],{"class":144},[70,1608,1609],{"class":72,"line":382},[70,1610,316],{"emptyLinePlaceholder":315},[70,1612,1613],{"class":72,"line":421},[70,1614,750],{"class":151},[70,1616,1617],{"class":72,"line":445},[70,1618,1619],{"class":151},"\u002F\u002F svc is the s3 session we created\n",[70,1621,1622,1624,1627,1629,1632,1634,1636,1638,1640,1642,1644,1646,1648,1650,1652,1654,1656,1658,1660],{"class":72,"line":462},[70,1623,385],{"class":131},[70,1625,1626],{"class":76}," ListObjects",[70,1628,391],{"class":144},[70,1630,1631],{"class":394},"svc",[70,1633,568],{"class":131},[70,1635,581],{"class":76},[70,1637,38],{"class":144},[70,1639,586],{"class":76},[70,1641,778],{"class":144},[70,1643,772],{"class":394},[70,1645,775],{"class":131},[70,1647,778],{"class":144},[70,1649,395],{"class":394},[70,1651,398],{"class":76},[70,1653,38],{"class":144},[70,1655,204],{"class":76},[70,1657,405],{"class":144},[70,1659,817],{"class":131},[70,1661,225],{"class":144},[70,1663,1664],{"class":72,"line":474},[70,1665,316],{"emptyLinePlaceholder":315},[70,1667,1668,1671,1673,1676,1678,1680,1682,1684,1686,1689],{"class":72,"line":485},[70,1669,1670],{"class":144},"    resp, err ",[70,1672,427],{"class":131},[70,1674,1675],{"class":144}," svc.",[70,1677,1531],{"class":76},[70,1679,391],{"class":144},[70,1681,964],{"class":131},[70,1683,581],{"class":76},[70,1685,38],{"class":144},[70,1687,1688],{"class":76},"ListObjectsV2Input",[70,1690,459],{"class":144},[70,1692,1693,1695,1697],{"class":72,"line":491},[70,1694,980],{"class":144},[70,1696,468],{"class":76},[70,1698,985],{"class":144},[70,1700,1701],{"class":72,"line":497},[70,1702,1008],{"class":144},[70,1704,1705],{"class":72,"line":506},[70,1706,316],{"emptyLinePlaceholder":315},[70,1708,1709,1711,1713,1715,1717],{"class":72,"line":512},[70,1710,849],{"class":131},[70,1712,852],{"class":144},[70,1714,855],{"class":131},[70,1716,858],{"class":84},[70,1718,225],{"class":144},[70,1720,1721,1723,1725,1727,1730,1732,1734,1736,1738],{"class":72,"line":518},[70,1722,866],{"class":144},[70,1724,869],{"class":76},[70,1726,391],{"class":144},[70,1728,1729],{"class":80},"\"Unable to list items in bucket ",[70,1731,877],{"class":84},[70,1733,778],{"class":80},[70,1735,882],{"class":84},[70,1737,885],{"class":80},[70,1739,1740],{"class":144},", bucket, err)\n",[70,1742,1743,1745],{"class":72,"line":524},[70,1744,894],{"class":131},[70,1746,897],{"class":144},[70,1748,1749],{"class":72,"line":533},[70,1750,903],{"class":144},[70,1752,1753],{"class":72,"line":863},[70,1754,316],{"emptyLinePlaceholder":315},[70,1756,1757,1760,1763,1765,1768],{"class":72,"line":891},[70,1758,1759],{"class":131},"    for",[70,1761,1762],{"class":144}," _, item ",[70,1764,427],{"class":131},[70,1766,1767],{"class":131}," range",[70,1769,1770],{"class":144}," resp.Contents {\n",[70,1772,1773,1776,1778,1780,1783,1785,1787],{"class":72,"line":900},[70,1774,1775],{"class":144},"        fmt.",[70,1777,1490],{"class":76},[70,1779,391],{"class":144},[70,1781,1782],{"class":80},"\"Name:         \"",[70,1784,778],{"class":144},[70,1786,408],{"class":131},[70,1788,1789],{"class":144},"item.Key)\n",[70,1791,1792,1794,1796,1798,1801,1803,1805],{"class":72,"line":906},[70,1793,1775],{"class":144},[70,1795,1490],{"class":76},[70,1797,391],{"class":144},[70,1799,1800],{"class":80},"\"Last modified:\"",[70,1802,778],{"class":144},[70,1804,408],{"class":131},[70,1806,1807],{"class":144},"item.LastModified)\n",[70,1809,1810,1812,1814,1816,1819,1821,1823],{"class":72,"line":921},[70,1811,1775],{"class":144},[70,1813,1490],{"class":76},[70,1815,391],{"class":144},[70,1817,1818],{"class":80},"\"Size:         \"",[70,1820,778],{"class":144},[70,1822,408],{"class":131},[70,1824,1825],{"class":144},"item.Size)\n",[70,1827,1828,1830,1832,1834,1837,1839,1841],{"class":72,"line":926},[70,1829,1775],{"class":144},[70,1831,1490],{"class":76},[70,1833,391],{"class":144},[70,1835,1836],{"class":80},"\"Storage class:\"",[70,1838,778],{"class":144},[70,1840,408],{"class":131},[70,1842,1843],{"class":144},"item.StorageClass)\n",[70,1845,1846,1848,1850,1852,1855],{"class":72,"line":932},[70,1847,1775],{"class":144},[70,1849,1490],{"class":76},[70,1851,391],{"class":144},[70,1853,1854],{"class":80},"\"\"",[70,1856,368],{"class":144},[70,1858,1859],{"class":72,"line":948},[70,1860,903],{"class":144},[70,1862,1863,1865],{"class":72,"line":977},[70,1864,527],{"class":131},[70,1866,1098],{"class":84},[70,1868,1869],{"class":72,"line":988},[70,1870,279],{"class":144},[18,1872,1873,1875,1879,2044,2046,2050,2071,2076,2099,2101,2104,2113],{},[21,1874],{},[24,1876,1878],{"id":1877},"additional-notes","Additional Notes",[1880,1881,1882,1897,2041],"ul",{},[1883,1884,1885,1886],"li",{},"There are a lot more methods you can explore based on your usecase. You can create more methods like above. Some common ones can be -",[1880,1887,1888,1891,1894],{},[1883,1889,1890],{},"ListBuckets",[1883,1892,1893],{},"DeleteObject",[1883,1895,1896],{},"RestoreObject",[1883,1898,1899,1900,1903,1904],{},"The code I presented above is good for starting out. For production I would recommend to use ",[67,1901,1902],{},"context"," based methods. So the download object method would change like this -",[60,1905,1907],{"className":208,"code":1906,"language":77,"meta":65,"style":65},"  ctx := CreateContextForTimeout(awsConfig)\n  downloader := s3manager.NewDownloader(sess)\n\n  numBytes, err := downloader.DownloadWithContext(ctx, file,\n      &s3.GetObjectInput{\n          Bucket: aws.String(bucket),\n          Key:    aws.String(item),\n      },\n  )\n  if err != nil {\n      logger.Error(\"Unable to download item %q, %v\", item, err)\n      return err\n  }\n",[67,1908,1909,1922,1935,1939,1954,1967,1976,1985,1990,1995,2008,2029,2036],{"__ignoreMap":65},[70,1910,1911,1914,1916,1919],{"class":72,"line":73},[70,1912,1913],{"class":144},"  ctx ",[70,1915,427],{"class":131},[70,1917,1918],{"class":76}," CreateContextForTimeout",[70,1920,1921],{"class":144},"(awsConfig)\n",[70,1923,1924,1927,1929,1931,1933],{"class":72,"line":123},[70,1925,1926],{"class":144},"  downloader ",[70,1928,427],{"class":131},[70,1930,940],{"class":144},[70,1932,1377],{"class":76},[70,1934,604],{"class":144},[70,1936,1937],{"class":72,"line":155},[70,1938,316],{"emptyLinePlaceholder":315},[70,1940,1941,1944,1946,1948,1951],{"class":72,"line":243},[70,1942,1943],{"class":144},"  numBytes, err ",[70,1945,427],{"class":131},[70,1947,1389],{"class":144},[70,1949,1950],{"class":76},"DownloadWithContext",[70,1952,1953],{"class":144},"(ctx, file,\n",[70,1955,1956,1959,1961,1963,1965],{"class":72,"line":251},[70,1957,1958],{"class":131},"      &",[70,1960,581],{"class":76},[70,1962,38],{"class":144},[70,1964,1405],{"class":76},[70,1966,459],{"class":144},[70,1968,1969,1972,1974],{"class":72,"line":259},[70,1970,1971],{"class":144},"          Bucket: aws.",[70,1973,468],{"class":76},[70,1975,985],{"class":144},[70,1977,1978,1981,1983],{"class":72,"line":268},[70,1979,1980],{"class":144},"          Key:    aws.",[70,1982,468],{"class":76},[70,1984,1426],{"class":144},[70,1986,1987],{"class":72,"line":276},[70,1988,1989],{"class":144},"      },\n",[70,1991,1992],{"class":72,"line":365},[70,1993,1994],{"class":144},"  )\n",[70,1996,1997,2000,2002,2004,2006],{"class":72,"line":371},[70,1998,1999],{"class":131},"  if",[70,2001,852],{"class":144},[70,2003,855],{"class":131},[70,2005,858],{"class":84},[70,2007,225],{"class":144},[70,2009,2010,2013,2015,2017,2019,2021,2023,2025,2027],{"class":72,"line":376},[70,2011,2012],{"class":144},"      logger.",[70,2014,869],{"class":76},[70,2016,391],{"class":144},[70,2018,1458],{"class":80},[70,2020,877],{"class":84},[70,2022,778],{"class":80},[70,2024,882],{"class":84},[70,2026,885],{"class":80},[70,2028,1469],{"class":144},[70,2030,2031,2034],{"class":72,"line":382},[70,2032,2033],{"class":131},"      return",[70,2035,897],{"class":144},[70,2037,2038],{"class":72,"line":421},[70,2039,2040],{"class":144},"  }\n",[1883,2042,2043],{},"Never keep your Key ID and Key Secret in your code. Always put it as environment variable.",[21,2045],{},[24,2047,2049],{"id":2048},"resources","Resources",[1880,2051,2052,2058,2064],{},[1883,2053,2054],{},[32,2055,2057],{"href":53,"rel":2056},[36],"AWS SDK Golang",[1883,2059,2060],{},[32,2061,2063],{"href":44,"rel":2062},[36],"AWS Quick Start Guide - S3",[1883,2065,2066],{},[32,2067,2070],{"href":2068,"rel":2069},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fsdk-for-go\u002Fv1\u002Fdeveloper-guide\u002Fs3-example-basic-bucket-operations.html",[36],"Basic S3 operations",[2072,2073,2075],"h3",{"id":2074},"books-to-learn-golang","Books to learn Golang",[1880,2077,2078,2085,2092],{},[1883,2079,2080],{},[32,2081,2084],{"href":2082,"rel":2083},"https:\u002F\u002Famzn.to\u002F3fYLCqz",[36],"Go Programming Language",[1883,2086,2087],{},[32,2088,2091],{"href":2089,"rel":2090},"https:\u002F\u002Famzn.to\u002F3s7fWS3",[36],"Learning Go",[1883,2093,2094],{},[32,2095,2098],{"href":2096,"rel":2097},"https:\u002F\u002Famzn.to\u002F3t6PM37",[36],"Go in Action",[21,2100],{},[11,2102,2103],{},"I hope you learned something new. Feel free to suggest improvements ✔️",[11,2105,2106,2107,2112],{},"I share regular updates and resources on ",[32,2108,2111],{"href":2109,"rel":2110},"https:\u002F\u002Ftwitter.com\u002Fmkfeuhrer",[36],"Twitter",". Let's connect!",[11,2114,2115],{},[2116,2117,2118],"strong",{},"Keep exploring 🔎 Keep learning 🚀",[2120,2121,2122],"style",{},"html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}",{"title":65,"searchDepth":123,"depth":123,"links":2124},[2125,2126,2127,2128,2129,2130,2131,2132],{"id":26,"depth":123,"text":27},{"id":93,"depth":123,"text":94},{"id":193,"depth":123,"text":194},{"id":284,"depth":123,"text":285},{"id":540,"depth":123,"text":541},{"id":620,"depth":123,"text":621},{"id":1108,"depth":123,"text":1109},{"id":1524,"depth":123,"text":1525},[2134,2135],"Golang","Programming","In this tutorial I cover how to upload, fetch and manage other operations for objects on AWS S3 in Golang",false,"md","blog\u002Faws-s3-golang\u002Faws-s3-golang-card.webp","golang aws s3 example, golang s3 upload object, golang s3 download object, golang s3 list object",{},"aws-s3-golang","\u002Fblog\u002Faws-s3-golang",{"title":5,"description":2136},"blog\u002Faws-s3-golang","2020-01-12","iHr2y2kt-Al6aFQkV8wbLBmLH8CiCHn6GbDOwGx4Fmo",[2149,2156,2158,2166,2175,2182,2189,2196,2202,2208,2214,2220,2226,2236,2242,2249,2256,2263,2269,2276,2282,2288,2294,2300,2306,2312,2318,2324,2331,2338,2344,2350,2356,2362,2368,2374,2380,2386,2392,2398,2404,2410,2416,2423,2429,2435,2441,2448,2454,2460,2467,2474,2480,2487,2493,2500,2506,2513,2519,2525,2531,2537,2543,2549,2555,2561,2567,2573,2579,2585,2592,2598,2605,2611,2617,2623,2630,2636],{"path":2150,"title":2151,"description":2152,"categories":2153,"draft":315,"year":2155,"series":6},"\u002Fblog\u002Fai-assisted-workstation","Building an AI-Assisted Personal Workstation","How I built a personal AI workstation: markdown knowledge base, portable agent skills, handoff-driven sessions. What worked, what broke, what I would change.",[2154,2135],"Productivity","2026-08-26",{"path":2143,"title":5,"description":2136,"categories":2157,"draft":2137,"year":2146,"series":6},[2134,2135],{"path":2159,"title":2160,"description":2161,"categories":2162,"draft":2137,"year":2165,"series":6},"\u002Fblog\u002Fbooks-for-engineers","Best Books for Software Engineers","Best Books to help you build you software engineering career - ranging from fundamentats, interview prep to productivity.",[2163,2164],"Books","Life","2021-12-26",{"path":2167,"title":2168,"description":2169,"categories":2170,"draft":2137,"year":2174,"series":6},"\u002Fblog\u002Fbuilding-acrons","Building Acrons 🚀","Building Acrons, a one-stop tool to decode everyday acronyms like DIY, FOMO, and BRB without losing your flow.",[2171,2172,2173],"Side Projects","Web","Tools","2020-05-26",{"path":2176,"title":2177,"description":2178,"categories":2179,"draft":2137,"year":2181,"series":6},"\u002Fblog\u002Fcap-theorem","CAP Theorem Explained","Learn the concept and misconceptions around popular CAP theorem in system design.",[2180,2135],"System Design","2021-07-26",{"path":2183,"title":2184,"description":2185,"categories":2186,"draft":2137,"year":2188,"series":6},"\u002Fblog\u002Fcode-reviews","Code Review Checklist","Why code reviews matter, and best practices that catch bugs early and keep code quality high before merge.",[2187],"Engineering Principles","2020-07-20",{"path":2190,"title":2191,"description":2192,"categories":2193,"draft":2137,"year":2195,"series":6},"\u002Fblog\u002Fdark-mode","Add Dark mode to websites","Dark mode is ❤️️ Add it to your websites with little CSS and JS",[2194,2172],"Javascript","2020-07-04",{"path":2197,"title":2198,"description":2199,"categories":2200,"draft":2137,"year":2201,"series":6},"\u002Fblog\u002Fdate-time-golang","Working with Date and Time in Go","Learn how to use time in Golang - Multiple formats, locations and using date.",[2134,2135],"2020-10-09",{"path":2203,"title":2204,"description":2205,"categories":2206,"draft":2137,"year":2207,"series":6},"\u002Fblog\u002Fdefer-in-golang","Understanding Defer In Golang","Learn about defer keyword in golang and how it can help you avoid panics due to bugs.",[2134,2135],"2021-05-05",{"path":2209,"title":2210,"description":2211,"categories":2212,"draft":2137,"year":2213,"series":6},"\u002Fblog\u002Fenums-golang","Implementing Enums in Golang","Enums are a way to defined set of constant values. Learn how to implement enums in Go using iota with examples.",[2134,2135],"2021-12-18",{"path":2215,"title":2216,"description":2217,"categories":2218,"draft":2137,"year":2219,"series":6},"\u002Fblog\u002Fenvironment-variable-golang","Guide to Environment variables in Go","Learn what are environment variables and how to use them in Go",[2134,2135],"2020-08-14",{"path":2221,"title":2222,"description":2223,"categories":2224,"draft":2137,"year":2225,"series":6},"\u002Fblog\u002Ferror-handling-golang","Handle errors the right way — Golang","How to handle errors in golang to make your life easy",[2134,2135],"2020-01-30",{"path":2227,"title":2228,"description":2229,"categories":2230,"draft":315,"year":2233,"series":2234},"\u002Fblog\u002Ffile-attack-document-macros","File Attack Deep Dives, Part 3: Document Macros","How malicious VBA hides in vbaProject.bin, which AutoOpen entry points fire it, and the sandbox signals that catch it.",[2231,2232],"Security","Systems","2026-09-17",{"name":2235,"part":155},"File Attack Deep Dives",{"path":2237,"title":2238,"description":2239,"categories":2240,"draft":2137,"year":2155,"series":2241},"\u002Fblog\u002Ffile-attack-field-guide","How File-Based Attacks Land: A Detection Engineer's Field Guide","A practical taxonomy of how malware and phishing arrive as files, why classic controls miss them, and how detection should think.",[2231,2232],{"name":2235,"part":73},{"path":2243,"title":2244,"description":2245,"categories":2246,"draft":315,"year":2247,"series":2248},"\u002Fblog\u002Ffile-attack-html-smuggling","File Attack Deep Dives, Part 2: HTML Smuggling","How attackers assemble malware inside the browser with Blob URLs, and the URL and script tells that catch it.",[2231,2232],"2026-09-10",{"name":2235,"part":123},{"path":2250,"title":2251,"description":2252,"categories":2253,"draft":315,"year":2254,"series":2255},"\u002Fblog\u002Ffile-attack-lnk-iso","File Attack Deep Dives, Part 5: LNK and ISO Smuggling","How ISO containers and weaponized shortcuts bypass Mark of the Web, and the forensic fields that catch them.",[2231,2232],"2026-10-01",{"name":2235,"part":251},{"path":2257,"title":2258,"description":2259,"categories":2260,"draft":315,"year":2261,"series":2262},"\u002Fblog\u002Ffile-attack-pdf-url-actions","File Attack Deep Dives, Part 4: PDF URL Actions","How PDF OpenAction, Launch, and URI actions turn opening a document into a phishing click, and the action audit that catches them.",[2231,2232],"2026-09-24",{"name":2235,"part":243},{"path":2264,"title":2265,"description":2266,"categories":2267,"draft":2137,"year":2268,"series":6},"\u002Fblog\u002Ffile-upload-golang","Uploading Files in Golang with Multipart Request","Learn how to upload files from your client to server as a multipart request in Golang.",[2134,2135],"2021-03-13",{"path":2270,"title":2271,"description":2272,"categories":2273,"draft":2137,"year":2275,"series":6},"\u002Fblog\u002Fgit-branch","Git Branch 101","Branching is a new path of development that makes it a lot easier to build features. Learn why and how to use branching in git.",[2274,2135],"Git","2022-03-20",{"path":2277,"title":2278,"description":2279,"categories":2280,"draft":2137,"year":2281,"series":6},"\u002Fblog\u002Fgit-pull-request-template","Guide to Pull Request Templates","Improve collaboration and code reviews with pull request templates. Blog include PR template and how to create one on github\u002Fgitlab",[2274,2135],"2023-08-24",{"path":2283,"title":2284,"description":2285,"categories":2286,"draft":2137,"year":2287,"series":6},"\u002Fblog\u002Fgit-remove-sensitive-info","Securing Git: Remove Sensitive Information","Protect your code from security breaches by using BFG tool to remove sensitive information from Git history. Learn how to do it in this comprehensive guide.",[2274,2135],"2023-10-16",{"path":2289,"title":2290,"description":2291,"categories":2292,"draft":2137,"year":2293,"series":6},"\u002Fblog\u002Fgit-tags-explained","Git tags : Explained","What Git tags are, why and when to use them, and how to start tagging releases in your own projects.",[2274,2135],"2020-06-18",{"path":2295,"title":2296,"description":2297,"categories":2298,"draft":2137,"year":2299,"series":6},"\u002Fblog\u002Fgo-dependency-injection","Dependency Injection in Go using Wire","Learn about dependency injection, its benefits and how to implement it in Go services using wire",[2134,2135],"2022-11-26",{"path":2301,"title":2302,"description":2303,"categories":2304,"draft":2137,"year":2305,"series":6},"\u002Fblog\u002Fgo-generics","Introduction to Generics in Go","Learn about generics in Golang, it's benefits and how to implement it in applications.",[2134,2135],"2022-11-27",{"path":2307,"title":2308,"description":2309,"categories":2310,"draft":2137,"year":2311,"series":6},"\u002Fblog\u002Fgo-in-memory-cache","Building In-Memory Cache in Go","Learn about in-memory caching in Golang, it's benefits and how to implement it with and without generics with a TTL(expiry).",[2134,2135],"2024-03-28",{"path":2313,"title":2314,"description":2315,"categories":2316,"draft":2137,"year":2317,"series":6},"\u002Fblog\u002Fgo-makefile","Ultimate Makefile for Golang","Boost your productivity and save time with ultimate Makefile for Golang projects.",[2134,2135],"2024-06-10",{"path":2319,"title":2320,"description":2321,"categories":2322,"draft":2137,"year":2323,"series":6},"\u002Fblog\u002Fgo-middleware","Mastering Middlewares in Golang","Learn about middlewares, their use cases and how to implement them in Golang applications",[2134,2135],"2022-03-13",{"path":2325,"title":2326,"description":2327,"categories":2328,"draft":2137,"year":2330,"series":6},"\u002Fblog\u002Fgo-naming-conventions","Naming Conventions in Golang","Why naming conventions matter in Go, with best practices and practical examples for clear, readable, maintainable code.",[2134,2135,2329],"Code Quality","2023-05-19",{"path":2332,"title":2333,"description":2334,"categories":2335,"draft":2137,"year":2337,"series":6},"\u002Fblog\u002Fgo-with-redis","Go with Redis","A practical introduction to using Redis with Golang to make your applications faster with in-memory data storage.",[2134,2336,2135],"Database","2020-05-03",{"path":2339,"title":2340,"description":2341,"categories":2342,"draft":2137,"year":2343,"series":6},"\u002Fblog\u002Fgolang-maps","Learn Maps in Golang (with examples)","A complete guide to maps in Golang: creating maps, adding and removing items, iterating, and how map equality works.",[2134,2135],"2020-09-10",{"path":2345,"title":2346,"description":2347,"categories":2348,"draft":2137,"year":2349,"series":6},"\u002Fblog\u002Fguide-to-cdn","Guide to Content Delivery Network","CDN is one of the backbone of modern world internet infrastructure. Learn about Content Delivery Network, it's working, types and benefits.",[2180,2135],"2022-01-23",{"path":2351,"title":2352,"description":2353,"categories":2354,"draft":2137,"year":2355,"series":6},"\u002Fblog\u002Fguide-to-rule-engines","Guide to Rule Engines","Rule Engines help in solving changing business requirements with ease. Learn all about Rule engines, it's working, benefits and how to implement one in Golang",[2134,2135],"2022-09-12",{"path":2357,"title":2358,"description":2359,"categories":2360,"draft":2137,"year":2361,"series":6},"\u002Fblog\u002Fhexagonal-architecture","Guide to Hexagonal Architecture","Learn how to design efficient application with hexagonal architecture with practical example",[2180,2135],"2020-12-13",{"path":2363,"title":2364,"description":2365,"categories":2366,"draft":2137,"year":2367,"series":6},"\u002Fblog\u002Fhttp-status-codes","Learn HTTP Status Codes","A tour of HTTP response status codes, what each class means, and when to use which code in your applications.",[2172,2135],"2020-07-30",{"path":2369,"title":2370,"description":2371,"categories":2372,"draft":2137,"year":2373,"series":6},"\u002Fblog\u002Fintroduction-to-goroutines","Introduction to Goroutines","Understand the basics of concurrency and learn how to work with Goroutines in golang.",[2134,2135],"2021-04-10",{"path":2375,"title":2376,"description":2377,"categories":2378,"draft":2137,"year":2379,"series":6},"\u002Fblog\u002Fjson-in-postgres-with-golang","Storing JSON in Postgres with Golang","Learn how to store JSON objects in Postgres and how to implement it in Golang.",[2135,2336,2134],"2021-02-13",{"path":2381,"title":2382,"description":2383,"categories":2384,"draft":2137,"year":2385,"series":6},"\u002Fblog\u002Fjson-web-token","Complete Guide to JWT","JSON Web Tokens are a very compact way to carry information. Learn about JWTs in depth, from its structure to when to use it.",[2135,2172],"2021-11-20",{"path":2387,"title":2388,"description":2389,"categories":2390,"draft":2137,"year":2391,"series":6},"\u002Fblog\u002Flearn-to-say-no","Learning to say No","Learn why it's important to say 'NO'. How it helps in increasing productivity and explore strategies for saying No",[2164,2163],"2022-04-09",{"path":2393,"title":2394,"description":2395,"categories":2396,"draft":2137,"year":2397,"series":6},"\u002Fblog\u002Flearn-unlearn-relearn","Learn - Unlearn - Relearn","Unlearning things to learn new is the way to grow. Discover how to do that!",[2154,2164],"2020-09-25",{"path":2399,"title":2400,"description":2401,"categories":2402,"draft":2137,"year":2403,"series":6},"\u002Fblog\u002Flinting-in-golang","Introduction to Linting in Go","Introduction to improving code quality using linting. Learn how to add linting in your Go projects.",[2134,2135],"2021-07-07",{"path":2405,"title":2406,"description":2407,"categories":2408,"draft":2137,"year":2409,"series":6},"\u002Fblog\u002Fload-balancing","Load Balancing 101","Complete guide on load balancers explaining the internal working and how does it help in making applications efficient.",[2180,2135],"2021-05-29",{"path":2411,"title":2412,"description":2413,"categories":2414,"draft":2137,"year":2415,"series":6},"\u002Fblog\u002Fmaking-decisions-the-right-way","Making Decisions: The right way","Decisions are hard! Learn how to make the right decisions always",[2154,2164],"2020-06-07",{"path":2417,"title":2418,"description":2419,"categories":2420,"draft":2137,"year":2422,"series":6},"\u002Fblog\u002Fmanage-logs-with-logrotate","Using Logrotate to manage logs","Learn how to use logrotate system utility to manage logs with example",[2421,2135],"Linux","2020-09-08",{"path":2424,"title":2425,"description":2426,"categories":2427,"draft":2137,"year":2428,"series":6},"\u002Fblog\u002Fmarshal-structs-golang","Marshal structs the right way: Golang","Why Golang marshals empty structs into your JSON instead of null, and how to marshal structs the right way.",[2134,2135],"2020-03-31",{"path":2430,"title":2431,"description":2432,"categories":2433,"draft":2137,"year":2434,"series":6},"\u002Fblog\u002Fnotes-almanack-naval","Book Notes : Almanack of Naval Ravikant","My notes\u002Fhighlights from Almanack of Naval Ravikant book by Eric Jorgenson",[2163,2164],"2020-10-17",{"path":2436,"title":2437,"description":2438,"categories":2439,"draft":2137,"year":2440,"series":6},"\u002Fblog\u002Fnotes-anything-you-want","Book Notes : Anything you want","My notes\u002Fhighlights from Anything you want book by Derek Sivers",[2163,2164],"2021-09-25",{"path":2442,"title":2443,"description":2444,"categories":2445,"draft":2137,"year":2447,"series":6},"\u002Fblog\u002Fnotes-getting-real","Book Notes : Getting Real","My notes and highlights from Getting Real by Jason Fried and David Heinemeier Hansson on building web applications.",[2163,2446],"Startups","2020-11-03",{"path":2449,"title":2450,"description":2451,"categories":2452,"draft":2137,"year":2453,"series":6},"\u002Fblog\u002Fnotes-hell-yeah-or-no","Book Notes : Hell Yeah or No","My notes\u002Fhighlights from Hell Yeah or No book by Derek Sivers",[2163,2164],"2020-09-16",{"path":2455,"title":2456,"description":2457,"categories":2458,"draft":2137,"year":2459,"series":6},"\u002Fblog\u002Fnotes-how-to-be-a-capitalist","Book Notes : How to Be a Capitalist Without Any Capital","My notes\u002Fhighlights from How to Be a Capitalist Without Any Capital by Nathan Latka",[2163,2446],"2020-01-07",{"path":2461,"title":2462,"description":2463,"categories":2464,"draft":2137,"year":2466,"series":6},"\u002Fblog\u002Fnotes-lean-b2b","Book Notes : Lean B2B","My notes and highlights from Lean B2B by Étienne Garbugli on assessing markets, building MVPs, and selling to businesses.",[2163,2465],"Entrepreneurship","2022-07-02",{"path":2468,"title":2469,"description":2470,"categories":2471,"draft":2137,"year":2473,"series":6},"\u002Fblog\u002Fnotes-lets-talk-money","Book Notes : Let's Talk Money","My notes and highlights from Let's Talk Money by Monica Halan on managing personal finances and savings.",[2163,2472],"Personal Finance","2021-02-26",{"path":2475,"title":2476,"description":2477,"categories":2478,"draft":2137,"year":2479,"series":6},"\u002Fblog\u002Fnotes-obviously-awesome","Book Notes : Obviously Awesome","My notes and highlights from Obviously Awesome by April Dunford on product positioning and marketing strategy.",[2163,2446],"2020-04-26",{"path":2481,"title":2482,"description":2483,"categories":2484,"draft":2137,"year":2486,"series":6},"\u002Fblog\u002Fnotes-refactoring-ui","Book Notes: Refactoring UI","My notes and highlights from Refactoring UI by Adam Wathan and Steve Schoger, full of practical design tips for engineers.",[2163,2485],"Design","2020-05-09",{"path":2488,"title":2489,"description":2490,"categories":2491,"draft":2137,"year":2492,"series":6},"\u002Fblog\u002Fnotes-rework","Book Notes: Rework","My notes and highlights from Rework by Jason Fried and David Heinemeier Hansson on a better way to succeed in business.",[2163,2446],"2021-04-14",{"path":2494,"title":2495,"description":2496,"categories":2497,"draft":2137,"year":2499,"series":6},"\u002Fblog\u002Fone-on-one-meetings","Guide to Effective 1:1 Meetings","One on One meetings are important for your personal & professional growth. Learn how to master 1:1s with your manager and peers.",[2498,2154],"Career","2023-03-05",{"path":2501,"title":2502,"description":2503,"categories":2504,"draft":2137,"year":2505,"series":6},"\u002Fblog\u002Fpersonal-okrs","Personal OKRs for Success","Why one should set personal OKRs and how to achieve success with them",[2154,2164],"2020-06-27",{"path":2507,"title":2508,"description":2509,"categories":2510,"draft":2137,"year":2512,"series":6},"\u002Fblog\u002Fpoker-tips","Poker Tips: Johns Hopkins Poker Class","Notes from Johns Hopkins poker course. This guide will help you improve in Poker and win some large pots.",[2164,2511],"Poker","2020-06-13",{"path":2514,"title":2515,"description":2516,"categories":2517,"draft":2137,"year":2518,"series":6},"\u002Fblog\u002Fpomodoro","Get work done: The Pomo Way","Learn to focus and get productive by following the Pomodoro Technique",[2154],"2020-10-24",{"path":2520,"title":2521,"description":2522,"categories":2523,"draft":2137,"year":2524,"series":6},"\u002Fblog\u002Fpostgres-constraints","Postgres Constraints","Constraints are line of defense for database. Explore various types of constrainsts in postgres",[2336,2135],"2020-11-07",{"path":2526,"title":2527,"description":2528,"categories":2529,"draft":2137,"year":2530,"series":6},"\u002Fblog\u002Fppf-explained","PPF Explained","Learn basics about Public Provident Fund and why you should invest",[2164,2472],"2020-12-24",{"path":2532,"title":2533,"description":2534,"categories":2535,"draft":2137,"year":2536,"series":6},"\u002Fblog\u002Fproductivity-chrome-extensions","Boost Productivity with Chrome Extensions","Utitizing chrome extensions to boost your productivity!",[2154,2173,2172],"2020-04-24",{"path":2538,"title":2539,"description":2540,"categories":2541,"draft":2137,"year":2542,"series":6},"\u002Fblog\u002Fproductivity-in-vscode","Improve your productivity with VS Code","Key VS Code features like the integrated terminal, shortcuts, and extensions that improved my everyday productivity.",[2154,2135],"2020-03-12",{"path":2544,"title":2545,"description":2546,"categories":2547,"draft":2137,"year":2548,"series":6},"\u002Fblog\u002Freading-101","Improving Reading 101","Why reading matters, how to build a reading habit, and what to read next - from my own journey into books.",[2163,2164],"2020-04-04",{"path":2550,"title":2551,"description":2552,"categories":2553,"draft":2137,"year":2554,"series":6},"\u002Fblog\u002Freverse-proxy","Understanding Reverse Proxy","Learn about reverse proxy, how it is different from forward proxy and explore advantages of using it in system design.",[2180,2135],"2021-10-03",{"path":2556,"title":2557,"description":2558,"categories":2559,"draft":2137,"year":2560,"series":6},"\u002Fblog\u002Frunning-periodic-background-task-golang","Running periodic background tasks in Golang","How to run periodic background tasks in Golang by combining cron-style scheduling with background execution.",[2134,2135],"2019-11-21",{"path":2562,"title":2563,"description":2564,"categories":2565,"draft":2137,"year":2566,"series":6},"\u002Fblog\u002Fsessions-in-golang","Sessions using Golang and Redis","How cookies and sessions work, and how to implement persistent login sessions in Golang using Redis.",[2134,2336,2135],"2020-02-25",{"path":2568,"title":2569,"description":2570,"categories":2571,"draft":2137,"year":2572,"series":6},"\u002Fblog\u002Fsolid-dry-kiss-yagni","Solid Dry Kiss Yagni","An introduction to the SOLID, DRY, KISS, and YAGNI principles and how they help you write cleaner, robust code.",[2187],"2020-07-17",{"path":2574,"title":2575,"description":2576,"categories":2577,"draft":2137,"year":2578,"series":6},"\u002Fblog\u002Fstack-in-golang","Implement Stack in Golang","Learn how to implement stack data structure in Golang (Full code)",[2134,2135],"2020-09-14",{"path":2580,"title":2581,"description":2582,"categories":2583,"draft":2137,"year":2584,"series":6},"\u002Fblog\u002Fstart-oss-today","Start your Open Source journey today","Start your OSS journey with intro to GIT. Participate in Hacktoberfest!",[2274,2135],"2020-09-19",{"path":2586,"title":2587,"description":2588,"categories":2589,"draft":2137,"year":2591,"series":6},"\u002Fblog\u002Fsticky-social-bar","Sticky social share component in HTML","Learn how to build a social media sharing component in HTML and add it to your website.",[2135,2590],"Frontend","2021-02-05",{"path":2593,"title":2594,"description":2595,"categories":2596,"draft":2137,"year":2597,"series":6},"\u002Fblog\u002Fterm-insurance","Term insurance Simplified","Everything you need to know before you buy a term insurance.",[2164,2472],"2020-11-29",{"path":2599,"title":2600,"description":2601,"categories":2602,"draft":2137,"year":2604,"series":6},"\u002Fblog\u002Fterminal-output-with-redirection","Handling terminal outputs with Redirection","Learn how to handle terminal outputs with Redirection and saving it to files",[2421,2603,2135],"Terminal","2020-09-06",{"path":2606,"title":2607,"description":2608,"categories":2609,"draft":2137,"year":2610,"series":6},"\u002Fblog\u002Fthink-and-grow-rich","Book Notes: Think and Grow Rich","My notes and highlights from Think and Grow Rich by Napoleon Hill, covering its process for building wealth.",[2163,2164],"2020-05-19",{"path":2612,"title":2613,"description":2614,"categories":2615,"draft":2137,"year":2616,"series":6},"\u002Fblog\u002Ftransactions-postgres-golang","Transactions on Postgres with Golang","Performing Postgres database operations in Golang with GORM, from basic queries to full transaction support.",[2134,2336,2135],"2020-03-18",{"path":2618,"title":2619,"description":2620,"categories":2621,"draft":2137,"year":2622,"series":6},"\u002Fblog\u002Fwaitgroups-in-golang","WaitGroups in Golang","Learn about WaitGroups in golang and how to use them to perform concurrent operations without blocking the main thread.",[2134,2135],"2022-05-31",{"path":2624,"title":2625,"description":2626,"categories":2627,"draft":2137,"year":2629,"series":6},"\u002Fblog\u002Fwhat-i-use","What I Use: Products and Softwares","List of what I use in my day to day life ranging from terminal, editors, softwares, devices to accessories",[2164,2628],"Tech","2024-06-01",{"path":2631,"title":2632,"description":2633,"categories":2634,"draft":2137,"year":2635,"series":6},"\u002Fblog\u002Fyear-in-review-2020","Year in Review: 2020","It's a wrap! 2020 was a crazy year, See how my year went!",[2164],"2020-12-31",{"path":2637,"title":2638,"description":2639,"categories":2640,"draft":2137,"year":2641,"series":6},"\u002Fblog\u002Fyear-in-review-2021","Year in Review: 2021","It's a wrap! 2021 was a mixed bag, full of ups and downs. Key Goal for 2022: Start now!",[2164],"2021-12-31",1788773188274]