core

module
v0.0.0-...-717446a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2025 License: Apache-2.0

README

Core Infra

This repository contains modules providing the core infra for other projects with many required functionalities, some of which are high lighted as follows

Errors package

Errors package available out of the box in golang does not provide options to carry information regarding error codes, this typically becomes handy while comparing and checking for error types, rather than comparing error message strings returned by different functions, enabling writing more sturdy, reliable and quality code Includes most common supported error types like

  • Already Exists / duplicate entry
  • Entry Not Found
  • Invalid Argument
  • and more, while defaulting to unknown error type, while code is not set
Mongo DB Client

Mongo DB client routines, allowing streamlining and centralizing the core functions and operations with standard implementation. with most of the capabilities offered by mongo DB

Reconciler infra

Reconciler infra is influenced by kubernetes controller and manager infrastructure. However, unlike kubernetes here this infra is responsible for providing Reconciliation engine while working with any data store instead of Kubernetes CRDs. Where currently it supports mongodb client based data store as well as a local cached datastore based reconciliation logics

Additionally, infra has pipelines support maintaining separate pipelines for individual clients allowing capability of requeuing the entry to be processed again after some time or observed error while processing it, so requeue for processing again immediately.

Sync Package

Sync infra provides logic for synchronization between processes and/or microservices. Providing a base logic layer allowing seemslessly working between multiple microservices working in tandom. This package provides following support

Owner Infra

Owner infra is the base requirement for anyone using sync package, where they initialize the owner infra with datastore to be used along with the owner name for the reference, where any sync construct provided will be using this owner name as the reference for managing sync constructs while ensuring cleanup of sync objects when the corresponding owner object is deleted either due to shutdown or timeout/agedout by participating processes.

Here this also ensures appending an autogenerated ID along with the owner name providing capability to seemlessly work with multiple replicas of same microservice and handling restart scenarios (graceful as well as non-graceful)

Lock infra

Lock infra provides sync construct equivalent of mutex but capability of working across processes as functionality is provided out of mongodb backed datastore. This allows holding and managing a lock across processes while possibly running on different physical servers (kubernetes nodes)

Provider and Observer infra

This infra is motivated with providing capability of working with service providers possibly comming from multiple replicas or processes and observers with a need to react on availability of first provider or unavailability of last provider to trigger certain logics, while moving from 1 provider to multiple are typically handled due to a load balancer capabilities provided by kubernetes or equivalent systems

SMTP Wrapper

This is a wrapper over an above standard net/smtp providing client and other constructs to work with emails based triggers and communication over emails while device compatible smtp email account is provided

Directories

Path Synopsis
test command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL