profiles

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProfileNotFound = errors.New("public profile not found")

ErrProfileNotFound is returned when a public profile is not found (user doesn't exist, is not active, or has not enabled public profile)

Functions

func GetPublicProfile

func GetPublicProfile(c *gin.Context)

GetPublicProfile returns the public profile and shared packs for a username @Summary Get public user profile @Description Returns public profile information and shared packs for a user. @Description Returns 404 for non-existent users or users without a public profile (anti-enumeration). @Tags Profiles @Produce json @Param username path string true "Username" @Success 200 {object} PublicProfile @Failure 404 {object} apitypes.ErrorResponse "Profile not found" @Failure 500 {object} apitypes.ErrorResponse "Internal Server Error" @Router /user/{username} [get]

Types

type PublicProfile

type PublicProfile struct {
	AccountID       uint                `json:"account_id"`
	Username        string              `json:"username"`
	Firstname       string              `json:"firstname"`
	HasProfileImage bool                `json:"has_profile_image"`
	ImagePositionX  int                 `json:"image_position_x"`
	ImagePositionY  int                 `json:"image_position_y"`
	HasBannerImage  bool                `json:"has_banner_image"`
	BannerPositionY int                 `json:"banner_position_y"`
	YoutubeURL      *string             `json:"youtube_url,omitempty"`
	InstagramURL    *string             `json:"instagram_url,omitempty"`
	SharedPacks     []SharedPackSummary `json:"shared_packs"`
}

PublicProfile represents the public-facing user profile

type SharedPackSummary

type SharedPackSummary struct {
	ID              uint      `json:"id"`
	PackName        string    `json:"pack_name"`
	PackDescription string    `json:"pack_description"`
	HasImage        bool      `json:"has_image"`
	PackWeight      int       `json:"pack_weight"`
	BaseWeight      int       `json:"base_weight"`
	PackItemsCount  int       `json:"pack_items_count"`
	SharingCode     string    `json:"sharing_code"`
	Season          *string   `json:"season,omitempty"`
	Trail           *string   `json:"trail,omitempty"`
	Adventure       *string   `json:"adventure,omitempty"`
	CreatedAt       time.Time `json:"created_at"`
}

SharedPackSummary represents a shared pack in a public profile

Jump to

Keyboard shortcuts

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