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

handler

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: 10 Imported by: 0

Documentation

Overview

Package handler serves subscription delivery over HTTP: the client configuration for a subscription token or a pan-domain host.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PanDomainSubscribeHandler

func PanDomainSubscribeHandler(deps SubscribeDeps) app.HandlerFunc

PanDomainSubscribeHandler returns a subscription selected by the request host.

@Summary Get pan-domain subscription configuration @Tags user @Produce plain @Param User-Agent header string false "Client user agent" @Success 200 {string} string @Router / [get]

func SubscribeHandler

func SubscribeHandler(deps SubscribeDeps) app.HandlerFunc

SubscribeHandler returns a client subscription configuration.

@Summary Get subscription configuration @Tags user @Produce plain @Param token query string false "Subscription token; alternatively send the token header" @Param token header string false "Subscription token" @Param flag query string false "Subscription format flag" @Param type query string false "Subscription format type" @Param User-Agent header string false "Client user agent" @Success 200 {string} string @Router /v1/subscribe/config [get]

Types

type Deliverer added in v1.21.0

type Deliverer interface {
	IsUserAgentAllowed(ctx context.Context, userAgent string) bool
	Deliver(ctx context.Context, meta subscription.RequestMeta, req *dto.SubscribeRequest) (*dto.SubscribeResponse, error)
}

Deliverer is the part of the subscription facade the delivery endpoints use: the user-agent allowlist and the rendering of a subscription's client configuration.

type SubscribeDeps

type SubscribeDeps struct {
	Service Deliverer
	Config  func() config.SubscribeConfig
}

Directories

Path Synopsis
admin
application
Package application holds the admin HTTP handlers for the client applications of subscription delivery and their template previews.
Package application holds the admin HTTP handlers for the client applications of subscription delivery and their template previews.
subscribe
Package subscribe holds the admin HTTP handlers for plans and plan groups.
Package subscribe holds the admin HTTP handlers for plans and plan groups.
user
Package user holds the admin HTTP handlers for the users' subscriptions.
Package user holds the admin HTTP handlers for the users' subscriptions.
public
subscribe
Package subscribe holds the public HTTP handlers for the plan storefront and the owner's subscription nodes.
Package subscribe holds the public HTTP handlers for the plan storefront and the owner's subscription nodes.
user
Package user holds the HTTP handlers through which users manage their own subscriptions.
Package user holds the HTTP handlers through which users manage their own subscriptions.

Jump to

Keyboard shortcuts

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