tenancy_manager

package
v0.0.0-...-f19b43f Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContextPathOnly

func NewContextPathOnly(tenancyPath string, fromCtx ...op_context.Context) *multitenancy.TenancyContextBase

Types

type TenancyBase

type TenancyBase struct {
	TenancyBaseData
}

func NewTenancy

func NewTenancy(manager *TenancyManager) *TenancyBase

func (*TenancyBase) Cache

func (t *TenancyBase) Cache() cache.Cache

func (*TenancyBase) ConnectDatabase

func (t *TenancyBase) ConnectDatabase(ctx op_context.Context, newDb ...bool) error

func (*TenancyBase) CustomerDisplay

func (t *TenancyBase) CustomerDisplay() string

func (*TenancyBase) Init

func (*TenancyBase) IsActive

func (d *TenancyBase) IsActive() bool

func (*TenancyBase) Pool

func (t *TenancyBase) Pool() pool.Pool

func (*TenancyBase) SetCache

func (t *TenancyBase) SetCache(c cache.Cache)

type TenancyBaseData

type TenancyBaseData struct {
	multitenancy.TenancyDb

	db.WithDBBase
	Cache          cache.Cache
	Pool           pool.Pool
	Customer       *customer.Customer
	TenancyManager *TenancyManager
}

type TenancyController

type TenancyController struct {
	generic_error.ErrorsExtenderBase
	CRUD    crud.CRUD
	Manager *TenancyManager
}

func DefaultTenancyController

func DefaultTenancyController(manager *TenancyManager) *TenancyController

func NewTenancyController

func NewTenancyController(crud crud.CRUD, manager *TenancyManager) *TenancyController

func (*TenancyController) Activate

func (t *TenancyController) Activate(ctx op_context.Context, id string, idIsDisplay ...bool) error

func (*TenancyController) Add

func (*TenancyController) AddIpAddress

func (t *TenancyController) AddIpAddress(ctx op_context.Context, id string, ipAddress string, tag string, idIsDisplay ...bool) error

func (*TenancyController) ChangePoolOrDb

func (t *TenancyController) ChangePoolOrDb(ctx op_context.Context, id string, poolId string, dbName string, idIsDisplay ...bool) error

func (*TenancyController) Deactivate

func (t *TenancyController) Deactivate(ctx op_context.Context, id string, idIsDisplay ...bool) error

func (*TenancyController) Delete

func (t *TenancyController) Delete(ctx op_context.Context, id string, withDatabase bool, idIsDisplay ...bool) error

func (*TenancyController) DeleteIpAddress

func (t *TenancyController) DeleteIpAddress(ctx op_context.Context, id string, ipAddress string, tag string, idIsDisplay ...bool) error

func (*TenancyController) Exists

func (t *TenancyController) Exists(ctx op_context.Context, fields db.Fields) (bool, error)

func (*TenancyController) Find

func (t *TenancyController) Find(ctx op_context.Context, id string, idIsDisplay ...bool) (*multitenancy.TenancyItem, error)

func (*TenancyController) List

func (*TenancyController) ListIpAddresses

func (t *TenancyController) ListIpAddresses(ctx op_context.Context, filter *db.Filter) ([]*multitenancy.TenancyIpAddressItem, int64, error)

func (*TenancyController) OpLog

func (t *TenancyController) OpLog(ctx op_context.Context, operation string, oplog *multitenancy.OpLogTenancy)

func (*TenancyController) PublishOp

func (t *TenancyController) PublishOp(tenancy *multitenancy.TenancyItem, op string, poolIds ...string)

func (*TenancyController) SetCustomer

func (t *TenancyController) SetCustomer(ctx op_context.Context, id string, customer string, idIsDisplay ...bool) error

func (*TenancyController) SetDbRole

func (t *TenancyController) SetDbRole(ctx op_context.Context, id string, dbRole string, idIsDisplay ...bool) error

func (*TenancyController) SetPath

func (t *TenancyController) SetPath(ctx op_context.Context, id string, path string, idIsDisplay ...bool) error

func (*TenancyController) SetPathBlocked

func (t *TenancyController) SetPathBlocked(ctx op_context.Context, id string, blocked bool, mode multitenancy.TenancyBlockPathMode, idIsDisplay ...bool) error

func (*TenancyController) SetRole

func (t *TenancyController) SetRole(ctx op_context.Context, id string, role string, idIsDisplay ...bool) error

func (*TenancyController) SetShadowPath

func (t *TenancyController) SetShadowPath(ctx op_context.Context, id string, path string, idIsDisplay ...bool) error

type TenancyManager

type TenancyManager struct {
	TenancyManagerConfig

	Controller  multitenancy.TenancyController
	Pools       pool.PoolStore
	Customers   customer.CustomerController
	PubsubTopic *multitenancy.PubsubTopic
	PoolPubsub  pool_pubsub.PoolPubsub
	// contains filtered or unexported fields
}

func NewTenancyManager

func NewTenancyManager(pools pool.PoolStore, poolPubsub pool_pubsub.PoolPubsub, tenancyDbModels *multitenancy.TenancyDbModels) *TenancyManager

func (*TenancyManager) CheckDuplicatePath

func (t *TenancyManager) CheckDuplicatePath(ctx op_context.Context, c op_context.CallContext, poolId string, path string) error

func (*TenancyManager) CheckDuplicateRole

func (t *TenancyManager) CheckDuplicateRole(ctx op_context.Context, c op_context.CallContext, customerId string, role string) error

func (*TenancyManager) Close

func (t *TenancyManager) Close()

func (*TenancyManager) Config

func (t *TenancyManager) Config() interface{}

func (*TenancyManager) CreateTenancy

func (*TenancyManager) FindCustomer

func (*TenancyManager) FindPool

func (*TenancyManager) HasIpAddressByPath

func (t *TenancyManager) HasIpAddressByPath(path string, ipAddress string, tag string) bool

func (*TenancyManager) Init

func (t *TenancyManager) Init(ctx op_context.Context, configPath ...string) error

func (*TenancyManager) LoadTenancies

func (t *TenancyManager) LoadTenancies(ctx op_context.Context, selfPool pool.Pool) error

func (*TenancyManager) LoadTenancy

func (t *TenancyManager) LoadTenancy(ctx op_context.Context, id string) (multitenancy.Tenancy, error)

func (*TenancyManager) LoadTenancyFromData

func (t *TenancyManager) LoadTenancyFromData(ctx op_context.Context, tenancyDb *multitenancy.TenancyDb) (multitenancy.Tenancy, error)

func (*TenancyManager) SetController

func (t *TenancyManager) SetController(controller multitenancy.TenancyController)

func (*TenancyManager) SetCustomerController

func (t *TenancyManager) SetCustomerController(controller customer.CustomerController)

func (*TenancyManager) Tenancies

func (t *TenancyManager) Tenancies() []multitenancy.Tenancy

func (*TenancyManager) Tenancy

func (t *TenancyManager) Tenancy(id string) (multitenancy.Tenancy, error)

func (*TenancyManager) TenancyByPath

func (t *TenancyManager) TenancyByPath(path string) (multitenancy.Tenancy, error)

func (*TenancyManager) TenancyByShadowPath

func (t *TenancyManager) TenancyByShadowPath(path string) (multitenancy.Tenancy, error)

func (*TenancyManager) TenancyController

func (t *TenancyManager) TenancyController() multitenancy.TenancyController

func (*TenancyManager) UnloadTenancy

func (t *TenancyManager) UnloadTenancy(id string)

type TenancyManagerConfig

type TenancyManagerConfig struct {
	MULTITENANCY bool   `default:"true"`
	DB_PREFIX    string `validate:"required,alphanum" vmessage:"Invalid prefix for names of databases" default:"tenancy"`
}

func (*TenancyManagerConfig) IsMultiTenancy

func (t *TenancyManagerConfig) IsMultiTenancy() bool

type TenancyNotificationHandler

type TenancyNotificationHandler struct {
	pubsub_subscriber.SubscriberClientBase
	// contains filtered or unexported fields
}

func (*TenancyNotificationHandler) Handle

Jump to

Keyboard shortcuts

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