package
0.0.0-20240826161825-8a41a536c8b9
Repository: https://github.com/khulnasoft/meshkit.git
Documentation: pkg.go.dev

# README

The Utils Package

The Utils Package is the Central component of Meshkit. This package encompases different packages that offers a simplified and tailored experience for developers working with Kubernetes and Helm. Developers can easily interact with Kubernetes and Helm without relying on the command line versions by utilizing higher-level functions from the utils package. Here is a brief description of some of the packages embedded in Utils:

Broadcast

The BroadCast package provides a simple and concurrent way to implement a broadcast channel, where messages can be submitted and multiple subscribers can register to receive those messages. It allows for decoupling the provider and subscribers and facilitates pubsub communication between components in a system.

Component

The Component Package genarates a component definition struct which may contain various fields that provide information about the component, such as the component kind, API version, display name, schema, and metadata based on a custom CRD. The Component package also Extracts the JSON schema of the CRD using the provided CUE path configuration.

Kuberentes

The kubernetes package provides functionality for working with Kubernetes clusters .The package defines a Client that encapsulates the necessary components for interacting with the Kubernetes API server. This package contains certain packages such as describe, expose, Kompose, manifests and walker for interacting with the kubernetes Api Server. Below are descriptions of each package:

Describe
Describe Package  is a comprehensive and user-friendly solution for describing Kubernetes objects through the Kubernetes API. With its rich set of functionalities, it contains components for creating and initiaizing a meshclient, allowing users to retrieve information about various Kubernetes resources such as pods, deployments, jobs, services, and more to interact with the kubernetes Api.
Overall, the describe package provides a convenient way to retrieve detailed information about Kubernetes resources in a standardized format.  
Expose

The Expose Package provides functionality for exposing Kubernetes resources as services.

  • The package imports various packages from the standard library and external dependencies.
  • It contains fields for specifying the service type, load balancer IP, cluster IP, namespace, session affinity, name, annotations, and a logger.
  • The Expose() is the main function of the package this takes a Kubernetes clientset, REST config, Config object, and a list of resources to expose.
  • It uses a Traverser to iterate over the resources and generate the corresponding services. Overall, this package provides a way to expose Kubernetes resources as services with customizable configurations.
Kompose

Kompose Package provides functionality for working with Docker Compose files and converting them to Kubernetes manifests. It provides the following features:

  • Validation: The package can validate a Docker Compose file against a provided JSON schema. It ensures that the file adheres to the specified structure and format.
  • Conversion: The package can convert a validated Docker Compose file into Kubernetes manifests. It transforms the services, volumes, and other components defined in the Compose file into their equivalent representations in the Kubernetes ecosystem.
  • Compatibility Check: The package checks the compatibility of the Docker Compose file version with the "kompose" tool. It verifies if the version exceeds a certain limit and throws an error if it does.
  • Formatting: The package performs formatting operations on the Docker Compose and converted Kubernetes manifest files to ensure compatibility and consistency. Overall, the kompose package aims to simplify the process of migrating from Docker Compose to Kubernetes by providing validation, conversion, and compatibility checking capabilities.

# Packages

Package broadcast implements multi-listener broadcast channels.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
combineErrors merges a slice of error into one error separated by the given separator.
No description provided by the author
ConvertMapInterfaceMapString converts map[interface{}]interface{} => map[string]interface{} It will also convert []interface{} => []string.
No description provided by the author
No description provided by the author
CreateFile creates a file with the given content on the given location with the given filename.
No description provided by the author
No description provided by the author
ErrCompressTar is the error for zipping a file into targz.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrDecodeYaml is the error when the yaml unmarshal fails.
No description provided by the author
ErrExtractTarXVZ is the error for unzipping the targz file.
ErrExtractZip is the error for unzipping the zip file.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
FormatName formats the given string to by replacing " " with "-".
getBool function returns the boolean config data.
GetHome returns the home path.
Gets the latest stable release tags from github for a given org name and repo name(in that org) in sorted order.
No description provided by the author
No description provided by the author
git method which allows fetch the git HEAD tag version and commit number.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
MergeToTemplate merges data into the template tpl and returns the result.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ReadFileSource supports "http", "https" and "file" protocols.
ReadLocalFile takes in the location of a local file in the format `file://location/of/file` and returns the content of the file if the path is valid and no error occurs.
ReadRemoteFile takes in the location of a remote file in the format 'http://location/of/file' or 'https://location/file' and returns the content of the file if the location is valid and no error occurs.
RecursiveCastMapStringInterfaceToMapStringInterface will convert a map[string]interface{} recursively => map[string]interface{}.
No description provided by the author
SortDottedStringsByDigits takes version-like dot separated digits in string format and returns them in sorted normalized form.
No description provided by the author
No description provided by the author
transforms the keys of a Map recursively with the given transform function.
Deprecated: Use Unmarshal from encoding package.
UpdateSVGString updates the width and height attributes of an SVG file and returns the modified SVG as a string.
No description provided by the author
No description provided by the author
WriteToFile writes the given content to the given file path.
No description provided by the author
No description provided by the author

# Constants

No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ErrDecodeYamlCode represents the error which is generated when yaml decode process fails.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Endpoint represents the structure for an endpoint.
No description provided by the author
No description provided by the author
No description provided by the author