opts

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Overview

Package opts provides default option configuration used internally for configuration dispatching.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is an interface for setting options on configuration objects.

type OptionFunc

type OptionFunc func(*Options)

type Options

type Options struct {
	// OutputDir is the directory where generated output will be written.
	OutputDir string

	// RootDir is the root directory which all configuration paths will be
	// considered relative to.
	RootDir string
}

Options is the configuration for options provided to the reader for configurations.

func (*Options) Apply

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

func (*Options) OutputPath

func (o *Options) OutputPath(path string) (string, error)

OutputPath returns the absolute path of the specified path relative to the output directory. If the path is already absolute, it will be returned as is. If the output directory is not set, the current working directory will be used.

func (*Options) RootPath

func (o *Options) RootPath(path string) (string, error)

RootPath returns the absolute path of the specified path relative to the root directory. If the path is already absolute, it will be returned as is. If the root directory is not set, the current working directory will be used.

Jump to

Keyboard shortcuts

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