save

package
v0.0.25 Latest Latest
Warning

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

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

Documentation

Overview

Package save provides options and utilities for saving catalogs in various formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format

type Format int

Format represents the output format for saving catalogs.

const (
	FormatJSON Format = iota
	FormatYAML
)

Format constants.

func (Format) IsValid

func (f Format) IsValid() bool

IsValid checks if the format is valid.

func (Format) String

func (f Format) String() string

String returns the string representation of the format.

type Option

type Option func(*Options)

Option is a function that configures save options.

func WithFormat

func WithFormat(f Format) Option

WithFormat for custom output format.

func WithPath

func WithPath(path string) Option

WithPath for filesystem saves.

func WithWriter

func WithWriter(w io.Writer) Option

WithWriter for custom outputs.

type Options

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

Options is the configuration for save.

func Defaults

func Defaults() *Options

Defaults returns the default save options.

func (*Options) Apply

func (s *Options) Apply(opts ...Option) Options

Apply applies the given options to the save options.

func (*Options) Format

func (s *Options) Format() Format

Format returns the format for the save options.

func (*Options) Path

func (s *Options) Path() string

Path returns the path for the save options.

func (*Options) Writer

func (s *Options) Writer() io.Writer

Writer returns the writer for the save options.

Jump to

Keyboard shortcuts

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