model

package
v3.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Association

type Association interface {
	Operation
	Parse(data frtypes.MapStr) (*metadata.Association, error)

	GetType() AssociationType
	SetTopo(parent, child Object) error
	GetTopo(obj Object) (Topo, error)
	ToMapStr() (frtypes.MapStr, error)
}

Association association operation interface declaration

type AssociationType

type AssociationType string

AssociationType the association type

const (
	// MainLineAssociation the main line association
	MainLineAssociation AssociationType = "mainline"

	// CommonAssociation the common association
	CommonAssociation AssociationType = "commonasso"
)

type Attribute

type Attribute interface {
	Operation
	Parse(data frtypes.MapStr) (*metadata.Attribute, error)

	Origin() metadata.Attribute

	IsMainlineField() bool
	IsAssociationType() bool

	SetSupplierAccount(supplierAccount string)
	GetSupplierAccount() string

	GetParentObject() (Object, error)
	GetChildObject() (Object, error)

	SetParentObject(objID string) error
	SetChildObject(objID string) error

	SetObjectID(objectID string)
	GetObjectID() string

	SetID(attributeID string)
	GetID() string

	SetName(attributeName string)
	GetName() string

	SetGroup(grp Group)
	GetGroup() (Group, error)

	SetGroupIndex(attGroupIndex int64)
	GetGroupIndex() int64

	SetUnint(unit string)
	GetUnint() string

	SetPlaceholder(placeHolder string)
	GetPlaceholder() string

	SetIsEditable(isEditable bool)
	GetIsEditable() bool

	SetIsPre(isPre bool)
	GetIsPre() bool

	SetIsReadOnly(isReadOnly bool)
	GetIsReadOnly() bool

	SetIsOnly(isOnly bool)
	GetIsOnly() bool

	SetIsRequired(isRequired bool)
	GetIsRequired() bool

	SetIsSystem(isSystem bool)
	GetIsSystem() bool

	SetIsAPI(isAPI bool)
	GetIsAPI() bool

	SetType(attributeType string)
	GetType() string

	SetOption(attributeOption interface{})
	GetOption() interface{}

	SetDescription(attributeDescription string)
	GetDescription() string

	SetCreator(attributeCreator string)
	GetCreator() string

	ToMapStr() (frtypes.MapStr, error)
}

Attribute attribute opeartion interface declaration

func CreateAttribute

func CreateAttribute(params types.ContextParams, clientSet apimachinery.ClientSetInterface, attrItems []metadata.Attribute) []Attribute

CreateAttribute create attribute objects

type Classification

type Classification interface {
	Operation
	Parse(data frtypes.MapStr) (*metadata.Classification, error)

	GetObjects() ([]Object, error)

	SetID(classificationID string)
	GetID() string

	SetName(classificationName string)
	GetName() string

	SetType(classificationType string)
	GetType() string

	SetSupplierAccount(supplierAccount string)
	GetSupplierAccount() string

	SetIcon(classificationIcon string)
	GetIcon() string

	ToMapStr() (frtypes.MapStr, error)
}

Classification classification operation interface declaration

func CreateClassification

func CreateClassification(params types.ContextParams, clientSet apimachinery.ClientSetInterface, clsItems []metadata.Classification) []Classification

CreateClassification create classification objects

type Factory

type Factory interface {
	CreaetObject(params types.ContextParams) Object
	CreaetClassification(params types.ContextParams) Classification
	CreateAttribute(params types.ContextParams) Attribute
	CreateGroup(params types.ContextParams) Group
	CreateCommonAssociation(params types.ContextParams, obj Object, asstKey string, asstObj Object) Association
	CreateMainLineAssociatin(params types.ContextParams, obj Object, asstKey string, asstObj Object) Association
}

Factory used to create object classification attribute etd.

func New

New create a new model factory instance

type FieldValid

type FieldValid struct {
}

FieldValid field valid method

func (*FieldValid) Valid

func (f *FieldValid) Valid(params types.ContextParams, data mapstr.MapStr, fieldID string) (string, error)

Valid valid the field

func (*FieldValid) ValidID

func (f *FieldValid) ValidID(params types.ContextParams, value string) error

ValidID check the property ID

func (*FieldValid) ValidName

func (f *FieldValid) ValidName(params types.ContextParams, value string) error

ValidName check the name

func (*FieldValid) ValidNameWithRegex

func (f *FieldValid) ValidNameWithRegex(params types.ContextParams, value string) error

ValidNameWithRegex valid by regex

type Group

type Group interface {
	Operation

	Parse(data frtypes.MapStr) (*metadata.Group, error)
	CreateAttribute() Attribute

	GetAttributes() ([]Attribute, error)

	Origin() metadata.Group

	SetID(groupID string)
	GetID() string

	SetName(groupName string)
	GetName() string

	SetIndex(groupIndex int64)
	GetIndex() int64

	SetObjectID(objID string)
	GetObjectID() string

	SetSupplierAccount(supplierAccount string)
	GetSupplierAccount() string

	SetDefault(isDefault bool)
	GetDefault() bool

	SetIsPre(isPre bool)
	GetIsPre() bool

	SetRecordID(int64)
	GetRecordID() int64

	ToMapStr() (frtypes.MapStr, error)
}

Group group opeartion interface declaration

func CreateGroup

func CreateGroup(params types.ContextParams, clientSet apimachinery.ClientSetInterface, groupItems []metadata.Group) []Group

CreateGroup create group objects

type Object

type Object interface {
	Operation

	Parse(data frtypes.MapStr) (*meta.Object, error)

	Origin() meta.Object
	IsMainlineObject() (bool, error)
	IsCommon() bool

	SetRecordID(id int64)
	GetRecordID() int64
	GetMainlineParentObject() (Object, error)
	GetMainlineChildObject() (Object, error)

	GetChildObjectByFieldID(fieldID string) ([]Object, error)
	GetParentObject() ([]Object, error)
	GetChildObject() ([]Object, error)

	SetMainlineParentObject(objID string) error
	SetMainlineChildObject(objID string) error

	CreateGroup() Group
	CreateAttribute() Attribute

	GetGroups() ([]Group, error)
	GetAttributes() ([]Attribute, error)
	GetAttributesExceptInnerFields() ([]Attribute, error)

	SetClassification(class Classification)
	GetClassification() (Classification, error)

	SetIcon(objectIcon string)
	GetIcon() string

	SetID(objectID string)
	GetID() string

	SetName(objectName string)
	GetName() string

	SetIsPre(isPre bool)
	GetIsPre() bool

	SetIsPaused(isPaused bool)
	GetIsPaused() bool

	SetPosition(position string)
	GetPosition() string

	SetSupplierAccount(supplierAccount string)
	GetSupplierAccount() string

	SetDescription(description string)
	GetDescription() string

	SetCreator(creator string)
	GetCreator() string

	SetModifier(modifier string)
	GetModifier() string

	ToMapStr() (frtypes.MapStr, error)

	GetInstIDFieldName() string
	GetInstNameFieldName() string
	GetDefaultInstPropertyName() string
	GetObjectType() string
}

Object model operation interface declaration

func CreateObject

func CreateObject(params types.ContextParams, clientSet apimachinery.ClientSetInterface, objItems []metadata.Object) []Object

CreateObject create objects

type Operation

type Operation interface {
	IsExists() (bool, error)
	Create() error
	Update(data frtypes.MapStr) error
	Save(data frtypes.MapStr) error
}

Operation the saver interface method

type Topo

type Topo interface {
	Current() Object
	Prev() Object
	Next() Object
}

Topo the object topo interface

Jump to

Keyboard shortcuts

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