/kube-client

Primary LanguageGoMIT LicenseMIT

Kube Client

A Simple library to deal with API REST

Technology   |    Project   |    How to Run   |    License

License

The objective of this project is to develop a an HTTP client library for defined REST API. You can found this the problem definition in the following links

🚀 Technology

The library is built using

It provides a cohesive and straightforward interface to interact with a REST API, focusing on Deployments resource.

💻 Project

kube-client is an HTTP client library for a REST API that manages Deployments resources. It supports POST, GET, and DELETE operations and offers custom error handling for better user experience.

Features:

  • Simple Client Initialization: Easily create a new instance of the client with custom configurations.
  • CRUD Operations: Perform POST, GET, and DELETE operations on Deployments.
  • Custom Error Handling: Receive detailed error messages to understand and debug issues better.

📖 How to Run

Installation:

   go get github.com/rafaelmgr12/kube-client

Usage

  • Initialize the Client:
import "github.com/rafaelmgr12/kube-client/kube"

client := kube.NewClient(kube.WithBaseURL("http://api-url.com"), kube.WithTimeout(30))
  • Create a Deployment
deployment := &deployment.Deployment{
    Name:      "example-deployment",
    Namespace: "default",
    Replicas:  3,
}
createdDeployment, err := client.CreateDeployment(deployment)
  • Retrieve a Deployment:
deploymentID := "uuid-of-deployment"
retrievedDeployment, err := client.GetDeployment(deploymentID)
  • Delete a Deployment:
deploymentID := "uuid-of-deployment"
err := client.DeleteDeployment(deploymentID)

For more detailed documentation, please refer to the Detailed Documentation.

📄 License

The projects is under the MIT license. See the file LICENSE fore more details