mcporter

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mcporter wraps the mcporter tool with a pre-exec preflight that resolves `${VAR}` references in `~/.mcporter/mcporter.json` against a

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath() (string, error)

ConfigPath returns the resolved mcporter config path. Honors the `MCPORTER_CONFIG` env override; otherwise falls back to the well-known

func ResolveAll

func ResolveAll(r SecretResolver, names []string) (map[string]string, error)

ResolveAll fans out one Resolve call per name and collects results into a name->value map. Returns the first error encountered, naming

func ScanConfig

func ScanConfig(path string) ([]string, error)

ScanConfig reads the JSON file at path and returns every `${NAME}` reference found in string values, deduplicated and sorted. A missing

Types

type ResolverFunc

type ResolverFunc func(name string) (string, error)

ResolverFunc adapts a plain function to the SecretResolver interface. Useful for tests and for one-off in-process resolvers that don't need

func (ResolverFunc) Resolve

func (f ResolverFunc) Resolve(name string) (string, error)

Resolve calls the underlying function.

type SecretResolver

type SecretResolver interface {
	Resolve(name string) (string, error)
}

SecretResolver resolves one env-var name (e.g. "COILYSIREN_TAILNET_DOMAIN") to its plaintext value. Implementations decide how to map the name to a

func WithTTLCache

func WithTTLCache(inner SecretResolver, ttl time.Duration, persistPath string) SecretResolver

WithTTLCache wraps inner with an on-disk TTL cache persisted to a single JSON file at persistPath. Cache shape:

Jump to

Keyboard shortcuts

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