app

package
v0.0.0-...-65fd636 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToQueue

func AddToQueue(k string, v string, rClient *redis.Client)

func AllowedEvents

func AllowedEvents(e string) bool

func CheckQueue

func CheckQueue(k string, v string, rClient *redis.Client)

func Handler

func Handler()

func QueueComplited

func QueueComplited(k string, v string, rClient *redis.Client)

func QueueProcessor

func QueueProcessor(client *redis.Client)

func Start

func Start()

Types

type Config

type Config struct {
	RedisAddr string `env:"REDIS_ADDR" envDefault:"localhost:6379"`
	RedisPass string `env:"REDIS_PASS" envDefault:""`
	RedisDB   int    `env:"REDIS_DB" envDefault:"0"`
	AgentsSet string `env:"AGENTS_SET_NAME" envDefault:"agents"`
	QueueName string `env:"QUEUE_NAME" envDefault:"lecc"`
	AgentName string `env:"HOSTNAME"`
	Interval  int    `env:"INTERVAL" envDefault:"20"`
	Path      string `env:"WATCH_PATH"`
	Command   string `env:"COMMAND"`
	Image     string `env:"IMAGE"`
}

func (Config) CheckEvent

func (c Config) CheckEvent(watcher *fsnotify.Watcher, client *redis.Client)

func (*Config) Client

func (c *Config) Client() *redis.Client

Define Client Redis from config

func (Config) GenerateCmd

func (c Config) GenerateCmd() []string

func (*Config) MarshalConfig

func (c *Config) MarshalConfig() *Config

func (*Config) RegisterAgent

func (c *Config) RegisterAgent(rClient *redis.Client)

func (*Config) Walking

func (c *Config) Walking(watcher *fsnotify.Watcher)

Jump to

Keyboard shortcuts

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