MCPcopy Index your code
hub / github.com/JeffDeCola/my-go-examples

github.com/JeffDeCola/my-go-examples @v0.0.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.3 ↗ · + Follow
282 symbols 531 edges 72 files 30 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

MY GO EXAMPLES

Tag Latest Go Reference Go Report Card codeclimate Maintainability codeclimate Issue Count MIT License jeffdecola.com

A place to keep my go examples.

Table of Contents

Documentation and Reference

ARCHITECTURES

  • BLOCKCHAIN

  • Coming soon.

  • SCRAPING

  • Coming soon.

CGO

CLIENT/SERVER

  • gRPC

  • Coming soon.

  • HTTP

  • Coming soon.

  • TCP/IP

  • Coming soon.

CLOUD SERVICE PROVIDERS

  • GOOGLE CLOUD PLATFORM

  • Coming soon.

  • MICROSOFT AZURE

  • Coming soon.

COMMON GO

  • ERROR REPORTING

  • error-example

    Error Handling using the standard error package.

  • FLAGS

  • flags

    The standard flag package makes it easy to implement command-line flag parsing.

  • LOGGING

  • logrus

    Logging using logrus package.

  • MY GENERIC GO TEMPLATE

  • jeffs-basic-go-template

    A simple go template with flags, logging & error handling.

  • TESTING

  • Coming soon.

CRYPTOGRAPHY

  • ASYMMETRIC CRYPTOGRAPHY (Great for digital signatures (verify sender) and receiving encrypted data)

  • Coming soon.

  • HASHING (Great for getting fingerprints)

  • Coming soon.

  • SYMMETRIC CRYPTOGRAPHY (Using the same key to encrypt and decrypt)

  • Coming soon.

DATABASES

  • NON-RELATIONAL

  • Coming soon.

  • RELATIONAL

  • Coming soon.

FUNCTIONS, METHODS AND INTERFACES

  • FUNCTIONS

  • functions

    Using functions to calculate the area of a rectangle and circle.

  • functions-pointers-arguments

    Using functions to calculate the area of a rectangle and circle by passing pointers.

  • METHODS

  • methods

    Using methods to calculate the area of a rectangle and circle.

  • methods-pointers-arguments

    Using methods to calculate the area of a rectangle and circle by passing pointers.

  • methods-pointers-receivers

    Using methods to calculate the area of a rectangle and circle by passing pointers and using pointer receivers.

  • INTERFACES

  • interfaces

    Using an interface to calculate the area of a rectangle and circle.

  • interfaces-pointers-arguments

    Using an interface to calculate the area of a rectangle and circle by passing pointers.

  • interfaces-pointer-receivers

    Using an interface to calculate the area of a rectangle and circle by passing pointers and using pointer receivers.

  • shapes-package

    Using an interface to calculate and manipulate simple 2D and 3D geometric shapes.

GO RUNTIME

INPUT/OUTPUT

  • IO READER

  • io-reader

    Read data (a stream of bytes) from a string, buffer, file, stdin and a pipe to a buffer using the standard io package.

  • io-reader-simple

    Read data (a stream of bytes) from a buffer to a buffer using the standard io package.

  • read-file

    Read a file (*os.File) to a buffer.

  • read-user-input

    Read user input (os.Stdin) to a buffer (using Read method) and string (using Fscan).

  • IO WRITER

  • io-writer

    Write data (a stream of bytes) to a buffer, file, stdout and a pipe from a buffer using the standard io package.

  • io-writer-simple

    Write data (a stream of bytes) to a buffer from a buffer using the standard io package.

IN-PROCESS COMMUNICATION

  • SHARED MEMORY

  • ASYNCHRONOUS

    • Coming soon.
  • SYNCHRONOUS

    A pipe provides a uni-directional communication channel. This is a very simple example of an unnamed pipe.

    This is a more robust example of an unnamed pipe showing multiple reads.

    This example of an unnamed pipe connects an io.Writer and io.Reader.

  • MESSAGE PASSING

  • ASYNCHRONOUS

    Buffered channels are uni-directional, asynchronous with no blocking.

  • SYNCHRONOUS

    Unbuffered channels are uni-directional, synchronous with blocking.

INTER-PROCESS COMMUNICATION (IPC)

IoT

  • RASPBERRY PI

  • blink-led-raspberry-pi-gpio-periph

    GPIO OUTPUT - Blink an LED via a Raspberry Pi GPIO using the periph.io/... packages.

  • push-button-raspberry-pi-gpio-periph

    GPIO INPUT - Push a button via a Raspberry Pi GPIO using the periph.io/... packages.

  • [toggle-led-with-button-raspberry-pi-gpio-periph](https://github.com/JeffDeCola/my-go-examples/tree/master/iot/raspberry-pi/toggle-led-with-bu

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

readToBufferandPrint
called by 6
input-output/io-reader/io-reader/main.go
writeFromBuffer
called by 5
input-output/io-writer/io-writer/main.go
area
called by 4
functions-methods-interfaces/methods/methods-pointers-receivers/main.go
area
called by 4
functions-methods-interfaces/methods/methods-pointers-receivers/main.go
area
called by 4
functions-methods-interfaces/interfaces/interfaces-pointers-receivers/main.go
getUserInput
called by 3
common-go/my-generic-go-template/jeffs-basic-go-template/main.go
convertStringToInt
called by 3
common-go/my-generic-go-template/jeffs-basic-go-template/main.go
size
called by 3
functions-methods-interfaces/methods/methods-pointers-receivers/main.go

Shape

Function 169
Method 64
Struct 43
Interface 6

Languages

Go100%

Modules by API surface

inter-process-communication-ipc/message-passing/operating-system/synchronous/grpc-os/pbmessage/pbmessage.pb.go35 symbols
inter-process-communication-ipc/message-passing/operating-system/synchronous/grpc-os/pbmessage/pbmessage_grpc.pb.go25 symbols
functions-methods-interfaces/methods/methods-pointers-receivers/main_test.go11 symbols
functions-methods-interfaces/interfaces/interfaces-pointers-receivers/main.go10 symbols
functions-methods-interfaces/interfaces/interfaces/main.go8 symbols
functions-methods-interfaces/methods/methods-pointers-receivers/main.go7 symbols
functions-methods-interfaces/interfaces/interfaces-pointers-receivers/main_test.go7 symbols
functions-methods-interfaces/interfaces/interfaces-pointers-arguments/main_test.go7 symbols
functions-methods-interfaces/interfaces/interfaces-pointers-arguments/main.go7 symbols
common-go/my-generic-go-template/jeffs-basic-go-template/main_test.go7 symbols
inter-process-communication-ipc/message-passing/operating-system/synchronous/grpc-os/rpcserver/rpcserver.go6 symbols
functions-methods-interfaces/interfaces/interfaces/main_test.go6 symbols

For agents

$ claude mcp add my-go-examples \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page