models

package
v8.0.0-...-0afa3f7 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableNameTenant = "public.tenants" // TableNameTenant is the table name for the tenant model.
	TableNameBook   = "books"          // TableNameBook is the table name for the book model.
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	gorm.Model
	Name         string `gorm:"column:name;size:255;not null;"`
	TenantSchema string `gorm:"column:tenant_schema"`
	Tenant       Tenant `gorm:"foreignKey:TenantSchema;references:SchemaName"`
}

Book is the book model.

func (Book) IsSharedModel

func (Book) IsSharedModel() bool

func (Book) TableName

func (Book) TableName() string

type BookResponse

type BookResponse struct {
	ID   uint   `json:"id"`
	Name string `json:"name"`
}

BookResponse is the response body for a book.

type CreateTenantBody

type CreateTenantBody struct {
	DomainURL string `json:"domainUrl"`
}

CreateTenantBody is the request body for creating a tenant.

type Tenant

type Tenant struct {
	gorm.Model
	multitenancy.TenantModel
}

Tenant is the tenant model.

func (Tenant) IsSharedModel

func (Tenant) IsSharedModel() bool

func (Tenant) TableName

func (Tenant) TableName() string

type TenantResponse

type TenantResponse struct {
	ID        uint   `json:"id"`
	DomainURL string `json:"domainUrl"`
}

TenantResponse is the response body for a tenant.

type UpdateBookBody

type UpdateBookBody struct {
	Name string `json:"name"`
}

UpdateBookBody is the request body for updating a book.

Jump to

Keyboard shortcuts

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