config

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port          int    `yaml:"port" json:"port"`
	Mode          string `yaml:"mode" json:"mode"`
	ProxyTarget   string `yaml:"proxy-target" json:"proxy-target"`
	Verbose       bool   `yaml:"verbose" json:"verbose"`
	AckStatus     int    `yaml:"ack-status" json:"ack-status"`
	FilterPath    string `yaml:"filter-path" json:"filter-path"`
	ExcludePath   string `yaml:"exclude-path" json:"exclude-path"`
	FilterMethod  string `yaml:"filter-method" json:"filter-method"`
	ExcludeMethod string `yaml:"exclude-method" json:"exclude-method"`
}

Config holds all configuration options for httpsink.

func LoadDefault

func LoadDefault() (*Config, string, error)

LoadDefault loads configuration from default locations. Returns nil if no config file is found (not an error).

func LoadFromFile

func LoadFromFile(filename string) (*Config, error)

LoadFromFile loads configuration from a specific file.

func (*Config) MergeWithFlags

func (c *Config) MergeWithFlags(flags *Config)

MergeWithFlags merges config with command-line flags. Flags take precedence over config file values.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the configuration is valid.

type RequestFilter

type RequestFilter struct {
	// contains filtered or unexported fields
}

RequestFilter filters incoming requests based on path and method patterns.

func NewRequestFilter

func NewRequestFilter(filterPath, excludePath, filterMethod, excludeMethod string) *RequestFilter

NewRequestFilter creates a new RequestFilter from comma-separated filter strings.

func (*RequestFilter) ShouldCapture

func (f *RequestFilter) ShouldCapture(r *http.Request) bool

ShouldCapture returns true if the request should be captured based on filter rules. Exclude rules take precedence over include rules.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL