Skip to content

Instantly share code, notes, and snippets.

@jackstine
jackstine / generics.go
Last active October 10, 2024 02:32
Golang Generics Explained
package main
import (
"cmp"
"errors"
"fmt"
"math"
"sort"
"sync"
)
@jackstine
jackstine / main.go
Last active October 10, 2024 03:28
Heap using merge K sorted List Nodes
package main
import (
"container/heap"
"fmt"
)
type ListNode struct {
Val int
Next *ListNode
Got it! You need a structured way to retrieve values using a combination of configuration, environment variables, and AWS Secrets Manager. Let’s break this down into logical Go components:
• Configuration Loader: Reads the configuration file to define how values are retrieved.
• Static Value Getter: Acts as a manager that determines if a value comes from an environment variable or AWS Secrets Manager.
• Secret Retriever: Handles fetching and parsing secrets from AWS Secrets Manager.
• Structs: Holds the values retrieved for easy access.
Project Structure
valuegetter/
│── config/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Animated Striped Pillar</title>
<style>
body {
margin: 0;
padding: 20px;