Skip to content

JeffDeCola/my-go-examples

Repository files navigation

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

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

  • 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

  • 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

      • pipes-unnamed-simple

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

      • pipes-unnamed

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

      • pipes-unnamed-io

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

  • MESSAGE PASSING

    • ASYNCHRONOUS

      • channels-buffered

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

    • SYNCHRONOUS

INTER-PROCESS COMMUNICATION (IPC)

IoT

MODULES AND PACKAGES