delivery

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package delivery implements the subscription delivery subdomain of the subscription module: token-authenticated rendering of client configs via the adapter, with notice placeholders for expired/exhausted subscriptions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SiteName              string
	Host                  string
	SubscribeDomain       string
	ProfileUpdateInterval int64
	ProfileWebPageURL     string
	UserAgentList         string
	GatewayMode           bool
}

Config is the runtime configuration snapshot for a delivery request; it is re-read per request because the subscribe/site settings are mutable.

type Deps

type Deps struct {
	Clients  repository.ClientRepo
	Plans    repository.SubscribeRepo
	UserSubs repository.UserSubscriptionRepo
	// Users is the identity read port for the account-enabled gate.
	Users repository.UserRepo
	Nodes repository.NodeRepo
	Logs  repository.LogRepo
	// ConfigSnapshot reads the current delivery configuration.
	ConfigSnapshot func() Config
}

type RequestMeta

type RequestMeta struct {
	Host       string
	RequestURI string
	UserAgent  string
	ClientIP   string
}

RequestMeta carries the raw transport details of the subscription request.

type Service

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

func NewService

func NewService(deps Deps) *Service

func (*Service) Deliver

Deliver renders the client configuration for a subscription token.

func (*Service) IsUserAgentAllowed

func (s *Service) IsUserAgentAllowed(ctx context.Context, userAgent string) bool

type SubscribeLogic

type SubscribeLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*SubscribeLogic) Handler

func (l *SubscribeLogic) Handler(req *dto.SubscribeRequest) (resp *dto.SubscribeResponse, err error)

Jump to

Keyboard shortcuts

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