th_loader

package
v0.14.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = &bootstrap.Module{
	Name:       "tenancy-loader",
	Precedence: bootstrap.TenantHierarchyLoaderPrecedence,
	Options: []fx.Option{
		fx.Provide(provideLoader),
		fx.Invoke(initializeTenantHierarchy),
	},
}

Functions

func LoadTenantHierarchy

func LoadTenantHierarchy(ctx context.Context) (err error)

func Use

func Use()

Types

type Loader

type Loader interface {
	LoadTenantHierarchy(ctx context.Context) (err error)
}

type TenancyLoader

type TenancyLoader struct {
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader(rc redis.Client, store TenantHierarchyStore, accessor tenancy.Accessor) *TenancyLoader

func (*TenancyLoader) LoadTenantHierarchy

func (l *TenancyLoader) LoadTenantHierarchy(ctx context.Context) (err error)

type Tenant

type Tenant interface {
	GetId() string
	GetParentId() string //use pointer for nil
}

type TenantHierarchyStore

type TenantHierarchyStore interface {
	GetIterator(ctx context.Context) (TenantIterator, error)
}

type TenantIterator

type TenantIterator interface {
	Next() bool
	Scan(ctx context.Context) (Tenant, error)
	Close() error
	Err() error
}

Jump to

Keyboard shortcuts

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