model

package
v0.0.0-...-d39f515 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventDeviceTypeDesktop = "DESKTOP"
	EventDeviceTypeMobile  = "MOBILE"
	EventDeviceTypeTablet  = "TABLET"
)
View Source
const (
	OrganizationNameMaxLength                                          = 70
	OrganizationNameMinLength                                          = 2
	OrganizationSubscriptionPeriodMonth OrganizationSubscriptionPeriod = "MONTH"
	OrganizationSubscriptionPeriodYear  OrganizationSubscriptionPeriod = "YEAR"
)
View Source
const (
	OrganizationDeletionDetailsMaxLength = 1000
	OrganizationDeletionDetailsMinLength = 2

	OrganizationDeletionReasonMaxLength = 400
	OrganizationDeletionReasonMinLength = 2
)
View Source
const (
	SiteNameMaxLength = 50
	SiteNameMinLength = 1
)
View Source
const (
	UserNameMaxLength     = 70
	UserNameMinLength     = 1
	UserPasswordMaxLength = 72
	UserPasswordMinLength = 8
)
View Source
const UserAccessTokenLastUsedAtPrefix = "userAccessTokenLastUsedAt"

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	BrowserName            *string
	BrowserVersion         *string
	CountryIsoCode         *string
	DateTime               time.Time
	DeviceType             *string
	Duration               uint32
	Id                     string
	IsBot                  bool
	Kind                   string
	Language               *string
	Locale                 *string
	OperatingSystemName    *string
	OperatingSystemVersion *string
	Referrer               *string
	SiteId                 uint64
	TimeZone               *string
	Url                    string
	UserAgent              string
	UtmCampaign            *string
	UtmContent             *string
	UtmMedium              *string
	UtmSource              *string
	UtmTerm                *string
	VisitorId              string
}

func (*Event) FillFromLocale

func (e *Event) FillFromLocale(locale string)

func (*Event) FillFromTimeZone

func (e *Event) FillFromTimeZone(timeZone string)

func (*Event) FillFromUrl

func (e *Event) FillFromUrl(url string, safeQueryParameters []string)

func (*Event) FillFromUserAgent

func (e *Event) FillFromUserAgent(userAgent string)

func (*Event) FillVisitorId

func (e *Event) FillVisitorId(dp *depot.Depot, ipAddress string, userAgent string)

func (*Event) TableName

func (e *Event) TableName() string

type EventKind

type EventKind = string
const (
	EventKindPageView EventKind = "PAGE_VIEW"
)

type Organization

type Organization struct {
	CreatedAt               time.Time
	GoogleOauthRefreshToken *string
	Id                      uint64
	IsOnTrial               bool
	Name                    string
	Plan                    *Plan
	PlanId                  *uint64
	StripeCustomerId        *string
	SubscriptionPeriod      *OrganizationSubscriptionPeriod
	TrialEndsAt             *time.Time
	UpdatedAt               time.Time
}

type OrganizationDeletion

type OrganizationDeletion struct {
	DateTime                     time.Time
	Details                      *string
	Id                           uint64
	OrganizationCreatedAt        time.Time
	OrganizationId               uint64
	OrganizationName             string
	OrganizationPlanName         *string
	OrganizationStripeCustomerId *string
	Reason                       string
	UserEmail                    string
	UserId                       uint64
	UserName                     string
}

type OrganizationSubscriptionPeriod

type OrganizationSubscriptionPeriod string

type Plan

type Plan struct {
	CreatedAt         time.Time `gorm:"not null"`
	Id                uint64    `gorm:"primaryKey"`
	MaxEventsPerMonth *uint64
	MaxUsers          *uint64
	Name              string
	StripeProductId   *string
	UpdatedAt         time.Time `gorm:"not null"`
}

type Site

type Site struct {
	CreatedAt                  time.Time
	Domain                     string
	GoogleSearchConsoleSiteUrl *string
	HasEvents                  bool
	Id                         uint64
	IsPublic                   bool
	Name                       string
	Organization               Organization `gorm:"constraint:OnDelete:CASCADE"`
	OrganizationId             uint64
	SafeQueryParameters        pq.StringArray `gorm:"type:text[]"`
	UpdatedAt                  time.Time
}

type User

type User struct {
	ActivationToken          *string
	CreatedAt                time.Time
	Email                    string
	EmailVerificationToken   *string
	Id                       uint64
	IsActive                 bool
	IsEmailVerified          bool
	IsOrganizationOwner      bool
	LastAccessTokenCreatedAt *time.Time
	Name                     string
	Organization             Organization
	OrganizationId           uint64
	Password                 *string
	PasswordResetToken       *string
	UpdatedAt                time.Time
}

type UserAccessToken

type UserAccessToken struct {
	CreatedAt  time.Time `gorm:"not null"`
	Id         uint64    `gorm:"primaryKey"`
	LastUsedAt *time.Time
	Token      string `gorm:"not null"`
	User       User   `gorm:"constraint:OnDelete:CASCADE"`
	UserId     uint64 `gorm:"not null"`
}

func (*UserAccessToken) LastUsedAtRedisKey

func (t *UserAccessToken) LastUsedAtRedisKey() string

Jump to

Keyboard shortcuts

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