utils

package
v0.0.0-...-601a7b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Copyright © 2021 Rasa Technologies GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskForConfirmation

func AskForConfirmation(s string, retry int, in io.Reader) (bool, error)

AskForConfirmation waits for a input to confirm an operation and returns `true` if the input == 'yes'.

func CheckHelmChartDir

func CheckHelmChartDir()

CheckHelmChartDir checks if a local Helm chart directory exists.

func CommandExists

func CommandExists(cmd string) bool

Check if a given command exists.

func GetActiveNamespace

func GetActiveNamespace(log logr.Logger) string

GetActiveNamespace returns an active namespace, it checks the .rasactl file if exists and reads a namespace from the file or it gets the current-deployment from the rasactl configuration file.

func GetPasswordStdin

func GetPasswordStdin() (string, error)

GetPasswordStdin reads a password from STDIN.

func GetRasaXURLEnv

func GetRasaXURLEnv(namespace string) string

GetRasaXURLEnv returns Rasa X URL passed via environment variables.

func HelmChartVersionConstrains

func HelmChartVersionConstrains(helmChartVersion string) error

HelmChartVersionConstrains checks if the rasa-x-helm chart version is within constraints boundaries.

func IsDebugOrVerboseEnabled

func IsDebugOrVerboseEnabled() bool

func IsURLAccessible

func IsURLAccessible(address string) bool

IsURLAccessible returns `true` if a client can connect to a given URL.

func MergeMaps

func MergeMaps(maps ...map[string]interface{}) map[string]interface{}

MergeMaps merges maps into one.

func RasaXVersionConstrains

func RasaXVersionConstrains(version string, constraint string) bool

RasaXVersionConstrains checks if Rasa X version is within constraints boundaries.

func ReadCredentials

func ReadCredentials(flags *types.RasaCtlFlags) (string, string, error)

ReadCredentials reads a username and a password from input.

func ReadLicense

func ReadLicense(flags *types.RasaCtlFlags) (string, error)

ReadLicense reads an Enterprise license from input.

func StringSliceToJSON

func StringSliceToJSON(d [][]string) (string, error)

StringSliceToJSON converts [][]string{} to JSON.

func ValidateName

func ValidateName(name string) error

Types

type NetworkError

type NetworkError string
const (
	NetworkErrorConnectionRefused NetworkError = "ConnectionRefused"
)

func CheckNetworkError

func CheckNetworkError(err error) (NetworkError, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL