{"modulePath":"github.com/ozontech/file.d","version":"v0.88.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package http\n\n## Functions\n\n```go\nfunc Factory() (pipeline.AnyPlugin, pipeline.AnyConfig)\n```\n\n## Types\n\n```go\ntype AuthConfig struct {\n\t// \u003e @3@4@5@6\n\t// \u003e\n\t// \u003e Override default Authorization header\n\tHeader string `json:\"header\" default:\"Authorization\"` // *\n\n\t// \u003e @3@4@5@6\n\t// \u003e\n\t// \u003e AuthStrategy.Strategy describes strategy to use.\n\tStrategy  string `json:\"strategy\" default:\"disabled\" options:\"disabled|basic|bearer\"` // *\n\tStrategy_ AuthStrategy\n\t// \u003e @3@4@5@6\n\t// \u003e\n\t// \u003e AuthStrategy.Secrets describes secrets in key-value format.\n\t// \u003e If the `strategy` is basic, then the key is the login, the value is the password.\n\t// \u003e If the `strategy` is bearer, then the key is the name, the value is the Bearer token.\n\t// \u003e Key uses in the http_input_total metric.\n\tSecrets map[string]string `json:\"secrets\"` // *\n}\n```\n! config-params ^ config-params\n\n```go\ntype AuthStrategy byte\n```\n\n```go\nconst (\n\tStrategyDisabled AuthStrategy = iota\n\tStrategyBasic\n\tStrategyBearer\n)\n```\n\n```go\ntype CORSConfig struct {\n\tAllowedOrigins []string `json:\"allowed_origins\"`\n\tDefaultOrigin  string   `json:\"default_origin\"  default:\"*\"`\n\tAllowedHeaders []string `json:\"allowed_headers\"`\n\tExposedHeaders []string `json:\"exposed_headers\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype Config struct {\n\t// \u003e @3@4@5@6\n\t// \u003e\n\t// \u003e An address to listen to. Omit ip/host to listen all network interfaces. E.g. `:88`\n\tAddress string `json:\"address\" default:\":9200\"` // *\n\t// \u003e @3@4@5@6\n\t// \u003e\n\t// \u003e Which protocol to emulate.\n\tEmulateMode  string `json:\"emulate_mode\" default:\"no\" options:\"no|elasticsearch\"` // *\n\tEmulateMode_ EmulateMode\n\t// \u003e @3@4@5@6\n\t// \u003e\n\t// \u003e CA certificate in PEM encoding. This can be a path or the content of the certificate.\n\t// \u003e If both ca_cert and private_key are set, the server starts accepting connections in TLS mode.\n\tCACert string `json:\"ca_cert\" default:\"\"` // *\n\t// \u003e @3@4@5@6\n\t// \u003e\n\t// \u003e CA private key in PEM encoding. This can be a path or the content of the key.\n\t// \u003e If both ca_cert and private_key are set, the server starts accepting connections in TLS mode.\n\tPrivateKey string `json:\"private_key\" default:\"\"` // *\n\n\t// \u003e @3@4@5@6\n\t// \u003e\n\t// \u003e Auth config.\n\t// \u003e Disabled by default.\n\t// \u003e See AuthConfig for details.\n\t// \u003e You can use 'warn' log level for logging authorizations.\n\tAuth AuthConfig `json:\"auth\" child:\"true\"` // *\n\n\t// \u003e @3@4@5@6\n\t// \u003e\n\t// \u003e Meta params\n\t// \u003e\n\t// \u003e Add meta information to an event (look at Meta params)\n\t// \u003e Use [go-template](https://pkg.go.dev/text/template) syntax\n\t// \u003e\n\t// \u003e Example: ```user_agent: '{{ index (index .request.Header \"User-Agent\") 0}}'```\n\tMeta cfg.MetaTemplates `json:\"meta\"` // *\n\n\t// \u003e @3@4@5@6\n\t// \u003e\n\t// \u003e CORS config.\n\t// \u003e Allowed origins support only one wildcard symbol. `http://*.example.com` - valid, `http://*.example.*.com` - invalid.\n\t// \u003e See CORSConfig for details.\n\tCORS CORSConfig `json:\"cors\" child:\"true\"` // *\n}\n```\n! config-params ^ config-params\n\n```go\ntype EmulateMode byte\n```\n\n```go\nconst (\n\tEmulateModeNo EmulateMode = iota\n\tEmulateModeElasticSearch\n)\n```\n\n```go\ntype Plugin struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (p *Plugin) Commit(_ *pipeline.Event)\n```\n\n```go\nfunc (p *Plugin) PassEvent(_ *pipeline.Event) bool\n```\nPassEvent decides pass or discard event.\n\n```go\nfunc (p *Plugin) ServeHTTP(w http.ResponseWriter, r *http.Request)\n```\n\n```go\nfunc (p *Plugin) Start(config pipeline.AnyConfig, params *pipeline.InputPluginParams)\n```\n\n```go\nfunc (p *Plugin) Stop()\n```\n\n","path":"github.com/ozontech/file.d/plugin/input/http","name":"http","synopsis":"","isRedistributable":true}
