hook

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package hook provides access to hook message templates and the hook registry from embedded assets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Message

func Message(hook, filename string) ([]byte, error)

Message reads a hook message template by hook name and filename.

Parameters:

  • hook: Hook directory name (e.g., "qa-reminder")
  • filename: Template filename (e.g., "gate.txt")

Returns:

  • []byte: Template content from hooks/messages/<hook>/
  • error: Non-nil if the file is not found or read fails

func MessageList

func MessageList() ([]string, error)

MessageList returns available hook message directory names.

Each hook is a directory under hooks/messages/ containing one or more variant .txt template files.

Returns:

  • []string: List of hook directory names
  • error: Non-nil if directory read fails

func MessageRegistry

func MessageRegistry() ([]byte, error)

MessageRegistry reads the embedded registry.yaml that describes all hook message templates.

Returns:

  • []byte: Raw YAML content
  • error: Non-nil if the file is not found or read fails

func VariantList

func VariantList(hook string) ([]string, error)

VariantList returns available variant filenames for a hook.

Parameters:

  • hook: Hook directory name (e.g., "qa-reminder")

Returns:

  • []string: List of variant filenames (e.g., "gate.txt")
  • error: Non-nil if the hook directory is not found or read fails

Types

This section is empty.

Jump to

Keyboard shortcuts

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