dashboard

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnauthorized is returned when user doesn't have permission to access dashboard
	ErrUnauthorized = errors.New("unauthorized access to dashboard")
)

Functions

This section is empty.

Types

type RecentItem

type RecentItem struct {
	ID        int       `json:"id"`
	Title     string    `json:"title"`
	Slug      string    `json:"slug"`
	Status    string    `json:"status"`
	CreatedAt time.Time `json:"createdAt"`
}

RecentItem represents a recent content item in the dashboard

type Repository

type Repository interface {
	GetStats(ctx context.Context, userID int) (*Stats, error)
}

Repository defines the interface for dashboard repository operations

type Service

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

func NewService

func NewService(repo Repository) *Service

func (*Service) GetStats

func (s *Service) GetStats(ctx context.Context, userID int) (*Stats, error)

type Stats

type Stats struct {
	PublishedPosts       int           `json:"publishedPosts"`
	DraftPosts           int           `json:"draftPosts"`
	RegisteredUsers      int           `json:"registeredUsers"`
	PendingRegistrations int           `json:"pendingRegistrations"`
	MediaItems           int           `json:"mediaItems"`
	RecentContent        []*RecentItem `json:"recentContent,omitempty"`
}

Stats represents dashboard statistics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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