strings

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResDeploymentStarted                              = "Deployment started"
	ResDeploymentUpdated                              = "Deployment updated"
	ResDeploymentDeleted                              = "Deployment deleted"
	ResDeploymentUpToDate                             = "Deployment is up-to-date"
	ResDeploymentRunning                              = "Deployment is already running"
	ResDifferentDeploymentRunning                     = "Another deployment is running, use --force to override"
	ResCachedDeletedDeploymentStarted                 = "Cache deleted, deployment started"
	ResDeploymentStoppedDeploymentStarted             = "Running deployment stopped, new deployment started"
	ResDeploymentStoppedCacheDeletedDeploymentStarted = "Running deployment stopped, cached deleted, new deployment started"
	ResDeploymentStoppedDeploymentUpToDate            = "Running deployment stopped, new deployment is up-to-date"
)

Operator responses

Variables

View Source
var (
	ErrPending       = "pending"
	ErrNotFound      = "not found"
	ErrMissing       = "missing"
	ErrMustBeDefined = "must be defined"

	ErrCannotBeEmpty = "cannot be empty"
	ErrMustBeEmpty   = "must be empty"
	ErrCannotBeNull  = "cannot be null"

	ErrRead            = "unable to read"
	ErrUnzip           = "unable to unzip file"
	ErrCreateZip       = "unable to create zip file"
	ErrCantMakeRequest = "unable to make request"

	ErrMarshalJSON      = "invalid json cannot be serialized"
	ErrUnmarshalJSON    = "invalid json"
	ErrUnmarshalYaml    = "invalid yaml"
	ErrMarshalMsgpack   = "invalid messagepack cannot be serialized"
	ErrUnmarshalMsgpack = "invalid messagepack"

	ErrClassificationTargetType = "classification models can only predict integer target values (i.e. {0, 1, ..., num_classes-1})"
	ErrRegressionTargetType     = "regression models can only predict float or integer target values"
	ErrCliNotInAppDir           = "your current working directory is not in or under a cortex app directory (identified via a top-level app.yaml file)"
	ErrLoadBalancerInitializing = "load balancer is still initializing"
	ErrUnableToAuthAws          = "unable to authenticate with AWS"
	ErrCortexInstallationBroken = "" /* 154-byte string literal not displayed */

	ErrUnexpected           = "an unexpected error occurred"
	ErrWorkflowAppMismatch  = "workflow apps do not match"
	ErrContextAppMismatch   = "context apps do not match"
	ErrMoreThanOneWorkflow  = "there is more than one workflow"
	ErrCannotSetStructField = "unable to set struct field"
)

Functions

func Bool

func Bool(val bool) string

func CleanYAMLError

func CleanYAMLError(err error) string

func Complex128

func Complex128(val complex128) string

func Complex64

func Complex64(val complex64) string

func DataTypeStr

func DataTypeStr(dataType interface{}) string

func DataTypeStrsOr

func DataTypeStrsOr(dataTypes []interface{}) string

func DataTypeUserStr

func DataTypeUserStr(dataType interface{}) string

func EnsurePrefix

func EnsurePrefix(str string, prefix string) string

func EnsureSuffix

func EnsureSuffix(str string, suffix string) string

func EnvVar

func EnvVar(envVarName string) string

func ErrAPINotFound added in v0.2.0

func ErrAPINotFound(apiName string) string

func ErrAPINotReady added in v0.2.0

func ErrAPINotReady(apiName string, status string) string

func ErrAPIVersionMismatch added in v0.2.0

func ErrAPIVersionMismatch(operatorVersion string, clientVersion string) string

func ErrAlphaNumericDashDotUnderscore

func ErrAlphaNumericDashDotUnderscore(provided string) string

func ErrAlphaNumericDashUnderscore

func ErrAlphaNumericDashUnderscore(provided string) string

func ErrAnyQueryParamMustBeProvided

func ErrAnyQueryParamMustBeProvided(paramNames ...string) string

func ErrAppNotDeployed

func ErrAppNotDeployed(appName string) string

func ErrBeMoreSpecific

func ErrBeMoreSpecific(vals ...string) string

func ErrCliAlreadyInAppDir

func ErrCliAlreadyInAppDir(dirPath string) string

func ErrCreateDir

func ErrCreateDir(path string) string

func ErrCreateFile

func ErrCreateFile(path string) string

func ErrCwdDirExists

func ErrCwdDirExists(dirName string) string

func ErrDNS1035

func ErrDNS1035(provided string) string

func ErrDirDoesNotExist

func ErrDirDoesNotExist(path string) string

func ErrDuplicateZipPath

func ErrDuplicateZipPath(path string) string

func ErrDuplicatedValue

func ErrDuplicatedValue(val interface{}) string

func ErrFailedToConnect

func ErrFailedToConnect(urlStr string) string

func ErrFileAlreadyExists

func ErrFileAlreadyExists(path string) string

func ErrFileDoesNotExist

func ErrFileDoesNotExist(path string) string

func ErrFormFileMustBeProvided

func ErrFormFileMustBeProvided(fileName string) string

func ErrInvalidFloat32

func ErrInvalidFloat32(provided float32, allowed ...float32) string

func ErrInvalidFloat64

func ErrInvalidFloat64(provided float64, allowed ...float64) string

func ErrInvalidInt

func ErrInvalidInt(provided int, allowed ...int) string

func ErrInvalidInt32

func ErrInvalidInt32(provided int32, allowed ...int32) string

func ErrInvalidInt64

func ErrInvalidInt64(provided int64, allowed ...int64) string

func ErrInvalidInterface added in v0.2.0

func ErrInvalidInterface(provided interface{}, allowed ...interface{}) string

func ErrInvalidPrimitiveType

func ErrInvalidPrimitiveType(provided interface{}, allowedTypes ...PrimitiveType) string

func ErrInvalidS3aPath

func ErrInvalidS3aPath(provided string) string

func ErrInvalidStr

func ErrInvalidStr(provided string, allowed ...string) string

func ErrInvalidURL added in v0.2.0

func ErrInvalidURL(provided string) string

func ErrMustBeGreaterThan

func ErrMustBeGreaterThan(provided interface{}, boundary interface{}) string

func ErrMustBeGreaterThanOrEqualTo

func ErrMustBeGreaterThanOrEqualTo(provided interface{}, boundary interface{}) string

func ErrMustBeLessThan

func ErrMustBeLessThan(provided interface{}, boundary interface{}) string

func ErrMustBeLessThanOrEqualTo

func ErrMustBeLessThanOrEqualTo(provided interface{}, boundary interface{}) string

func ErrMustHavePrefix

func ErrMustHavePrefix(provided string, prefix string) string

func ErrPathParamMustBeProvided

func ErrPathParamMustBeProvided(paramName string) string

func ErrQueryParamMustBeProvided

func ErrQueryParamMustBeProvided(paramName string) string

func ErrReadDir

func ErrReadDir(path string) string

func ErrReadFile

func ErrReadFile(path string) string

func ErrReadFormFile

func ErrReadFormFile(fileName string) string

func ErrUndefinedNameOrType

func ErrUndefinedNameOrType(resourceNameOrType string) string

func ErrUnsupportedKey

func ErrUnsupportedKey(key interface{}) string

func ErrUserDataUnavailable

func ErrUserDataUnavailable(s3Path string) string

func ErrWriteFile

func ErrWriteFile(path string) string

func Float32

func Float32(val float32) string

func Float64

func Float64(val float64) string

func HasPrefixAndSuffix

func HasPrefixAndSuffix(str string, substr string) bool

func Index

func Index(index int) string

func Int

func Int(val int) string

func Int16

func Int16(val int16) string

func Int32

func Int32(val int32) string

func Int64

func Int64(val int64) string

func Int8

func Int8(val int8) string

func LongestCommonPrefix

func LongestCommonPrefix(strs ...string) string

func MapMustBeDefined

func MapMustBeDefined(keys ...string) string

func MaskString

func MaskString(str string, numPlain int) string

MaskString omits no more than half of the string

func Obj

func Obj(val interface{}) string

func ObjFlat

func ObjFlat(val interface{}) string

func ParseBool

func ParseBool(valStr string) (bool, bool)

func ParseFloat32

func ParseFloat32(valStr string) (float32, bool)

func ParseFloat64

func ParseFloat64(valStr string) (float64, bool)

func ParseInt

func ParseInt(valStr string) (int, bool)

func ParseInt16

func ParseInt16(valStr string) (int16, bool)

func ParseInt32

func ParseInt32(valStr string) (int32, bool)

func ParseInt64

func ParseInt64(valStr string) (int64, bool)

func ParseInt8

func ParseInt8(valStr string) (int8, bool)

func StrsAnd

func StrsAnd(strs []string) string

func StrsOr

func StrsOr(strs []string) string

func StrsSentence

func StrsSentence(strs []string, lastJoinWord string) string

func ToTitle

func ToTitle(str string) string

func TrimPrefixAndSuffix

func TrimPrefixAndSuffix(str string, substr string) string

func TrimPrefixIfPresentInAll

func TrimPrefixIfPresentInAll(strs []string, prefix string) ([]string, bool)

func Uint

func Uint(val uint) string

func Uint16

func Uint16(val uint16) string

func Uint32

func Uint32(val uint32) string

func Uint64

func Uint64(val uint64) string

func Uint8

func Uint8(val uint8) string

func Uintptr

func Uintptr(val uintptr) string

func UserStr

func UserStr(val interface{}) string

func UserStrStripped

func UserStrStripped(val interface{}) string

func UserStrValue

func UserStrValue(val reflect.Value) string

func UserStrs

func UserStrs(val interface{}) []string

func UserStrsAnd

func UserStrsAnd(vals interface{}) string

func UserStrsOr

func UserStrsOr(vals interface{}) string

Types

type PrimitiveType

type PrimitiveType string
var (
	PrimTypeInt        PrimitiveType = "integer"
	PrimTypeIntList    PrimitiveType = "integer list"
	PrimTypeFloat      PrimitiveType = "float"
	PrimTypeFloatList  PrimitiveType = "float list"
	PrimTypeString     PrimitiveType = "string"
	PrimTypeStringList PrimitiveType = "string list"
	PrimTypeBool       PrimitiveType = "boolean"
	PrimTypeBoolList   PrimitiveType = "boolean list"

	PrimTypeMap     PrimitiveType = "map"
	PrimTypeMapList PrimitiveType = "list of maps"
	PrimTypeList    PrimitiveType = "list"

	PrimTypeStringToStringMap PrimitiveType = "map of strings to strings"
)

type PrimitiveTypes

type PrimitiveTypes []PrimitiveType

func (PrimitiveTypes) StringList

func (ts PrimitiveTypes) StringList() []string

Jump to

Keyboard shortcuts

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