From 6ced549deaecb42b9bb93ea9efcb4c1bbaabe8a4 Mon Sep 17 00:00:00 2001 From: mhsanaei Date: Sat, 20 Sep 2025 09:35:50 +0200 Subject: docs: add comments for all functions --- sub/subJsonService.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sub/subJsonService.go') diff --git a/sub/subJsonService.go b/sub/subJsonService.go index d55c7f81..f440ab65 100644 --- a/sub/subJsonService.go +++ b/sub/subJsonService.go @@ -17,6 +17,7 @@ import ( //go:embed default.json var defaultJson string +// SubJsonService handles JSON subscription configuration generation and management. type SubJsonService struct { configJson map[string]any defaultOutbounds []json_util.RawMessage @@ -28,6 +29,7 @@ type SubJsonService struct { SubService *SubService } +// NewSubJsonService creates a new JSON subscription service with the given configuration. func NewSubJsonService(fragment string, noises string, mux string, rules string, subService *SubService) *SubJsonService { var configJson map[string]any var defaultOutbounds []json_util.RawMessage @@ -67,6 +69,7 @@ func NewSubJsonService(fragment string, noises string, mux string, rules string, } } +// GetJson generates a JSON subscription configuration for the given subscription ID and host. func (s *SubJsonService) GetJson(subId string, host string) (string, string, error) { inbounds, err := s.SubService.getInboundsBySubId(subId) if err != nil || len(inbounds) == 0 { -- cgit v1.2.3