gendomain

package
v0.0.0-...-86e84b6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TenantAggregate *tenantAggregate

TenantAggregate contain the definition of the tenant object.

*It is also used to generate the factory containing the main functions with the environnement.
View Source
var TenantEntity *tenantEntity
View Source
var TenantSettingEntity *tenantSettingEntity
View Source
var TenantSettingShouldBe func(
	t *testing.T, ctx context.Context, client TestClientInterface, tenantID string, checkEvents bool,
	tenantSettingFrom *pb.TenantSetting,
	want *pb.TenantSetting,
) func(t *testing.T)
View Source
var TenantShouldBe func(
	t *testing.T, ctx context.Context, client TestClientInterface, tenantID string, checkEvents bool,
	tenantFrom *pb.Tenant,
	want *pb.Tenant,
) func(t *testing.T)
	result := &tenantSettingCollection{
		Collection: records,
	}
	result.Collection.NewFactory = result.newFactory
	// TenantSettingAggregate.PostNewCollection(result)
	return result
}
type tenantSettingCollection struct {
	*libdomain.Collection
	// tenantSettingCollectionInterface
}
func (c *tenantSettingCollection) Slice() []*TenantSetting {
	var tenantSettings []*TenantSetting
	for _, record := range c.Collection.Slice() {
		tenantSettings = append(tenantSettings, record.(*TenantSetting))
	}
	return tenantSettings
}
func (d *tenantSettingCollection) newFactory() *libdomain.Factory {
	factory := newTenantSettingFactory(d.Collection.Workflow)
	return factory.Factory
}
func NewTenantSetting(wk libdomain.WorkflowInterface) libdomain.DomainObjectInterface {
	return &TenantSetting{
		TenantSetting: &pb.TenantSetting{
			Properties: &pb.TenantSettingProperties{},
		},
		Workflow: wk,
	}
}

Functions

Types

type DummyStruct

type DummyStruct struct{}

type PbTenant

type PbTenant = pb.Tenant

type PbTenantSetting

type PbTenantSetting = pb.TenantSetting

type Tenant

type Tenant struct {
	Workflow libdomain.WorkflowInterface
	// contains filtered or unexported fields
}

Tenant is the main struct for operating a tenant object, which shall

*be used in custom code because it contains the environnement informations and
*the easy-to-use functions.

func (*Tenant) Delete

func (t *Tenant) Delete() error

Delete will delete the tenant from the database.

func (*Tenant) ExternalID

func (t *Tenant) ExternalID() string

func (*Tenant) ExternalModule

func (t *Tenant) ExternalModule() string

func (*Tenant) GetID

func (t *Tenant) GetID() string

func (*Tenant) ID

func (t *Tenant) ID() string

SetID is a function to set the ID of the tenant.

func (*Tenant) IncludeSettings

func (t *Tenant) IncludeSettings() error

func (*Tenant) Init

func (t *Tenant) Init(wk libdomain.WorkflowInterface, pb *pb.Tenant)

func (*Tenant) JSON

func (t *Tenant) JSON() ([]byte, error)

JSON is a function to return the tenant data in JSON format.

func (*Tenant) Map

func (t *Tenant) Map() map[string]interface{}

Map is a function to return the tenant data in JSON format.

func (*Tenant) Name

func (t *Tenant) Name() string

func (*Tenant) Parent

func (t *Tenant) Parent() *Tenant

func (*Tenant) ParentID

func (t *Tenant) ParentID() string

func (*Tenant) Pb

func (t *Tenant) Pb() *pb.Tenant

SetID is a function to set the ID of the tenant.

func (*Tenant) Settings

func (t *Tenant) Settings() []*TenantSetting

func (*Tenant) Update

func (t *Tenant) Update(r *pb.UpdateTenantData) error

Delete will delete the tenant from the database.

type TenantCollection

type TenantCollection struct {
	//*libdomain.Collection
	// TenantCollectionInterface
	Workflow libdomain.WorkflowInterface
	// contains filtered or unexported fields
}

TenantCollection is the main struct for operating a list tenant object, which shall

*be used in custom code because it contains the environnement informations and
*the easy-to-use functions.

func (*TenantCollection) Aggregate

func (*TenantCollection) Delete

func (d *TenantCollection) Delete() error

Delete will delete all the tenants in the collection.

func (*TenantCollection) GetByID

func (c *TenantCollection) GetByID(id string) *Tenant

GetByID return the tenant in this collection, by id.

func (*TenantCollection) GetKeys

func (c *TenantCollection) GetKeys() []string

GetByID return the tenant in this collection, by id.

func (*TenantCollection) IncludeSettings

func (t *TenantCollection) IncludeSettings() error

func (*TenantCollection) Map

func (d *TenantCollection) Map() []map[string]interface{}

func (*TenantCollection) ParentsByTenantID

func (t *TenantCollection) ParentsByTenantID() (map[string]*Tenant, error)

ParentsByTenantID return the tenant behind ParentID field, for each tenant in the collection, by id.

func (*TenantCollection) Rehydrate

func (c *TenantCollection) Rehydrate(pbTenants []*pb.Tenant)

func (*TenantCollection) Settings

func (t *TenantCollection) Settings() (map[string]*TenantSettingCollection, error)

SettingssByTenantID return the tenantSetting behind Settings field, for each tenant in the collection, by id.

func (*TenantCollection) Slice

func (c *TenantCollection) Slice() []*Tenant

GetSlice return all tenants in this collection, as a slice.

func (*TenantCollection) SlicePb

func (c *TenantCollection) SlicePb() []*pb.Tenant

GetSlice return all tenants in this collection, as a slice.

func (*TenantCollection) Update

func (d *TenantCollection) Update(r *pb.UpdateTenantData) error

Update will update all the tenants in the collection with the specified data.

type TenantFactory

type TenantFactory struct {
	*libdomain.Factory
	TenantFactoryInterface
}

TenantFactory is the main struct for operating tenant objects, which shall

*be used in custom code because it contains the environnement informations and
*the easy-to-use functions.

func (*TenantFactory) Create

func (d *TenantFactory) Create(
	tenants []*pb.CreateTenantCommand, parentAggregate *libdomain.AggregateDefinition,
) (*TenantCollection, error)

Create create a new tenant from the factory, and return it.

func (*TenantFactory) New

func (d *TenantFactory) New() *Tenant

New return a new instance of a tenant object.

func (*TenantFactory) NewCollection

func (d *TenantFactory) NewCollection(tenants []*Tenant) *TenantCollection

NewCollection return a new instance of a tenant collection object.

type TenantFactoryInterface

type TenantFactoryInterface interface {
}

type TenantInternalLibrary

type TenantInternalLibrary struct {
	NewTenantSettingFactory func(libdomain.WorkflowInterface) *tenantSettingFactory
}

type TenantSetting

type TenantSetting struct {
	Workflow libdomain.WorkflowInterface
	// contains filtered or unexported fields
}

TenantSetting is the main struct for operating a tenantSetting object, which shall

*be used in custom code because it contains the environnement informations and
*the easy-to-use functions.

func (*TenantSetting) Aggregate

func (t *TenantSetting) Aggregate() *Tenant

func (*TenantSetting) AggregateID

func (t *TenantSetting) AggregateID() string

func (*TenantSetting) ExternalID

func (t *TenantSetting) ExternalID() string

func (*TenantSetting) ExternalModule

func (t *TenantSetting) ExternalModule() string

func (*TenantSetting) GetID

func (t *TenantSetting) GetID() string

func (*TenantSetting) ID

func (t *TenantSetting) ID() string

SetID is a function to set the ID of the tenantSetting.

func (*TenantSetting) Init

func (*TenantSetting) JSON

func (t *TenantSetting) JSON() ([]byte, error)

JSON is a function to return the tenantSetting data in JSON format.

func (*TenantSetting) Key

func (t *TenantSetting) Key() string

func (*TenantSetting) Map

func (t *TenantSetting) Map() map[string]interface{}

Map is a function to return the tenantSetting data in JSON format.

func (*TenantSetting) Pb

func (t *TenantSetting) Pb() *pb.TenantSetting

SetID is a function to set the ID of the tenantSetting.

func (*TenantSetting) Value

func (t *TenantSetting) Value() string

type TenantSettingCollection

type TenantSettingCollection struct {
	//*libdomain.Collection
	// TenantSettingCollectionInterface
	Workflow libdomain.WorkflowInterface
	// contains filtered or unexported fields
}

TenantSettingCollection is the main struct for operating a list tenantSetting object, which shall

*be used in custom code because it contains the environnement informations and
*the easy-to-use functions.

func (*TenantSettingCollection) Aggregate

func (*TenantSettingCollection) AggregatesByTenantID

func (t *TenantSettingCollection) AggregatesByTenantID() (map[string]*Tenant, error)

AggregatesByTenantID return the tenant behind AggregateID field, for each tenant in the collection, by id.

func (*TenantSettingCollection) GetByID

GetByID return the tenantSetting in this collection, by id.

func (*TenantSettingCollection) GetKeys

func (c *TenantSettingCollection) GetKeys() []string

GetByID return the tenantSetting in this collection, by id.

func (*TenantSettingCollection) Map

func (d *TenantSettingCollection) Map() []map[string]interface{}

func (*TenantSettingCollection) Rehydrate

func (c *TenantSettingCollection) Rehydrate(pbTenantSettings []*pb.TenantSetting)

func (*TenantSettingCollection) Slice

func (c *TenantSettingCollection) Slice() []*TenantSetting

GetSlice return all tenantSettings in this collection, as a slice.

func (*TenantSettingCollection) SlicePb

func (c *TenantSettingCollection) SlicePb() []*pb.TenantSetting

GetSlice return all tenantSettings in this collection, as a slice.

type TestClientInterface

type TestClientInterface interface {
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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