| | fip-commons |
Table of Contents
Overview
This library contains common packages that can be used from multiples golang
components in the
Fury Intelligent platform architecture.
The first release includes a package to solve the problem while connecting to the Kubernetes API.
Getting Started
Installation
The simplest way to use this package is to download the package from the source repo as follows:
$ go get github.com/sighupio/fip-commons
#
Usage
To use this library add this dependency to your go.mod
file by running the
go get go get github.com/sighupio/fip-commons
command. Then, import
it in your golang codebase and use it:
package demo
import (
"context"
"fmt"
"github.com/sighupio/fip-commons/pkg/kube" // Import it
)
// demo is an example implementation
func demo(){
k := kube.KubernetesClient{KubeConfig: "/home/my-user/my-kubeconfig-path"}
k.Init()
ctx := context.TODO()
err = k.Healthz(&ctx)
if err != nil {
fmt.Println("error. cluster seems to be not healthy")
}
}
Examples
This repository contains an example implementation that list namespaces using the KubernetesClient
exposed in this
golang package. It is available in the examples
directory. Follow the usage information in the
corresponding README for more info.
Developer Guide
To set the code up locally, build, run tests, etc. Please refer the
contributor's guide.
License
Check the License here