handling

package
v0.0.0-...-117ffbb Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotPresented = errors.New("configuration for hook is not presented")

Functions

This section is empty.

Types

type CompilableConfig

type CompilableConfig interface {
	Compile(engine expression.Engine, global map[string]any) (map[string]any, error)
}

type Handler

type Handler interface {
	Handle(ctx context.Context) error
}

type HandlerOptions

type HandlerOptions = func(*HookHandler)

func WithArgs

func WithArgs(args []string) HandlerOptions

func WithCwd

func WithCwd(cwd string) HandlerOptions

func WithEnv

func WithEnv(env []string) HandlerOptions

func WithExpressionEngine

func WithExpressionEngine(engine expression.Engine) HandlerOptions

func WithFileSystem

func WithFileSystem(fs billy.Filesystem) HandlerOptions

func WithGlobalVars

func WithGlobalVars(globalVars map[string]any) HandlerOptions

func WithHooksConfig

func WithHooksConfig(configs *configuration.HooksConfig) HandlerOptions

func WithOutput

func WithOutput(output io.Writer) HandlerOptions

func WithRepository

func WithRepository(repo internal.Repository) HandlerOptions

func WithWorkersCount

func WithWorkersCount(workersCount uint) HandlerOptions

type HookHandler

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

func NewHookHandler

func NewHookHandler(hook string, options ...HandlerOptions) (*HookHandler, error)

func (*HookHandler) Handle

func (h *HookHandler) Handle(ctx context.Context) error

type Rule

type Rule = configuration.Rule

Jump to

Keyboard shortcuts

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