config

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: GPL-3.0 Imports: 6 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 {
	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