local

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

README

local

Internal package local provides local file-based catalog source implementation.

local

import "github.com/agentstation/starmap/internal/sources/local"

Index

type Option

Option configures a local source.

type Option func(*Source)

func WithCatalog
func WithCatalog(catalog catalogs.Catalog) Option

WithCatalog sets a pre-loaded catalog to reuse. This allows reusing an already-merged catalog instead of loading again.

func WithCatalogPath
func WithCatalogPath(path string) Option

WithCatalogPath sets the catalog path.

type Source

Source loads a catalog from either a file path or embedded catalog.

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

func New
func New(opts ...Option) *Source

New creates a new local source.

func (*Source) Catalog
func (s *Source) Catalog() catalogs.Catalog

Catalog returns the catalog of this source.

func (*Source) Cleanup
func (s *Source) Cleanup() error

Cleanup releases any resources.

func (*Source) Dependencies
func (s *Source) Dependencies() []sources.Dependency

Dependencies returns the list of external dependencies. Local source has no external dependencies.

func (*Source) Fetch
func (s *Source) Fetch(_ context.Context, _ ...sources.Option) error

Fetch returns catalog data from configured source.

func (*Source) ID
func (s *Source) ID() sources.ID

ID returns the ID of this source.

func (*Source) IsOptional
func (s *Source) IsOptional() bool

IsOptional returns whether this source is optional. Local source is optional - we can fall back to embedded catalog.

func (*Source) Name
func (s *Source) Name() string

Name returns the human-friendly name of this source.

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Source)

Option configures a local source.

func WithCatalog added in v0.0.20

func WithCatalog(catalog catalogs.Catalog) Option

WithCatalog sets a pre-loaded catalog to reuse. This allows reusing an already-merged catalog instead of loading again.

func WithCatalogPath

func WithCatalogPath(path string) Option

WithCatalogPath sets the catalog path.

type Source

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

Source loads a catalog from either a file path or embedded catalog.

func New

func New(opts ...Option) *Source

New creates a new local source.

func (*Source) Catalog

func (s *Source) Catalog() catalogs.Catalog

Catalog returns the catalog of this source.

func (*Source) Cleanup

func (s *Source) Cleanup() error

Cleanup releases any resources.

func (*Source) Dependencies added in v0.0.17

func (s *Source) Dependencies() []sources.Dependency

Dependencies returns the list of external dependencies. Local source has no external dependencies.

func (*Source) Fetch

func (s *Source) Fetch(_ context.Context, _ ...sources.Option) error

Fetch returns catalog data from configured source.

func (*Source) ID added in v0.0.15

func (s *Source) ID() sources.ID

ID returns the ID of this source.

func (*Source) IsOptional added in v0.0.17

func (s *Source) IsOptional() bool

IsOptional returns whether this source is optional. Local source is optional - we can fall back to embedded catalog.

func (*Source) Name added in v0.0.17

func (s *Source) Name() string

Name returns the human-friendly name of this source.

Jump to

Keyboard shortcuts

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