utils

package
v4.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0, Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDrpParam

func AddDrpParam(c *api.Client, objtype, objkey, param string, new interface{}) *models.Error

func AddOrSetDrpParam

func AddOrSetDrpParam(c *api.Client, objtype, objkey, param string, new interface{}) *models.Error

func AddToJobLog

func AddToJobLog(c *api.Client, jid, data string) *models.Error

func ConvertError

func ConvertError(code int, err error) *models.Error

func DeleteDrpMachine

func DeleteDrpMachine(c *api.Client, uuid string) *models.Error

func GetDrpBooleanParam

func GetDrpBooleanParam(c *api.Client, objtype, objkey, param string) (bool, *models.Error)

func GetDrpIntParam

func GetDrpIntParam(c *api.Client, objtype, objkey, param string) (int, *models.Error)

func GetDrpMachineByParam

func GetDrpMachineByParam(c *api.Client, param, value string) (*models.Machine, *models.Error)

func GetDrpObjByParam

func GetDrpObjByParam(c *api.Client, objtype, param, value string) (models.Model, *models.Error)

func GetDrpParam

func GetDrpParam(c *api.Client, objtype, objkey, param string) (interface{}, *models.Error)

* Helper function to lookup an object's parameter in aggregate so that * the parameter default could be retrieved if unset.

func GetDrpStringParam

func GetDrpStringParam(c *api.Client, objtype, objkey, param string) (string, *models.Error)

func GetParamOrBoolean

func GetParamOrBoolean(m map[string]interface{}, p string, b bool) bool

func GetParamOrInt

func GetParamOrInt(m map[string]interface{}, p string, i int) int

func GetParamOrInt64

func GetParamOrInt64(m map[string]interface{}, p string, i int64) int64

func GetParamOrString

func GetParamOrString(m map[string]interface{}, p, s string) string

func MakeError

func MakeError(code int, msg string) *models.Error

func RemoveDrpParam

func RemoveDrpParam(c *api.Client, objtype, objkey, param string, old interface{}) *models.Error

func SetDrpParam

func SetDrpParam(c *api.Client, objtype, objkey, param string, old, new interface{}) *models.Error

func SetErrorName

func SetErrorName(name string)

func ValidateBooleanValue

func ValidateBooleanValue(param string, val interface{}) (bool, *models.Error)

func ValidateIntValue

func ValidateIntValue(param string, val interface{}) (int, *models.Error)

func ValidateStringValue

func ValidateStringValue(param string, val interface{}) (string, *models.Error)

Types

type PerIdQueue added in v4.5.4

type PerIdQueue struct {
	Capacity int
	// contains filtered or unexported fields
}

func NewQueues added in v4.5.4

func NewQueues(ctx context.Context, limit int) *PerIdQueue

func (*PerIdQueue) Add added in v4.5.4

func (pmq *PerIdQueue) Add(id string, l logger.Logger, req func()) error

Jump to

Keyboard shortcuts

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