{"modulePath":"github.com/mutablelogic/go-server","version":"v1.0.48","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpserver\n\n## Constants\n\n```go\nconst (\n\tDefaultLabel   = \"httpserver\"\n\tDefaultTimeout = 10 * time.Second\n)\n```\n\n## Functions\n\n```go\nfunc NewWithConfig(c Config) (*httpserver, error)\n```\nCreate the server\n\n## Types\n\n```go\ntype Config struct {\n\tLabel   string        `hcl:\"label,label\"`\n\tRouter  Task          `hcl:\"router,optional\"`\n\tAddr    string        `hcl:\"listen,optional\"`  // Address or path for binding HTTP server\n\tTLS     *TLS          `hcl:\"tls,block\"`        // TLS parameters\n\tTimeout time.Duration `hcl:\"timeout,optional\"` // Read timeout on HTTP requests\n}\n```\n\n```go\nfunc (c Config) Name() string\n```\n\n```go\nfunc (c Config) New(ctx context.Context, provider Provider) (Task, error)\n```\nReturn a new task. Label for the task can be retrieved from context\n\n```go\ntype TLS struct {\n\tKey  string `hcl:\"key\"`  // Path to TLS Private Key\n\tCert string `hcl:\"cert\"` // Path to TLS Certificate\n}\n```\n\n","path":"github.com/mutablelogic/go-server/pkg/httpserver/_old","name":"httpserver","synopsis":"","isRedistributable":true}
