loader

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package loader provides on-demand access to Copilot custom instruction files from local directories and GitHub repositories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instruction

type Instruction struct {
	Source  string
	Path    string
	Content string
	URI     string
	ApplyTo []string // VS Code glob patterns; empty = applies everywhere
}

Instruction represents a single instruction file.

func FilterByFilePath added in v1.1.0

func FilterByFilePath(instructions []Instruction, filePath string) []Instruction

FilterByFilePath returns instructions applicable to the given file path. Instructions with an empty ApplyTo are always included (global rules). Reproducible: the order of returned instructions is stable (same as List order). If filePath is empty, all instructions are returned unchanged.

type Loader

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

Loader provides on-demand access to instruction files.

func New

func New(cfg *config.Config, gh *github.Client) *Loader

func (*Loader) ForceSync

func (l *Loader) ForceSync()

func (*Loader) Get

func (l *Loader) Get(uri string) (Instruction, bool)

func (*Loader) List

func (l *Loader) List() []Instruction

List returns all instructions, cached for cache.DefaultTTL.

func (*Loader) Start

func (l *Loader) Start(ctx context.Context)

func (*Loader) Stop

func (l *Loader) Stop()

Jump to

Keyboard shortcuts

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