service

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectSQLDb

func ConnectSQLDb(ctx context.Context, config *config.Config, sugar *zap.SugaredLogger) (*gorm.DB, error)

func MigrateDown

func MigrateDown(db *gorm.DB) error

func MigrateUp

func MigrateUp(db *gorm.DB) error

Types

type Heartbeat

type Heartbeat struct {
	relational.UUIDModel

	UUID      uuid.UUID `gorm:"index"`
	CreatedAt time.Time `gorm:"index"`
}

type ListResponse

type ListResponse[T any] struct {
	Data       []T   `json:"data"`
	Total      int64 `json:"total"`
	Page       int   `json:"page"`
	Limit      int   `json:"limit"`
	TotalPages int   `json:"totalPages"`
}

ListResponse represents a paginated response structure

func NewListResponse

func NewListResponse[T any](data []T, total int64, page, limit int) *ListResponse[T]

NewListResponse creates a new paginated list response

type PaginationConfig

type PaginationConfig struct {
	DefaultLimit int
	MaxLimit     int
}

PaginationConfig holds configuration for pagination behavior

func NewPaginationConfig

func NewPaginationConfig() *PaginationConfig

NewPaginationConfig creates a new pagination configuration with sensible defaults

func (*PaginationConfig) ParseParams

func (cfg *PaginationConfig) ParseParams(ctx echo.Context) (*PaginationParams, error)

ParseParams extracts and validates pagination parameters from echo context

type PaginationParams

type PaginationParams struct {
	Page   int
	Limit  int
	Offset int
}

PaginationParams holds parsed pagination parameters

Directories

Path Synopsis
sso

Jump to

Keyboard shortcuts

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