Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Meta ¶
type Meta struct {
M []MetaValues `json:"meta_collection"`
}
type MetaValues ¶
type Shorty ¶
type Shorty struct { ID uuid.UUID `json:"id" gorm:"column:id;type:uuid;default:uuid_generate_v4()"` PublicID string `json:"-" gorm:"column:public_id"` Link string `json:"link" gorm:"column:link"` TTL *time.Time `json:"TTL" gorm:"column:ttl"` RedirectionLimit *int `json:"redirection_limit" gorm:"column:redirection_limit"` CreatedAt *time.Time `json:"created_at" gorm:"column:created_at"` DeletedAt *time.Time `json:"deleted_at" gorm:"column:deleted_at"` ShortyAccesses []ShortyAccess `json:"accesses,omitempty" gorm:"-"` ShortLink string `json:"short_link" gorm:"-"` Visits int `json:"visits" gorm:"-"` RedirectCount int `json:"redirects" gorm:"-"` QRCode string `json:"qr_code,omitempty" gorm:"column:qr_code"` }
type ShortyAccess ¶
type ShortyAccess struct { ID uuid.UUID `json:"id" gorm:"column:id;type:uuid;default:uuid_generate_v4()"` CreatedAt *time.Time `json:"created_at" gorm:"column:created_at"` ShortyID uuid.UUID `json:"-" gorm:"column:shorty_id"` Meta Meta `json:"meta" gorm:"column:meta; type:JSONB"` UserAgent string `json:"user_agent" gorm:"column:user_agent"` IPAddress string `json:"ip" gorm:"column:ip_address"` Extra string `json:"extra" gorm:"column:extra"` OperatingSystem string `json:"os" gorm:"column:operating_system"` Browser string `json:"browser" gorm:"column:browser"` Status string `json:"status" gorm:"column:status"` }
func (ShortyAccess) ConvertMeta ¶
func (ShortyAccess) ConvertMeta(a map[string][]string) Meta
func (ShortyAccess) TableName ¶
func (ShortyAccess) TableName() string
type ShortyAccessRepository ¶
type ShortyAccessRepository struct {
database.Repository
}
func NewShortyAccessRepository ¶
func NewShortyAccessRepository(db *database.Database, log *zap.Logger) *ShortyAccessRepository
func (*ShortyAccessRepository) ListByShortyUUID ¶
func (r *ShortyAccessRepository) ListByShortyUUID(id uuid.UUID, limit, offset int) ([]*ShortyAccess, error)
type ShortyForList ¶
type ShortyForList struct { ID uuid.UUID `json:"id" gorm:"column:id;type:uuid;default:uuid_generate_v4()"` PublicID string `json:"public_id" gorm:"column:public_id"` Link string `json:"link" gorm:"column:link"` TTL *time.Time `json:"TTL,omitempty" gorm:"column:ttl"` RedirectionLimit *int `json:"redirection_limit,omitempty" gorm:"column:redirection_limit"` CreatedAt *time.Time `json:"created_at" gorm:"column:created_at"` DeletedAt *time.Time `json:"deleted_at" gorm:"column:deleted_at"` ShortyAccesses []ShortyAccess `json:"accesses,omitempty" gorm:"-"` ShortLink string `json:"short_link,omitempty" gorm:"-"` Visits int `json:"visits" gorm:"visits"` Redirects int `json:"redirects" gorm:"redirects"` QRCode string `json:"qr_code,omitempty" gorm:"column:qr_code"` }
type ShortyRepository ¶
type ShortyRepository struct {
database.Repository
}
func NewShortyRepository ¶
func NewShortyRepository(db *database.Database, log *zap.Logger) *ShortyRepository
func (*ShortyRepository) List ¶
func (r *ShortyRepository) List(limit, offset int) ([]*Shorty, error)
func (*ShortyRepository) ListWithAccessData ¶
func (r *ShortyRepository) ListWithAccessData(listWithQRCode bool, limit, offset int) ([]*ShortyForList, error)
Click to show internal directories.
Click to hide internal directories.