resource_factory

package
v1.3.0-rc.0...-12c9840 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(resourceType dbclient.ResourceType, factory ResourceFactory) error

Types

type BaseResourceFactory

type BaseResourceFactory struct {
	RecordType dbclient.RecordType
	DBClient   *dbclient.DBClient
	Creator    ResourceCreator
}

func (BaseResourceFactory) CreateResource

CreateResource Create resource

func (BaseResourceFactory) GetCreator

func (obj BaseResourceFactory) GetCreator() ResourceCreator

func (BaseResourceFactory) GetDbClient

func (obj BaseResourceFactory) GetDbClient() *dbclient.DBClient

func (BaseResourceFactory) GetRecordType

func (obj BaseResourceFactory) GetRecordType() dbclient.RecordType

func (*BaseResourceFactory) SetDbClient

func (obj *BaseResourceFactory) SetDbClient(dbclient *dbclient.DBClient)

func (*BaseResourceFactory) SetRecordType

func (obj *BaseResourceFactory) SetRecordType(t dbclient.RecordType)

type BaseResourceMaterial

type BaseResourceMaterial interface {
	GetVendor() string
	SetVendor(string)
	GetRegion() string
	SetRegion(string)
	GetVpcID() string
	SetVpcID(string)
	GetVSwitchID() string
	SetVSwitchID(string)
	GetZoneID() string
	SetZoneID(string)

	GetOrgID() string
	GetUserID() string
	GetClusterName() string
	GetProjectID() string
	GetSource() string
	GetClientToken() string

	GetInstanceName() string
	GetAddonID() string
}

type ResourceFactory

type ResourceFactory interface {
	GetDbClient() *dbclient.DBClient
	SetDbClient(*dbclient.DBClient)
	GetRecordType() dbclient.RecordType
	GetCreator() ResourceCreator
	CreateResource(aliyun_resources.Context, BaseResourceMaterial) (*dbclient.Record, error)
}

func GetResourceFactory

func GetResourceFactory(dbClient *dbclient.DBClient, resourceType dbclient.ResourceType) (ResourceFactory, error)

Jump to

Keyboard shortcuts

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