MCPcopy Create free account
hub / github.com/LeoninCS/DevDesk / NewHTMLHostService

Function NewHTMLHostService

backend/internal/service/HtmlHost.go:30–46  ·  view source on GitHub ↗
(cfg HTMLHostConfig)

Source from the content-addressed store, hash-verified

28}
29
30func NewHTMLHostService(cfg HTMLHostConfig) (*HTMLHostService, error) {
31 if cfg.BaseDir == "" {
32 cfg.BaseDir = "hosted_html"
33 }
34 if cfg.MaxSizeBytes <= 0 {
35 cfg.MaxSizeBytes = DefaultMaxHTMLSize
36 }
37
38 if err := os.MkdirAll(cfg.BaseDir, 0o755); err != nil {
39 return nil, err
40 }
41
42 return &HTMLHostService{
43 baseDir: cfg.BaseDir,
44 maxSize: cfg.MaxSizeBytes,
45 }, nil
46}
47
48func (s *HTMLHostService) BaseDir() string {
49 return s.baseDir

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected