Skip to content

Commit

Permalink
updating readme and comments
Browse files Browse the repository at this point in the history
Signed-off-by: Kris Nóva <kris@nivenly.com>
  • Loading branch information
krisnova committed Jun 24, 2021
1 parent cd22423 commit 8d8c727
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ Test your code directly in local Kubernetes using [kind](https://github.com/kube

Get your application directly into Go instead of YAML and use it in controllers, operators, CRs/CRDs easily. Use the Go compiler to your advantage.

#### Quickstart

Check out the [examples](https://github.com/naml-examples) GitHub organization.

- [simple](https://github.com/naml-examples/simple) basic CLI example.

#### Implement Deployable

As long as there is a Go system that implements this interface it can be used with `naml`. See examples for how to include an implementation in your project.
Expand Down
3 changes: 2 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ package naml

import (
"fmt"
"path"

"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/homedir"
"path"
)

// Client is used to authenticate with Kubernetes and build the Kube client
Expand Down
6 changes: 5 additions & 1 deletion registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
package naml

import (
"github.com/kris-nova/logger"
"os"

"github.com/kris-nova/logger"
)

var registry = make(map[string]Deployable)

// Register an application with naml
func Register(app Deployable) {

// Validate the application
Expand All @@ -50,10 +52,12 @@ func Register(app Deployable) {
registry[app.Meta().Name] = app
}

// Registry will return the registry
func Registry() map[string]Deployable {
return registry
}

// Find an application by name
func Find(name string) Deployable {
if app, ok := registry[name]; ok {
return app
Expand Down

0 comments on commit 8d8c727

Please sign in to comment.