Documentation ¶
Index ¶
- func NewContextPathOnly(tenancyPath string, fromCtx ...op_context.Context) *multitenancy.TenancyContextBase
- type TenancyBase
- func (t *TenancyBase) Cache() cache.Cache
- func (t *TenancyBase) ConnectDatabase(ctx op_context.Context, newDb ...bool) error
- func (t *TenancyBase) CustomerDisplay() string
- func (t *TenancyBase) Init(ctx op_context.Context, data *multitenancy.TenancyDb) error
- func (d *TenancyBase) IsActive() bool
- func (t *TenancyBase) Pool() pool.Pool
- func (t *TenancyBase) SetCache(c cache.Cache)
- type TenancyBaseData
- type TenancyController
- func (t *TenancyController) Activate(ctx op_context.Context, id string, idIsDisplay ...bool) error
- func (t *TenancyController) Add(ctx op_context.Context, data *multitenancy.TenancyData) (*multitenancy.TenancyItem, error)
- func (t *TenancyController) AddIpAddress(ctx op_context.Context, id string, ipAddress string, tag string, ...) error
- func (t *TenancyController) ChangePoolOrDb(ctx op_context.Context, id string, poolId string, dbName string, ...) error
- func (t *TenancyController) Deactivate(ctx op_context.Context, id string, idIsDisplay ...bool) error
- func (t *TenancyController) Delete(ctx op_context.Context, id string, withDatabase bool, idIsDisplay ...bool) error
- func (t *TenancyController) DeleteIpAddress(ctx op_context.Context, id string, ipAddress string, tag string, ...) error
- func (t *TenancyController) Exists(ctx op_context.Context, fields db.Fields) (bool, error)
- func (t *TenancyController) Find(ctx op_context.Context, id string, idIsDisplay ...bool) (*multitenancy.TenancyItem, error)
- func (t *TenancyController) List(ctx op_context.Context, filter *db.Filter) ([]*multitenancy.TenancyItem, int64, error)
- func (t *TenancyController) ListIpAddresses(ctx op_context.Context, filter *db.Filter) ([]*multitenancy.TenancyIpAddressItem, int64, error)
- func (t *TenancyController) OpLog(ctx op_context.Context, operation string, oplog *multitenancy.OpLogTenancy)
- func (t *TenancyController) PublishOp(tenancy *multitenancy.TenancyItem, op string, poolIds ...string)
- func (t *TenancyController) SetCustomer(ctx op_context.Context, id string, customer string, idIsDisplay ...bool) error
- func (t *TenancyController) SetDbRole(ctx op_context.Context, id string, dbRole string, idIsDisplay ...bool) error
- func (t *TenancyController) SetPath(ctx op_context.Context, id string, path string, idIsDisplay ...bool) error
- func (t *TenancyController) SetPathBlocked(ctx op_context.Context, id string, blocked bool, ...) error
- func (t *TenancyController) SetRole(ctx op_context.Context, id string, role string, idIsDisplay ...bool) error
- func (t *TenancyController) SetShadowPath(ctx op_context.Context, id string, path string, idIsDisplay ...bool) error
- type TenancyManager
- func (t *TenancyManager) CheckDuplicatePath(ctx op_context.Context, c op_context.CallContext, poolId string, path string) error
- func (t *TenancyManager) CheckDuplicateRole(ctx op_context.Context, c op_context.CallContext, customerId string, ...) error
- func (t *TenancyManager) Close()
- func (t *TenancyManager) Config() interface{}
- func (t *TenancyManager) CreateTenancy(ctx op_context.Context, data *multitenancy.TenancyData) (*multitenancy.TenancyItem, error)
- func (t *TenancyManager) FindCustomer(ctx op_context.Context, c op_context.CallContext, id string) (*customer.Customer, error)
- func (t *TenancyManager) FindPool(ctx op_context.Context, c op_context.CallContext, id string) (pool.Pool, error)
- func (t *TenancyManager) HasIpAddressByPath(path string, ipAddress string, tag string) bool
- func (t *TenancyManager) Init(ctx op_context.Context, configPath ...string) error
- func (t *TenancyManager) LoadTenancies(ctx op_context.Context, selfPool pool.Pool) error
- func (t *TenancyManager) LoadTenancy(ctx op_context.Context, id string) (multitenancy.Tenancy, error)
- func (t *TenancyManager) LoadTenancyFromData(ctx op_context.Context, tenancyDb *multitenancy.TenancyDb) (multitenancy.Tenancy, error)
- func (t *TenancyManager) SetController(controller multitenancy.TenancyController)
- func (t *TenancyManager) SetCustomerController(controller customer.CustomerController)
- func (t *TenancyManager) Tenancies() []multitenancy.Tenancy
- func (t *TenancyManager) Tenancy(id string) (multitenancy.Tenancy, error)
- func (t *TenancyManager) TenancyByPath(path string) (multitenancy.Tenancy, error)
- func (t *TenancyManager) TenancyByShadowPath(path string) (multitenancy.Tenancy, error)
- func (t *TenancyManager) TenancyController() multitenancy.TenancyController
- func (t *TenancyManager) UnloadTenancy(id string)
- type TenancyManagerConfig
- type TenancyNotificationHandler
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 (t *TenancyBase) Init(ctx op_context.Context, data *multitenancy.TenancyDb) error
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 (t *TenancyController) Add(ctx op_context.Context, data *multitenancy.TenancyData) (*multitenancy.TenancyItem, error)
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 (t *TenancyController) List(ctx op_context.Context, filter *db.Filter) ([]*multitenancy.TenancyItem, int64, error)
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 (t *TenancyManager) CreateTenancy(ctx op_context.Context, data *multitenancy.TenancyData) (*multitenancy.TenancyItem, error)
func (*TenancyManager) FindCustomer ¶
func (t *TenancyManager) FindCustomer(ctx op_context.Context, c op_context.CallContext, id string) (*customer.Customer, error)
func (*TenancyManager) FindPool ¶
func (t *TenancyManager) FindPool(ctx op_context.Context, c op_context.CallContext, id string) (pool.Pool, error)
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 ¶
func (t *TenancyNotificationHandler) Handle(ctx op_context.Context, msg *multitenancy.PubsubNotification) error
Click to show internal directories.
Click to hide internal directories.