instances

package
v0.0.0-...-cb472e6 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchBizIDFromInstance

func FetchBizIDFromInstance(objID string, instanceData mapstr.MapStr) (int64, error)

func FillLostedFieldValue

func FillLostedFieldValue(ctx context.Context, valData mapstr.MapStr, propertys []metadata.Attribute)

FillLostedFieldValue fill the value in inst map data

func New

New create a new instance manager instance

func NewValidator

func NewValidator(kit *rest.Kit, dependent OperationDependences, objID string, bizID int64, language language.CCLanguageIf) (*validator, error)

Init init

Types

type EnumOption

type EnumOption []EnumVal

EnumOption enum option

func ParseEnumOption

func ParseEnumOption(ctx context.Context, val interface{}) (EnumOption, error)

ParseEnumOption convert val to []EnumVal

func (EnumOption) GetDefault

func (opt EnumOption) GetDefault() *EnumVal

GetDefault returns EnumOption's default value

type EnumVal

type EnumVal struct {
	ID        string `bson:"id"           json:"id"`
	Name      string `bson:"name"         json:"name"`
	Type      string `bson:"type"         json:"type"`
	IsDefault bool   `bson:"is_default"   json:"is_default"`
}

EnumVal enum option val

type FloatOption

type FloatOption struct {
	Min string `bson:"min" json:"min"`
	Max string `bson:"max" json:"max"`
}

FloatOption float option

type IntOption

type IntOption struct {
	Min string `bson:"min" json:"min"`
	Max string `bson:"max" json:"max"`
}

IntOption integer option

type OperationDependences

type OperationDependences interface {
	// IsInstanceExist used to check if the  instances  asst exist
	IsInstAsstExist(kit *rest.Kit, objID string, instID uint64) (exists bool, err error)

	// DeleteInstAsst used to delete inst asst
	DeleteInstAsst(kit *rest.Kit, objID string, instID uint64) error

	// SelectObjectAttWithParams select object att with params
	SelectObjectAttWithParams(kit *rest.Kit, objID string, bizID int64) (attribute []metadata.Attribute, err error)

	// SearchUnique search unique attribute
	SearchUnique(kit *rest.Kit, objID string) (uniqueAttr []metadata.ObjectUnique, err error)
}

OperationDependences methods definition

Jump to

Keyboard shortcuts

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