tenant

package
v0.0.0-...-7fb4ca9 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tenant

type Tenant struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type TenantGetAllDTO

type TenantGetAllDTO struct {
	Count int      `json:"count"`
	Data  []Tenant `json:"data"`
}

type TenantHandlers

type TenantHandlers struct {
	RabbitMqRouter   *rabbitmq.RabbitMqRouter
	TenantRepository TenantRepository
}

func NewHandlers

func NewHandlers(rmq *rabbitmq.RabbitMqRouter, tenantRepository TenantRepository) *TenantHandlers

func (*TenantHandlers) GetAllTenantsHandler

func (h *TenantHandlers) GetAllTenantsHandler(w http.ResponseWriter, r *http.Request)

func (*TenantHandlers) NewTenantHandler

func (h *TenantHandlers) NewTenantHandler(w http.ResponseWriter, r *http.Request)

type TenantRepository

type TenantRepository interface {
	InsertTenant(tenant Tenant) error
	InsertUserAccess(userAccess TenantUserAccess) error
	SelectTenantByUser(userId string) ([]Tenant, error)
	SelectTenantAccessByUser(userId string) ([]TenantUserAccess, error)
}

type TenantRepositoryImpl

type TenantRepositoryImpl struct {
	DB *sql.DB
}

func NewTenantRepository

func NewTenantRepository(db *sql.DB) *TenantRepositoryImpl

func (*TenantRepositoryImpl) InsertTenant

func (r *TenantRepositoryImpl) InsertTenant(tenant Tenant) error

InsertTenant inserts a new tenant into the database.

func (*TenantRepositoryImpl) InsertUserAccess

func (r *TenantRepositoryImpl) InsertUserAccess(userAccess TenantUserAccess) error

func (*TenantRepositoryImpl) SelectTenantAccessByUser

func (r *TenantRepositoryImpl) SelectTenantAccessByUser(userId string) ([]TenantUserAccess, error)

func (*TenantRepositoryImpl) SelectTenantByUser

func (r *TenantRepositoryImpl) SelectTenantByUser(userId string) ([]Tenant, error)

type TenantUserAccess

type TenantUserAccess struct {
	TenantId      string           `json:"tenant_id"`
	UserAccountId string           `json:"user_account_id"`
	AccessLevel   auth.AccessLevel `json:"access_level"`
}

Jump to

Keyboard shortcuts

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