Files
katenary/helm/types.go

42 lines
801 B
Go
Raw Normal View History

2021-11-30 12:04:28 +01:00
package helm
import (
"os"
"strings"
)
const K = "katenary.io"
var (
Appname = "" // set at runtime
Version = "1.0" // should be set from main.Version
)
2021-11-30 12:04:28 +01:00
// Kinded represent an object with a kind.
2021-11-30 12:04:28 +01:00
type Kinded interface {
// Get must resturn the kind name.
2021-11-30 12:04:28 +01:00
Get() string
}
// Signable represents an object with a signature.
2021-12-01 15:17:34 +01:00
type Signable interface {
// BuildSHA must return the signature.
2021-12-01 15:17:34 +01:00
BuildSHA(filename string)
}
// Named represents an object with a name.
2021-12-02 16:07:15 +01:00
type Named interface {
// Name must return the name of the object (from metadata).
2021-12-02 16:07:15 +01:00
Name() string
}
// GetProjectName returns the name of the project.
func GetProjectName() string {
2021-12-01 15:17:34 +01:00
if len(Appname) > 0 {
return Appname
}
2021-11-30 12:04:28 +01:00
p, _ := os.Getwd()
path := strings.Split(p, string(os.PathSeparator))
return path[len(path)-1]
}