{"id":18576841,"url":"https://github.com/niqdev/gopher-labs","last_synced_at":"2025-08-03T04:10:03.680Z","repository":{"id":130012310,"uuid":"523279989","full_name":"niqdev/gopher-labs","owner":"niqdev","description":"My Golang laboratory experiments","archived":false,"fork":false,"pushed_at":"2024-06-12T23:53:42.000Z","size":553,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-05T09:03:46.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niqdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-10T09:27:07.000Z","updated_at":"2023-09-11T19:54:32.000Z","dependencies_parsed_at":"2023-04-26T02:02:45.940Z","dependency_job_id":"3080715d-6998-4d7b-ba25-1c5c8ae4e9bb","html_url":"https://github.com/niqdev/gopher-labs","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqdev%2Fgopher-labs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqdev%2Fgopher-labs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqdev%2Fgopher-labs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niqdev%2Fgopher-labs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niqdev","download_url":"https://codeload.github.com/niqdev/gopher-labs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448614,"owners_count":22072765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T23:26:51.893Z","updated_at":"2025-05-16T01:09:57.892Z","avatar_url":"https://github.com/niqdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gopher-labs\n\n[![ci](https://github.com/niqdev/gopher-labs/actions/workflows/ci.yaml/badge.svg)](https://github.com/niqdev/gopher-labs/actions/workflows/ci.yaml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/niqdev/gopher-labs.svg)](https://pkg.go.dev/github.com/niqdev/gopher-labs)\n\nMy Golang laboratory experiments :hourglass_flowing_sand:\n\n## labs\n\n### myargo\n\n```bash\n# lists argo-cd applications\ngo run labs.go myargo list\n\n# submits argo workflow\ngo run labs.go myargo submit\n```\n\n### myaws\n\n* [AWS SDK for Go](https://aws.github.io/aws-sdk-go-v2/docs) documentation\n* [AWS SDK for Go V2 code examples for Amazon SQS](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/gov2/sqs)\n\n```bash\nmake local-up\n\ncurl http://localhost:4566/health | jq\n\n# verify hooks\ncurl -s localhost:4566/_localstack/init | jq .\n\n# create (see entrypoint folder)\ndocker exec -it go-dev aws --endpoint-url=http://localstack:4566 sqs create-queue \\\n  --queue-name go-sqs-example\n\n# list\ndocker exec -it go-dev aws --endpoint-url=http://localstack:4566 sqs list-queues\ndocker exec -it go-localstack awslocal sqs list-queues\n\n# produce\ndocker exec -it go-dev aws --endpoint-url=http://localstack:4566 sqs send-message \\\n  --queue-url http://localstack:4566/000000000000/go-sqs-example \\\n  --message-body \"hello\"\n\n# consume\ndocker exec -it go-dev aws --endpoint-url=http://localstack:4566 sqs receive-message \\\n  --queue-url http://localstack:4566/000000000000/go-sqs-example\n\ngo run labs.go myaws --name sqs-write\ngo run labs.go myaws --name sqs-read\n```\n\n### myconcurrency\n\n```bash\n# uses goroutine and channels\ngo run labs.go myconcurrency\n```\n\n### myconfig\n\n```bash\n# prints config examples\ngo run labs.go myconfig\n```\n\n### mycrypto\n\n```bash\n# pgp message example\ngo run labs.go mycrypto --name pgp-message\n```\n\n### mydb\n\n```bash\n# TODO requires\nCGO_ENABLED=1\n\n# SQLite CRUD examples\ngo run labs.go mydb\n\ndocker run --rm \\\n  --name=sqlitebrowser \\\n  -p 3000:3000 \\\n  -v $(pwd)/local/db:/config \\\n  lscr.io/linuxserver/sqlitebrowser:latest\n```\n\n### mydocker\n\n```bash\ngo run labs.go mydocker --name [list|run|attach]\n```\n\n### myhttp\n\n* [Top Go Web Frameworks](https://github.com/mingrammer/go-web-framework-stars)\n\n```bash\n# client\ndocker run -p 8080:80 kennethreitz/httpbin\ngo run labs.go myhttp --name client\n\n# server\ngo run labs.go myhttp --name server\ncurl -Lv http://localhost:3333/home\n\n# websocket server + web client\n# http://localhost:3333\ngo run labs.go myhttp --name ws-server\n\n# websocket client\ngo run labs.go myhttp --name ws-client\n```\n\n### mykube\n\n```bash\n# local cluster\nminikube start --driver=docker --embed-certs\nminikube delete --all\n\ngo run labs.go mykube --name [list|exec]\n\n# setup portforward example\n# minikube kubectl -- apply -f ./data/install-alpine-xfce-vnc.yaml\ngo run labs.go mykube --name create\n\n# vncviewer localhost:5900\n# http://localhost:6080\ngo run labs.go mykube --name portforward\n\n# pre-download to solve issue: ErrImagePull (120 seconds timeout)\nminikube image load edgelevel/alpine-xfce-vnc:web-0.6.0\n\n# create job and tail logs\ngo run labs.go mykube --name job\n\n# copy README.md to/from pod\ngo run labs.go mykube --name copy-to\ngo run labs.go mykube --name copy-from\n```\n\n### mylog\n\n```bash\n# zap logging examples\ngo run labs.go mylog\n```\n\n### myschema\n\n```bash\n# json and yaml schema validation\ngo run labs.go myschema\n```\n\n### myspinner\n\n```bash\ngo run labs.go myspinner\n```\n\n### myssh\n\n```bash\n# start server\ngo run labs.go myssh server\n\n# test\nnc 127.0.0.1 2222\n\n# connect with openssh\nssh-keygen -f ~/.ssh/known_hosts -R \"[localhost]:2222\"\nssh -o StrictHostKeyChecking=no foo@localhost -p 2222\n\n# connect with client\ngo run labs.go myssh client\n```\n\n### version\n\n```bash\n# git version\ngo run \\\n  -ldflags=\"-X github.com/niqdev/gopher-labs/internal.Version=$(git rev-parse HEAD)\" \\\n  labs.go version\n```\n\n## Resources\n\n* [go](https://go.dev/doc) documentation\n* [Go by Example](https://gobyexample.com)\n* [Effective Go](https://github.com/golovers/effective-go)\n* [Standard library](https://pkg.go.dev/std)\n* [Awesome Go](https://github.com/avelino/awesome-go)\n\n## Development\n\nInstall\n```bash\n# ubuntu\nsudo snap install --classic go\n\n# macos\nbrew install go\n\n# update version\ngo mod edit -go 1.21\n```\n\nSetup\n```bash\n# init project (first time)\ngo mod init github.com/niqdev/gopher-labs\n\n# update dependencies\ngo mod tidy\n\n# install dependencies (examples)\ngo get github.com/argoproj/argo-cd/v2\ngo get github.com/argoproj/argo-workflows/v3\ngo get -u github.com/hashicorp/go-retryablehttp\ngo get github.com/onsi/ginkgo/v2\ngo get github.com/onsi/gomega/...\ngo get github.com/aws/aws-sdk-go-v2\ngo get github.com/aws/aws-sdk-go-v2/config\ngo get github.com/aws/aws-sdk-go-v2/service/sqs\ngo get github.com/gorilla/websocket\ngo get github.com/ProtonMail/gopenpgp/v2\ngo get github.com/mattn/go-sqlite3\n# OBSOLETE go mod vendor\n\n# run\ngo run labs.go\n\n# list recipes\njust\n\n# build\njust build\n./build/labs\n\n# test\njust test\n```\n\nPublish\n* [Publishing a module](https://go.dev/doc/modules/publishing)\n* [How to publish a Go package](https://stackoverflow.com/questions/43716691/how-to-publish-a-go-package)\n```bash\ngit tag vX.Y.Z\ngit push origin --tags\n\n# refresh index\nGOPROXY=proxy.golang.org go list -m github.com/niqdev/gopher-labs@vX.Y.Z\n\n# install\ngo get github.com/niqdev/gopher-labs\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniqdev%2Fgopher-labs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniqdev%2Fgopher-labs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniqdev%2Fgopher-labs/lists"}