callback

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package callback is the workspace repository for callback definitions. Files live under `<workspace>/callbacks/<eventName>.yaml`, one file per event. The repository is a thin wrapper around base.Repository with a LoadAll convenience that returns every callback sorted by id.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	*base.Repository[callbackdef.Callback]
}

func New

func New(fs afs.Service) *Repository

New builds a repository reading from the workspace's filesystem layer.

func NewWithStore

func NewWithStore(store workspace.Store) *Repository

NewWithStore builds a repository reading from the workspace store abstraction.

func (*Repository) GetByEvent

func (r *Repository) GetByEvent(ctx context.Context, eventName string) (*callbackdef.Callback, error)

GetByEvent returns the callback whose id matches the provided eventName (case-insensitive). Returns nil without error when no match exists so callers can return a clean 404.

func (*Repository) LoadAll

func (r *Repository) LoadAll(ctx context.Context) ([]*callbackdef.Callback, error)

LoadAll returns every callback definition found under callbacks/, sorted by id. Callbacks that fail Validate are skipped with their names logged in the returned error chain rather than aborting the whole load.

Jump to

Keyboard shortcuts

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