Documentation ¶
Index ¶
- Constants
- func CheckAndGetProjectGoPkg() string
- func CombineManifests(base, manifest []byte) []byte
- func GenerateCombinedGlobalManifest() (*os.File, error)
- func GenerateCombinedNamespacedManifest() (*os.File, error)
- func GetGopath() string
- func MustGetwd() string
- func MustGoProjectCmd(cmd *cobra.Command)
- func MustInProjectRoot()
- func SetGopath(currentGopath string) string
- type OperatorType
Constants ¶
const (
GopathEnv = "GOPATH"
)
const (
SrcDir = "src"
)
Variables ¶
This section is empty.
Functions ¶
func CheckAndGetProjectGoPkg ¶ added in v0.2.0
func CheckAndGetProjectGoPkg() string
CheckAndGetProjectGoPkg checks if this project's repository path is rooted under $GOPATH and returns the current directory's import path e.g: "github.com/example-inc/app-operator"
func CombineManifests ¶ added in v0.3.0
CombineManifests combines a given manifest with a base manifest and adds yaml style separation. Nothing is appended if the manifest is empty.
func GenerateCombinedGlobalManifest ¶ added in v0.3.0
GenerateCombinedGlobalManifest creates a temporary manifest yaml containing all standard global resource manifests combined into 1 file
func GenerateCombinedNamespacedManifest ¶ added in v0.3.0
GenerateCombinedNamespacedManifest creates a temporary manifest yaml containing all standard namespaced resource manifests combined into 1 file
func GetGopath ¶ added in v0.2.0
func GetGopath() string
GetGopath gets GOPATH and makes sure it is set and non-empty.
func MustGoProjectCmd ¶ added in v0.2.0
func MustInProjectRoot ¶
func MustInProjectRoot()
MustInProjectRoot checks if the current dir is the project root and returns the current repo's import path e.g github.com/example-inc/app-operator
Types ¶
type OperatorType ¶
type OperatorType = string
OperatorType - the type of operator
const ( // OperatorTypeGo - golang type of operator. OperatorTypeGo OperatorType = "go" // OperatorTypeAnsible - ansible type of operator. OperatorTypeAnsible OperatorType = "ansible" // OperatorTypeHelm - helm type of operator. OperatorTypeHelm OperatorType = "helm" // OperatorTypeUnknown - unknown type of operator. OperatorTypeUnknown OperatorType = "unknown" )
func GetOperatorType ¶
func GetOperatorType() OperatorType
GetOperatorType returns type of operator is in cwd This function should be called after verifying the user is in project root e.g: "go", "ansible"