util

package
v0.12.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcMemCapacity added in v0.9.0

func CalcMemCapacity(reqModelKey string, defaultSize int, multiplier float64, log logr.Logger) uint64

func ClearDirectoryContents added in v0.10.0

func ClearDirectoryContents(dirPath string, condition func(entry os.DirEntry) bool) error

ClearDirectoryContents Clear contents of directory if it exists. If condition is specified then only delete dir entries to which it returns true

func FileExists

func FileExists(path string) (bool, error)

Check if a file exists at path

func GetModelType added in v0.8.0

func GetModelType(req *mmesh.LoadModelRequest, log logr.Logger) string

GetModelType first tries to read the type from the LoadModelRequest.ModelKey json If there is an error parsing LoadModelRequest.ModelKey or the type is not found there, this will return the LoadModelRequest.ModelType which could possibly be an empty string

func GetSchemaPath added in v0.8.0

func GetSchemaPath(req *mmesh.LoadModelRequest) (string, error)

GetSchemaPath extracts the schema path from the ModelKey field Will return an error if schema path exists but is in an invalid format

func RemoveFileFromListOfFileInfo

func RemoveFileFromListOfFileInfo(filename string, files []os.DirEntry) (bool, []os.DirEntry)

RemoveFileFromListOfFileInfo The input `files` content is modified, the order of elements is changed

func ResolveLocalGrpcEndpoint added in v0.10.0

func ResolveLocalGrpcEndpoint(servingRuntimeEndpoint string) (string, error)

func SecureJoin

func SecureJoin(elem ...string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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