gen

package
v0.0.0-...-0fec8e7 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {
	ID        int32
	Name      string
	Token     string
	UserID    uuid.UUID
	CreatedAt pgtype.Timestamptz
	ExpiredAt pgtype.Timestamptz
}

type CheckProjectWithinUserIDParams

type CheckProjectWithinUserIDParams struct {
	ID     uuid.UUID
	UserID uuid.UUID
}

type CountProjectSizeParams

type CountProjectSizeParams struct {
	UserID    uuid.UUID
	ProjectID uuid.UUID
}

type CreateAPIKeyParams

type CreateAPIKeyParams struct {
	Name      string
	Token     string
	UserID    uuid.UUID
	CreatedAt pgtype.Timestamptz
	ExpiredAt pgtype.Timestamptz
}

type CreateAPIKeyRow

type CreateAPIKeyRow struct {
	Name      string
	Token     string
	CreatedAt pgtype.Timestamptz
	ExpiredAt pgtype.Timestamptz
}

type CreateEventParams

type CreateEventParams struct {
	EventType        string
	EventLabel       pgtype.Text
	PageUrl          pgtype.Text
	ElementPath      pgtype.Text
	ElementType      pgtype.Text
	IpAddr           *netip.Addr
	UserAgent        pgtype.Text
	BrowserName      pgtype.Text
	Country          pgtype.Text
	Region           pgtype.Text
	City             pgtype.Text
	SessionID        pgtype.Text
	DeviceType       pgtype.Text
	TimeOnPage       pgtype.Int4
	ScreenResolution pgtype.Text
	FiredAt          time.Time
	ReceivedAt       time.Time
	UserID           uuid.UUID
	ProjectID        uuid.UUID
}

type CreateProjectAggrParams

type CreateProjectAggrParams struct {
	ProjectID            uuid.UUID
	UserID               uuid.UUID
	TotalEvents          int32
	TotalEventTypes      int32
	TotalUniqueUsers     int32
	TotalLocations       int32
	TotalUniquePageUrls  int32
	MostVisitedUrls      []byte
	MostVisitedCountries []byte
	MostVisitedCities    []byte
	MostVisitedRegions   []byte
	MostFiringElements   []byte
	LastVisitedUsers     []byte
	MostUsedBrowsers     []byte
	MostFiredEventTypes  []byte
	MostFiredEventLabels []byte
	AggregatedAt         time.Time
	AggregatedAtStr      string
}

type CreateProjectParams

type CreateProjectParams struct {
	Name        string
	Description pgtype.Text
	Url         pgtype.Text
	UserID      uuid.UUID
	CreatedAt   pgtype.Timestamptz
}

type CreateProjectRow

type CreateProjectRow struct {
	Name        string
	Description pgtype.Text
	CreatedAt   pgtype.Timestamptz
}

type CreateUserParams

type CreateUserParams struct {
	Fullname       string
	Email          string
	PasswordHashed string
	ProfileUrl     pgtype.Text
	RootUser       bool
	PublicKey      string
}

type CreateUserRow

type CreateUserRow struct {
	ID         uuid.UUID
	Fullname   string
	Email      string
	ProfileUrl pgtype.Text
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeleteAPIKeyParams

type DeleteAPIKeyParams struct {
	UserID uuid.UUID
	ID     int32
}

type DeleteEventByProjectIDParams

type DeleteEventByProjectIDParams struct {
	UserID    uuid.UUID
	ProjectID uuid.UUID
}

type DeleteProjectParams

type DeleteProjectParams struct {
	UserID uuid.UUID
	ID     uuid.UUID
}

type DownloadIntervalEventDataParams

type DownloadIntervalEventDataParams struct {
	UserID    uuid.UUID
	ProjectID uuid.UUID
	Interval  int32
}

type Event

type Event struct {
	ID               uuid.UUID
	EventType        string
	EventLabel       pgtype.Text
	PageUrl          pgtype.Text
	ElementPath      pgtype.Text
	ElementType      pgtype.Text
	IpAddr           *netip.Addr
	UserAgent        pgtype.Text
	BrowserName      pgtype.Text
	Country          pgtype.Text
	Region           pgtype.Text
	City             pgtype.Text
	SessionID        pgtype.Text
	DeviceType       pgtype.Text
	TimeOnPage       pgtype.Int4
	ScreenResolution pgtype.Text
	FiredAt          time.Time
	ReceivedAt       time.Time
	UserID           uuid.UUID
	ProjectID        uuid.UUID
}

type FindAllAPIKeysRow

type FindAllAPIKeysRow struct {
	ID        int32
	Name      string
	Token     string
	CreatedAt pgtype.Timestamptz
	ExpiredAt pgtype.Timestamptz
}

type FindAllProjectsRow

type FindAllProjectsRow struct {
	ID          uuid.UUID
	Name        string
	Description pgtype.Text
	Url         pgtype.Text
	CreatedAt   pgtype.Timestamptz
}

type FindProjectAggrParams

type FindProjectAggrParams struct {
	ProjectID uuid.UUID
	UserID    uuid.UUID
	Limit     int32
}

type FindProjectByIDParams

type FindProjectByIDParams struct {
	ID     uuid.UUID
	UserID uuid.UUID
}

type FindProjectByIDRow

type FindProjectByIDRow struct {
	ID          uuid.UUID
	Name        string
	Description pgtype.Text
	Url         pgtype.Text
	CreatedAt   pgtype.Timestamptz
}

type FindUserByEmailRow

type FindUserByEmailRow struct {
	ID         uuid.UUID
	Fullname   string
	Email      string
	ProfileUrl pgtype.Text
}

type FindUserByEmailWithHashRow

type FindUserByEmailWithHashRow struct {
	ID             uuid.UUID
	Email          string
	PasswordHashed string
}

type FindUserByIDRow

type FindUserByIDRow struct {
	ID         uuid.UUID
	Fullname   string
	Email      string
	ProfileUrl pgtype.Text
}

type FindUserByPrivateKeyRow

type FindUserByPrivateKeyRow struct {
	ID         uuid.UUID
	Fullname   string
	Email      string
	ProfileUrl pgtype.Text
}

type FindUserByPublicKeyRow

type FindUserByPublicKeyRow struct {
	ID         uuid.UUID
	Fullname   string
	Email      string
	ProfileUrl pgtype.Text
}

type GetBriefAggrParams

type GetBriefAggrParams struct {
	ProjectID uuid.UUID
	UserID    uuid.UUID
}

type GetBriefAggrRow

type GetBriefAggrRow struct {
	TotalEvents         int64
	TotalUniqueUsers    int64
	TotalEventType      int64
	TotalCountryVisited int64
	MostVisitedUrl      pgtype.Text
	MostCountryVisited  pgtype.Text
}

type GetDetailAggrParams

type GetDetailAggrParams struct {
	ProjectID uuid.UUID
	UserID    uuid.UUID
}

type GetDetailAggrRow

type GetDetailAggrRow struct {
	QueryType string
	Name      pgtype.Text
	Total     string
}

type GetEventsParams

type GetEventsParams struct {
	UserID     uuid.UUID
	Interval   int32
	ProjectID  uuid.UUID
	LimitCount int32
}

type GetEventsRow

type GetEventsRow struct {
	ProjectName      string
	EventType        string
	EventLabel       pgtype.Text
	PageUrl          pgtype.Text
	ElementPath      pgtype.Text
	ElementType      pgtype.Text
	IpAddr           *netip.Addr
	UserAgent        pgtype.Text
	BrowserName      pgtype.Text
	Country          pgtype.Text
	Region           pgtype.Text
	City             pgtype.Text
	SessionID        pgtype.Text
	DeviceType       pgtype.Text
	TimeOnPage       pgtype.Int4
	ScreenResolution pgtype.Text
	FiredAt          time.Time
	ReceivedAt       time.Time
	ProjectID        uuid.UUID
}

type GetLiveEventsDetailParams

type GetLiveEventsDetailParams struct {
	ProjectID  uuid.UUID
	UserID     uuid.UUID
	Bylasthour bool
	LimitCount int32
}

type GetLiveEventsDetailRow

type GetLiveEventsDetailRow struct {
	EventType        string
	EventLabel       pgtype.Text
	PageUrl          pgtype.Text
	ElementPath      pgtype.Text
	ElementType      pgtype.Text
	IpAddr           *netip.Addr
	UserAgent        pgtype.Text
	BrowserName      pgtype.Text
	Country          pgtype.Text
	Region           pgtype.Text
	City             pgtype.Text
	DeviceType       pgtype.Text
	TimeOnPage       pgtype.Int4
	ScreenResolution pgtype.Text
	FiredAt          time.Time
	ReceivedAt       time.Time
}

type GetLiveEventsRow

type GetLiveEventsRow struct {
	Name        string
	EventType   string
	EventLabel  pgtype.Text
	PageUrl     pgtype.Text
	ElementPath pgtype.Text
	Country     pgtype.Text
	FiredAt     time.Time
	ReceivedAt  time.Time
}

type GetPercentageEventsLabelParams

type GetPercentageEventsLabelParams struct {
	ProjectID uuid.UUID
	UserID    uuid.UUID
}

type GetPercentageEventsLabelRow

type GetPercentageEventsLabelRow struct {
	EventLabel pgtype.Text
	Total      int64
}

type GetPercentageEventsTypeParams

type GetPercentageEventsTypeParams struct {
	ProjectID uuid.UUID
	UserID    uuid.UUID
}

type GetPercentageEventsTypeRow

type GetPercentageEventsTypeRow struct {
	EventType string
	Total     int64
}

type GetTotalAggrParams

type GetTotalAggrParams struct {
	ProjectID uuid.UUID
	UserID    uuid.UUID
}

type GetTotalAggrRow

type GetTotalAggrRow struct {
	TotalEvents         int64
	TotalEventType      int64
	TotalUniqueUsers    int64
	TotalCountryVisited int64
	TotalPageUrl        int64
}

type GetWeeklyEventsParams

type GetWeeklyEventsParams struct {
	ProjectID uuid.UUID
	UserID    uuid.UUID
}

type GetWeeklyEventsRow

type GetWeeklyEventsRow struct {
	Timestamp pgtype.Timestamp
	Total     int64
}

type GetWeeklyEventsTotalParams

type GetWeeklyEventsTotalParams struct {
	ProjectID uuid.UUID
	UserID    uuid.UUID
}

type LastProjectDataReceivedParams

type LastProjectDataReceivedParams struct {
	UserID    uuid.UUID
	ProjectID uuid.UUID
}

type Project

type Project struct {
	ID          uuid.UUID
	Name        string
	Description pgtype.Text
	Url         pgtype.Text
	UserID      uuid.UUID
	CreatedAt   pgtype.Timestamptz
	DeletedAt   pgtype.Timestamptz
}

type ProjectAggregation

type ProjectAggregation struct {
	ID                   int32
	ProjectID            uuid.UUID
	UserID               uuid.UUID
	TotalEvents          int32
	TotalEventTypes      int32
	TotalUniqueUsers     int32
	TotalLocations       int32
	TotalUniquePageUrls  int32
	MostVisitedUrls      []byte
	MostVisitedCountries []byte
	MostVisitedCities    []byte
	MostVisitedRegions   []byte
	MostFiringElements   []byte
	LastVisitedUsers     []byte
	MostUsedBrowsers     []byte
	MostFiredEventTypes  []byte
	MostFiredEventLabels []byte
	AggregatedAt         time.Time
	AggregatedAtStr      string
	AggregatedTimeBucket time.Time
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CheckAdminExist

func (q *Queries) CheckAdminExist(ctx context.Context) (bool, error)

func (*Queries) CheckProjectAggrEligibility

func (q *Queries) CheckProjectAggrEligibility(ctx context.Context, projectID uuid.UUID) (int64, error)

func (*Queries) CheckProjectWithinUserID

func (q *Queries) CheckProjectWithinUserID(ctx context.Context, arg CheckProjectWithinUserIDParams) (bool, error)

func (*Queries) CheckUserIDExist

func (q *Queries) CheckUserIDExist(ctx context.Context, id uuid.UUID) (bool, error)

func (*Queries) CountProject

func (q *Queries) CountProject(ctx context.Context, userID uuid.UUID) (int64, error)

func (*Queries) CountProjectSize

func (q *Queries) CountProjectSize(ctx context.Context, arg CountProjectSizeParams) (int64, error)

func (*Queries) CountUserMonthlyEvents

func (q *Queries) CountUserMonthlyEvents(ctx context.Context, userID uuid.UUID) (int64, error)

func (*Queries) CreateAPIKey

func (q *Queries) CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) (CreateAPIKeyRow, error)

func (*Queries) CreateEvent

func (q *Queries) CreateEvent(ctx context.Context, arg CreateEventParams) error

func (*Queries) CreateProject

func (q *Queries) CreateProject(ctx context.Context, arg CreateProjectParams) (CreateProjectRow, error)

func (*Queries) CreateProjectAggr

func (q *Queries) CreateProjectAggr(ctx context.Context, arg CreateProjectAggrParams) error

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (CreateUserRow, error)

func (*Queries) DeleteAPIKey

func (q *Queries) DeleteAPIKey(ctx context.Context, arg DeleteAPIKeyParams) error

func (*Queries) DeleteEventByProjectID

func (q *Queries) DeleteEventByProjectID(ctx context.Context, arg DeleteEventByProjectIDParams) error

func (*Queries) DeleteProject

func (q *Queries) DeleteProject(ctx context.Context, arg DeleteProjectParams) error

func (*Queries) DownloadIntervalEventData

func (q *Queries) DownloadIntervalEventData(ctx context.Context, arg DownloadIntervalEventDataParams) ([]Event, error)

func (*Queries) FindAllAPIKeys

func (q *Queries) FindAllAPIKeys(ctx context.Context, userID uuid.UUID) ([]FindAllAPIKeysRow, error)

func (*Queries) FindAllProjects

func (q *Queries) FindAllProjects(ctx context.Context, userID uuid.UUID) ([]FindAllProjectsRow, error)

func (*Queries) FindProjectAggr

func (q *Queries) FindProjectAggr(ctx context.Context, arg FindProjectAggrParams) ([]ProjectAggregation, error)

func (*Queries) FindProjectByID

func (q *Queries) FindProjectByID(ctx context.Context, arg FindProjectByIDParams) (FindProjectByIDRow, error)

func (*Queries) FindUserByEmail

func (q *Queries) FindUserByEmail(ctx context.Context, email string) (FindUserByEmailRow, error)

func (*Queries) FindUserByEmailWithHash

func (q *Queries) FindUserByEmailWithHash(ctx context.Context, email string) (FindUserByEmailWithHashRow, error)

func (*Queries) FindUserByID

func (q *Queries) FindUserByID(ctx context.Context, id uuid.UUID) (FindUserByIDRow, error)

func (*Queries) FindUserByPrivateKey

func (q *Queries) FindUserByPrivateKey(ctx context.Context, token string) (FindUserByPrivateKeyRow, error)

func (*Queries) FindUserByPublicKey

func (q *Queries) FindUserByPublicKey(ctx context.Context, publicKey string) (FindUserByPublicKeyRow, error)

func (*Queries) FindUserPublicKey

func (q *Queries) FindUserPublicKey(ctx context.Context, id uuid.UUID) (string, error)

func (*Queries) GetBriefAggr

func (q *Queries) GetBriefAggr(ctx context.Context, arg GetBriefAggrParams) (GetBriefAggrRow, error)

func (*Queries) GetDetailAggr

func (q *Queries) GetDetailAggr(ctx context.Context, arg GetDetailAggrParams) ([]GetDetailAggrRow, error)

func (*Queries) GetEventTableHeaders

func (q *Queries) GetEventTableHeaders(ctx context.Context) ([]string, error)

func (*Queries) GetEvents

func (q *Queries) GetEvents(ctx context.Context, arg GetEventsParams) ([]GetEventsRow, error)

check if project id is provided and is not default empty UUID

func (*Queries) GetLiveEvents

func (q *Queries) GetLiveEvents(ctx context.Context, userID uuid.UUID) ([]GetLiveEventsRow, error)

func (*Queries) GetLiveEventsDetail

func (q *Queries) GetLiveEventsDetail(ctx context.Context, arg GetLiveEventsDetailParams) ([]GetLiveEventsDetailRow, error)

func (*Queries) GetPercentageEventsLabel

func (q *Queries) GetPercentageEventsLabel(ctx context.Context, arg GetPercentageEventsLabelParams) ([]GetPercentageEventsLabelRow, error)

func (*Queries) GetPercentageEventsType

func (q *Queries) GetPercentageEventsType(ctx context.Context, arg GetPercentageEventsTypeParams) ([]GetPercentageEventsTypeRow, error)

func (*Queries) GetTotalAggr

func (q *Queries) GetTotalAggr(ctx context.Context, arg GetTotalAggrParams) (GetTotalAggrRow, error)

func (*Queries) GetWeeklyEvents

func (q *Queries) GetWeeklyEvents(ctx context.Context, arg GetWeeklyEventsParams) ([]GetWeeklyEventsRow, error)

func (*Queries) GetWeeklyEventsTotal

func (q *Queries) GetWeeklyEventsTotal(ctx context.Context, arg GetWeeklyEventsTotalParams) (int64, error)

func (*Queries) LastProjectDataReceived

func (q *Queries) LastProjectDataReceived(ctx context.Context, arg LastProjectDataReceivedParams) (time.Time, error)

func (*Queries) UpdateProject

func (q *Queries) UpdateProject(ctx context.Context, arg UpdateProjectParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type UpdateProjectParams

type UpdateProjectParams struct {
	Name        string
	Description pgtype.Text
	Url         pgtype.Text
	ID          uuid.UUID
	UserID      uuid.UUID
}

type User

type User struct {
	ID             uuid.UUID
	Fullname       string
	Email          string
	PasswordHashed string
	RootUser       bool
	ProfileUrl     pgtype.Text
	PublicKey      string
	CreatedAt      pgtype.Timestamptz
	UpdatedAt      pgtype.Timestamptz
	DeletedAt      pgtype.Timestamptz
}

Jump to

Keyboard shortcuts

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