entity

package
v1.3.231 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MailTrackerStatusNew     = "new"
	MailTrackerStatusQueued  = "queued"
	MailTrackerStatusSuccess = "success"
	MailTrackerStatusError   = "error"
)
View Source
const (
	OTPTrackerTypeSMS   = "sms"
	OTPTrackerTypeEmail = "email"
)
View Source
const (
	OTPTrackerGatewaySendStatusNew          = "new"
	OTPTrackerGatewaySendStatusGatewayError = "gateway_error"
	OTPTrackerGatewaySendStatusSent         = "sent"
)
View Source
const (
	OTPTrackerGatewayVerifyStatusNew          = "new"
	OTPTrackerGatewayVerifyStatusGatewayError = "gateway_error"
	OTPTrackerGatewayVerifyStatusInvalidCode  = "invalid_code"
	OTPTrackerGatewayVerifyStatusSuccess      = "success"
	OTPTrackerGatewayVerifyStatusExpired      = "expired"
)
View Source
const (
	SettingsValueTypeText     = "text"
	SettingsValueTypeNumber   = "number"
	SettingsValueTypeEmail    = "email"
	SettingsValueTypeTel      = "tel"
	SettingsValueTypeURI      = "uri"
	SettingsValueTypePassword = "password"
	SettingsValueTypeDateTime = "datetime"
	SettingsValueTypeJSON     = "json"
)
View Source
const (
	SMSTrackerTypeSMS     = "sms"
	SMSTrackerTypeCallout = "callout"
)

Variables

View Source
var FileStatusAll = fileStatus{
	FileStatusNew:       FileStatusNew.String(),
	FileStatusProcessed: FileStatusProcessed.String(),
}
View Source
var TranslationStatusAll = translationStatus{
	New:        TranslationStatusNew.String(),
	Translated: TranslationStatusTranslated.String(),
}

Functions

This section is empty.

Types

type FeatureFlagEntity added in v0.9.48

type FeatureFlagEntity struct {
	trixorm.ORM `orm:"table=feature_flags;localCache"`
	ID          uint64
	Name        string     `orm:"length=100;required;unique=Name"`
	Registered  bool       `orm:"index=Registered_Enabled:1"`
	Enabled     bool       `orm:"index=Registered_Enabled:2"`
	UpdatedAt   *time.Time `orm:"time=true"`
	CreatedAt   time.Time  `orm:"time=true"`

	CachedQueryAll               *trixorm.CachedQuery `query:"1 ORDER BY ID"`
	CachedQueryName              *trixorm.CachedQuery `queryOne:":Name = ?"`
	CachedQueryRegisteredEnabled *trixorm.CachedQuery `query:":Registered = ? AND :Enabled = ?"`
}

type FileEntity added in v1.2.35

type FileEntity struct {
	trixorm.ORM `orm:"table=files;redisSearch=search_pool"`
	ID          uint64 `orm:"searchable;sortable"`
	File        *FileObject
	Status      string    `orm:"required;enum=entity.FileStatusAll"`
	Namespace   string    `orm:"required;searchable"`
	CreatedAt   time.Time `orm:"time=true"`
}

type FileObject added in v1.2.35

type FileObject struct {
	ID         uint64
	StorageKey string
	Data       interface{}
}

type FileStatus added in v1.2.35

type FileStatus string
const (
	FileStatusNew       FileStatus = "new"
	FileStatusProcessed FileStatus = "processed"
)

func (FileStatus) String added in v1.2.35

func (f FileStatus) String() string

type GeocodingCacheEntity added in v1.3.28

type GeocodingCacheEntity struct {
	trixorm.ORM              `orm:"table=geocoding_cache;localCache;redisCache"`
	ID                       uint64
	Lat                      float64 `orm:"decimal=8,5"`
	Lng                      float64 `orm:"decimal=8,5"`
	AdministrativeAreaLevel1 string  `orm:"required"`
	CityName                 string  `orm:"required"`
	Address                  string  `orm:"required"`
	AddressHash              string  `orm:"length=32;required;unique=AddressHash_Language:1"`
	Language                 string  `orm:"required;enum=entity.LanguageValueAll;unique=AddressHash_Language:2"`
	Provider                 string
	RawResponse              interface{}
	ExpiresAt                time.Time `orm:"time=true;index=ExpiresAt"`
	CreatedAt                time.Time `orm:"time=true"`

	CachedQueryAddressHashLanguage *trixorm.CachedQuery `queryOne:":AddressHash = ? AND :Language = ?"`
}

type GeocodingReverseCacheEntity added in v1.3.31

type GeocodingReverseCacheEntity struct {
	trixorm.ORM              `orm:"table=geocoding_reverse_cache;localCache;redisCache"`
	ID                       uint64
	Lat                      float64 `orm:"decimal=8,5;required;unique=Lat_Lng_Language:1"`
	Lng                      float64 `orm:"decimal=8,5;required;unique=Lat_Lng_Language:2"`
	AdministrativeAreaLevel1 string  `orm:"required"`
	CityName                 string  `orm:"required"`
	Address                  string
	Language                 string `orm:"required;enum=entity.LanguageValueAll;unique=Lat_Lng_Language:3"`
	Provider                 string
	RawResponse              interface{}
	ExpiresAt                time.Time `orm:"time=true;index=ExpiresAt"`
	CreatedAt                time.Time `orm:"time=true"`

	CachedQueryLatLngLanguage *trixorm.CachedQuery `queryOne:":Lat = ? AND :Lng = ? AND :Language = ?"`
}

type MailTrackerEntity added in v0.5.0

type MailTrackerEntity struct {
	trixorm.ORM  `orm:"table=email_tracker"`
	ID           uint64
	Status       string `orm:"enum=entity.MailTrackerStatusAll"`
	From         string `orm:"varchar=255"`
	To           string `orm:"varchar=255"`
	Subject      string
	TemplateFile string
	TemplateData string `orm:"length=max"`
	SenderError  string
	ReadAt       *time.Time `orm:"time"`
	CreatedAt    time.Time  `orm:"time"`
}

type MetricsEntity added in v1.3.48

type MetricsEntity struct {
	trixorm.ORM `orm:"table=metrics"`
	ID          uint64
	AppName     string
	Metrics     string    `orm:"mediumblob"`
	CreatedAt   time.Time `orm:"time=true;"`
}

type OSSBucketCounterEntity

type OSSBucketCounterEntity struct {
	trixorm.ORM `orm:"table=oss_buckets_counters"`
	ID          uint64
	Counter     uint64 `orm:"required"`
}

type OTPTrackerEntity added in v0.8.85

type OTPTrackerEntity struct {
	trixorm.ORM           `orm:"table=otp_tracker"`
	ID                    uint64
	Type                  string `orm:"enum=entity.OTPTrackerTypeAll;required"`
	To                    string `orm:"length=50"`
	Code                  string
	GatewayName           string
	GatewayPriority       uint8
	GatewaySendStatus     string `orm:"enum=entity.OTPTrackerGatewaySendStatusAll;required"`
	GatewaySendRequest    string `orm:"length=max"`
	GatewaySendResponse   string `orm:"length=max"`
	GatewayVerifyStatus   string `orm:"enum=entity.OTPTrackerGatewayVerifyStatusAll;required"`
	GatewayVerifyRequest  string `orm:"length=max"`
	GatewayVerifyResponse string `orm:"length=max"`
	RetryCount            int
	MaxRetriesReached     bool
	SentAt                time.Time `orm:"time"`
}

type OTPTrackerGatewaySendStatus added in v0.8.85

type OTPTrackerGatewaySendStatus struct {
	OTPTrackerGatewaySendStatusNew          string
	OTPTrackerGatewaySendStatusGatewayError string
	OTPTrackerGatewaySendStatusSent         string
}

type OTPTrackerGatewayVerifyStatus added in v0.8.85

type OTPTrackerGatewayVerifyStatus struct {
	OTPTrackerGatewayVerifyStatusNewError     string
	OTPTrackerGatewayVerifyStatusGatewayError string
	OTPTrackerGatewayVerifyStatusInvalidCode  string
	OTPTrackerGatewayVerifyStatusSuccess      string
	OTPTrackerGatewayVerifyStatusExpired      string
}

type PermissionEntity added in v1.2.44

type PermissionEntity struct {
	trixorm.ORM `orm:"table=permissions;redisCache"`
	ID          uint64
	ResourceID  *ResourceEntity `orm:"required;unique=ResourceID_Name_FakeDelete:1"`
	Name        string          `orm:"required;unique=ResourceID_Name_FakeDelete:3"`
	CreatedAt   time.Time       `orm:"time=true"`
	FakeDelete  bool            `orm:"unique=ResourceID_Name_FakeDelete:2"`

	CachedQueryAll        *trixorm.CachedQuery `query:"1 ORDER BY ID"`
	CachedQueryResourceID *trixorm.CachedQuery `query:":ResourceID = ?"`
}

type PrivilegeEntity added in v1.2.44

type PrivilegeEntity struct {
	trixorm.ORM   `orm:"table=privileges;redisCache"`
	ID            uint64
	RoleID        *RoleEntity         `orm:"required;unique=RoleID_ResourceID_FakeDelete:1"`
	ResourceID    *ResourceEntity     `orm:"required;unique=RoleID_ResourceID_FakeDelete:2"`
	PermissionIDs []*PermissionEntity `orm:"required"`
	CreatedAt     time.Time           `orm:"time=true"`
	FakeDelete    bool                `orm:"unique=RoleID_ResourceID_FakeDelete:3"`

	CachedQueryPrivilegeRoleIDResourceID *trixorm.CachedQuery `queryOne:":RoleID = ? AND :ResourceID = ?"`
	CachedQueryPrivilegeRoleID           *trixorm.CachedQuery `query:":RoleID = ?"`
	CachedQueryPrivilegeResourceID       *trixorm.CachedQuery `query:":ResourceID = ?"`
}

type RequestLoggerEntity added in v1.1.59

type RequestLoggerEntity struct {
	trixorm.ORM     `orm:"table=request_logger"`
	ID              uint64
	URL             string `orm:"length=500;index=URL"`
	UserID          uint64 `orm:"index=UserID"`
	AppName         string `orm:"required;index=AppName"`
	Request         []byte `orm:"mediumblob"`
	Response        []byte `orm:"mediumblob"`
	Log             []byte `orm:"mediumblob"`
	Status          int
	RequestDuration int64
	CreatedAt       time.Time `orm:"time=true;index=CreatedAt"`
}

type ResourceEntity added in v1.2.44

type ResourceEntity struct {
	trixorm.ORM `orm:"table=resources;redisCache;redisSearch=search_pool"`
	ID          uint64    `orm:"searchable"`
	Name        string    `orm:"required;searchable;unique=Name_FakeDelete:1"`
	CreatedAt   time.Time `orm:"time=true"`
	FakeDelete  bool      `orm:"unique=Name_FakeDelete:2"`

	CachedQueryName *trixorm.CachedQuery `queryOne:":Name = ?"`
}

type RoleEntity added in v1.2.44

type RoleEntity struct {
	trixorm.ORM  `orm:"table=roles;redisCache;redisSearch=search_pool"`
	ID           uint64    `orm:"sortable"`
	Name         string    `orm:"required;searchable;unique=Name_FakeDelete:1"`
	IsPredefined bool      `orm:"searchable"`
	CreatedAt    time.Time `orm:"time=true"`
	FakeDelete   bool      `orm:"unique=Name_FakeDelete:2"`
}

type SeederEntity added in v0.9.88

type SeederEntity struct {
	trixorm.ORM `orm:"table=seeder;redisCache;redisSearch=search_pool;"`
	ID          uint64
	Name        string    `orm:"required;unique=Seeder_Name;searchable;"`
	CreatedAt   time.Time `orm:"time=true"`
}

type SettingsEntity added in v0.8.55

type SettingsEntity struct {
	trixorm.ORM `orm:"table=settings;redisCache"`
	ID          uint64
	Key         string `orm:"required;unique=SettingsKey"`
	Value       string `orm:"required;length=max"`
	ValueType   string `orm:"enum=entity.SettingsValueTypeAll"`
	Editable    bool
	Deletable   bool
	Hidden      bool

	CachedQuerySettingsKey *trixorm.CachedQuery `queryOne:":Key = ?"`
}

type SmsTrackerEntity added in v0.8.73

type SmsTrackerEntity struct {
	trixorm.ORM           `orm:"table=sms_tracker"`
	ID                    uint64
	Status                string
	To                    string `orm:"length=15"`
	Text                  string `orm:"length=max"`
	FromPrimaryGateway    string
	FromSecondaryGateway  string
	PrimaryGatewayError   string    `orm:"length=max"`
	SecondaryGatewayError string    `orm:"length=max"`
	Type                  string    `orm:"enum=entity.SMSTrackerTypeAll;required"`
	SentAt                time.Time `orm:"time"`
}

type TranslationStatus added in v1.2.93

type TranslationStatus string
const (
	TranslationStatusNew        TranslationStatus = "new"
	TranslationStatusTranslated TranslationStatus = "translated"
)

func (TranslationStatus) String added in v1.2.93

func (u TranslationStatus) String() string

type TranslationTextEntity added in v1.2.93

type TranslationTextEntity struct {
	trixorm.ORM `orm:"table=translation_texts;log=log_db_pool;localCache;dirty=clear_local_cache"`
	ID          uint64
	Lang        string `orm:"required;unique=Lang_Key:1"`
	Key         string `orm:"required;unique=Lang_Key:2"`
	Status      string `orm:"required;enum=entity.TranslationStatusAll"`
	Text        string `orm:"length=max"`
	Vars        []string

	CachedQueryLangKey *trixorm.CachedQuery `queryOne:":Lang = ? AND :Key = ?"`
}

type TranslationTextKey added in v1.2.93

type TranslationTextKey string

func (TranslationTextKey) String added in v1.2.93

func (u TranslationTextKey) String() string

type TranslationTextLang added in v1.2.93

type TranslationTextLang string

func (TranslationTextLang) String added in v1.2.93

func (u TranslationTextLang) String() string

Jump to

Keyboard shortcuts

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