diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-20 10:35:50 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-20 10:35:50 +0300 |
| commit | 6ced549deaecb42b9bb93ea9efcb4c1bbaabe8a4 (patch) | |
| tree | 28d8d82530476cf607e4d05ca189ae05868711e6 /sub/subJsonService.go | |
| parent | f60682a6b7cb749fee403c84e2587c3ad7e7ced0 (diff) | |
docs: add comments for all functions
Diffstat (limited to 'sub/subJsonService.go')
| -rw-r--r-- | sub/subJsonService.go | 3 |
1 files changed, 3 insertions, 0 deletions
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 { |
