config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	REDIS_KEY_CONFIG = GetEnvs().REDIS_KEY + "config"
	REDIS_KEY_MODELS = GetEnvs().REDIS_KEY + "models"
	REDIS_KEY_ROUTES = GetEnvs().REDIS_KEY + "routes"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	System  *System  `json:"system"`
	Event   *Event   `json:"event"`
	Plugins []Plugin `json:"plugins"`
}

func GetConfig

func GetConfig() Config

type Envs

type Envs struct {
	REDIS_KEY    string `env:"PE_REDIS_KEY" envDefault:"pe:agent:"`
	LOCAL_CONFIG string `env:"PE_LOCAL_CONFIG" envDefault:"/etc/agent/config.json"`
	DEBUG_MODE   string `env:"PE_DEBUG_MODE" envDefault:"debug"`
}

func GetEnvs

func GetEnvs() Envs

type Event

type Event struct {
	MsgSize int `json:"msg_size"`
}

func GetEvent

func GetEvent() *Event

type GoroutinePool

type GoroutinePool struct {
	Size             int `json:"size"`
	ExpiryDuration   int `json:"expiry_duration"`
	MaxBlockingTasks int `json:"max_blocking_tasks"`
}

type Plugin

type Plugin struct {
	Name     string        `json:"name"`
	Package  string        `json:"package"`
	Version  string        `json:"version"`
	Enabled  bool          `json:"enabled"`
	Location string        `json:"location"`
	Config   *PluginConfig `json:"config,omitempty"`
}

func GetPlugins

func GetPlugins() []Plugin

type PluginConfig

type PluginConfig struct {
	Static  any `json:"static,omitempty"`
	Dynamic any `json:"dynamic,omitempty"`
}

type System

type System struct {
	GoroutinePool *GoroutinePool `json:"goroutine_pool"`
}

Jump to

Keyboard shortcuts

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