executor

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MIT Imports: 11 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 {
	Rules []*Rule `yaml:"rules"`
}

func NewConfig

func NewConfig(configFilePath string) (*Config, error)

type Operation

type Operation string
const (
	AnyOperation    Operation = "ANY"
	CreateOperation Operation = "CREATE"
	WriteOperation  Operation = "WRITE"
	RemoveOperation Operation = "REMOVE"
	RenameOperation Operation = "RENAME"
	ChmodOperation  Operation = "CHMOD"
)

func (Operation) String

func (o Operation) String() string

type Rule

type Rule struct {
	Operation Operation `yaml:"operation"`
	Path      string    `yaml:"path"`
	Cmd       string    `yaml:"cmd"`
}

type RuleStorage

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

func NewRuleStorage

func NewRuleStorage() *RuleStorage

func (*RuleStorage) Add

func (s *RuleStorage) Add(path string, operation Operation, rule *Rule)

func (*RuleStorage) Contains

func (s *RuleStorage) Contains(path string, operation Operation) *Rule

Contains will fetch Rule by Path and Operation, but in case of AnyOperation other records will be ignored. AnyOperation has the highest priority in the search

type Service

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

func NewService

func NewService(cfg *Config) *Service

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

type Watcher

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

func NewWatcher

func NewWatcher() (*Watcher, error)

func (*Watcher) Add

func (w *Watcher) Add(rule *Rule) error

func (*Watcher) Close

func (w *Watcher) Close() error

func (*Watcher) Watch

func (w *Watcher) Watch() error

Jump to

Keyboard shortcuts

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