Help us shape the future of Go! Take the 2026 Go Developer Survey

common

package
v1.21.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package common holds the Hertz handlers of the unauthenticated site-level reads: the global configuration, the terms of service and privacy policy, the site statistics, the client downloads and the heartbeat.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientHandler

func GetClientHandler(service PublicInfo) app.HandlerFunc

GetClientHandler documents Get Client.

@Summary Get Client @Tags common @Produce json @Success 200 {object} httpx.ResponseSuccessBean{data=dto.GetSubscribeClientResponse} @Router /v1/common/client [get]

func GetGlobalConfigHandler

func GetGlobalConfigHandler(service PublicInfo) app.HandlerFunc

GetGlobalConfigHandler documents Get global config.

@Summary Get global config @Tags common @Produce json @Success 200 {object} httpx.ResponseSuccessBean{data=dto.GetGlobalConfigResponse} @Router /v1/common/site/config [get]

func GetPrivacyPolicyHandler

func GetPrivacyPolicyHandler(service PublicInfo) app.HandlerFunc

GetPrivacyPolicyHandler documents Get Privacy Policy.

@Summary Get Privacy Policy @Tags common @Produce json @Success 200 {object} httpx.ResponseSuccessBean{data=dto.PrivacyPolicyConfig} @Router /v1/common/site/privacy [get]

func GetStatHandler

func GetStatHandler(service PublicInfo) app.HandlerFunc

GetStatHandler documents Get stat.

@Summary Get stat @Tags common @Produce json @Success 200 {object} httpx.ResponseSuccessBean{data=dto.GetStatResponse} @Router /v1/common/site/stat [get]

func GetTosHandler

func GetTosHandler(service PublicInfo) app.HandlerFunc

GetTosHandler documents Get Tos Content.

@Summary Get Tos Content @Tags common @Produce json @Success 200 {object} httpx.ResponseSuccessBean{data=dto.GetTosResponse} @Router /v1/common/site/tos [get]

func HeartbeatHandler

func HeartbeatHandler(service PublicInfo) app.HandlerFunc

HeartbeatHandler documents Heartbeat.

@Summary Heartbeat @Tags common @Produce json @Success 200 {object} httpx.ResponseSuccessBean{data=dto.HeartbeatResponse} @Router /v1/common/heartbeat [get]

Types

type PublicInfo added in v1.21.0

type PublicInfo interface {
	GetGlobalConfig(ctx context.Context) (*dto.GetGlobalConfigResponse, error)
	GetTos(ctx context.Context) (*dto.GetTosResponse, error)
	GetPrivacyPolicy(ctx context.Context) (*dto.PrivacyPolicyConfig, error)
	GetStat(ctx context.Context) (*dto.GetStatResponse, error)
	GetClient(ctx context.Context) (*dto.GetSubscribeClientResponse, error)
	Heartbeat(ctx context.Context) (*dto.HeartbeatResponse, error)
}

PublicInfo is the part of the platform facade the site-level handlers call.

Jump to

Keyboard shortcuts

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