config

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: GPL-3.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug   bool
	Testing bool

	Redis struct {
		Connection  string
		Connections []string
		Username    string
		Password    string
		Cluster     bool
		Failover    bool
		MasterName  string
		Concurrency int
	}

	Server struct {
		Enable bool
		BindIP string
		Port   string

		BodyLimit          int
		Concurrency        int
		ProxyHeader        string
		EnableIPValidation bool
		TrustProxy         bool
		TrustLoopback      bool
		TrustProxies       []string
		ReduceMemoryUsage  bool
		ServerHeader       string

		Limiter struct {
			MaxReqests           int
			PerDurationInSeconds int
			IgnoreFailedRequests bool
			UseRedis             bool
		}
	}

	Worker struct {
		Enable bool
	}

	Database struct {
		Enable     bool
		Connection string
	}

	Users []user.User

	Targets []target.Target
}

func Cfg

func Cfg() (Config, error)

func (*Config) GetApplication

func (cfg *Config) GetApplication(userKey string, token string) (application.Application, error)

func (*Config) GetTargetByID

func (cfg *Config) GetTargetByID(targetID string) (target.Target, error)

func (*Config) GetTargets added in v0.4.3

func (cfg *Config) GetTargets() ([]target.Target, error)

func (*Config) GetUserFromToken

func (cfg *Config) GetUserFromToken(token string) (user.User, error)

Jump to

Keyboard shortcuts

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