options

package
v2.7.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package options manage options with default value from config.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Output
	Input  string `yaml:"-"`
	Output string `yaml:"-"`
	Author string `yaml:"-"`
	Title  string `yaml:"-"`

	// Config
	Profile                    string  `yaml:"profile"`
	Quality                    int     `yaml:"quality"`
	Grayscale                  bool    `yaml:"grayscale"`
	GrayscaleMode              int     `yaml:"grayscale_mode"` // 0 = normal, 1 = average, 2 = luminance
	Crop                       bool    `yaml:"crop"`
	CropRatioLeft              int     `yaml:"crop_ratio_left"`
	CropRatioUp                int     `yaml:"crop_ratio_up"`
	CropRatioRight             int     `yaml:"crop_ratio_right"`
	CropRatioBottom            int     `yaml:"crop_ratio_bottom"`
	CropLimit                  int     `yaml:"crop_limit"`
	CropSkipIfLimitReached     bool    `yaml:"crop_skip_if_limit_reached"`
	Brightness                 int     `yaml:"brightness"`
	Contrast                   int     `yaml:"contrast"`
	AutoContrast               bool    `yaml:"auto_contrast"`
	AutoRotate                 bool    `yaml:"auto_rotate"`
	AutoSplitDoublePage        bool    `yaml:"auto_split_double_page"`
	KeepDoublePageIfSplit      bool    `yaml:"keep_double_page_if_split"`
	KeepSplitDoublePageAspect  bool    `yaml:"keep_split_double_page_aspect"`
	NoBlankImage               bool    `yaml:"no_blank_image"`
	Manga                      bool    `yaml:"manga"`
	HasCover                   bool    `yaml:"has_cover"`
	LimitMb                    int     `yaml:"limit_mb"`
	StripFirstDirectoryFromToc bool    `yaml:"strip_first_directory_from_toc"`
	SortPathMode               int     `yaml:"sort_path_mode"`
	ForegroundColor            string  `yaml:"foreground_color"`
	BackgroundColor            string  `yaml:"background_color"`
	NoResize                   bool    `yaml:"noresize"`
	Format                     string  `yaml:"format"`
	AspectRatio                float64 `yaml:"aspect_ratio"`
	PortraitOnly               bool    `yaml:"portrait_only"`
	AppleBookCompatibility     bool    `yaml:"apple_book_compatibility"`
	TitlePage                  int     `yaml:"title_page"`

	// Default Config
	Show  bool `yaml:"-"`
	Save  bool `yaml:"-"`
	Reset bool `yaml:"-"`

	// Shortcut
	Auto         bool `yaml:"-"`
	NoFilter     bool `yaml:"-"`
	MaxQuality   bool `yaml:"-"`
	BestQuality  bool `yaml:"-"`
	GreatQuality bool `yaml:"-"`
	GoodQuality  bool `yaml:"-"`

	// Other
	Workers    int  `yaml:"-"`
	Dry        bool `yaml:"-"`
	DryVerbose bool `yaml:"-"`
	Quiet      bool `yaml:"-"`
	Json       bool `yaml:"-"`
	Version    bool `yaml:"-"`
	Help       bool `yaml:"-"`
	// contains filtered or unexported fields
}

func New

func New() *Options

New Initialize default options.

func (*Options) AvailableProfiles

func (o *Options) AvailableProfiles() string

AvailableProfiles all available profiles

func (*Options) FileName

func (o *Options) FileName() string

FileName Config file: ~/.go-comic-converter.yaml

func (*Options) GetProfile

func (o *Options) GetProfile() *profiles.Profile

GetProfile shortcut to get current profile

func (*Options) Header

func (o *Options) Header() string

func (*Options) LoadConfig added in v2.3.1

func (o *Options) LoadConfig() error

LoadConfig Load config files

func (*Options) MarshalJSON added in v2.6.8

func (o *Options) MarshalJSON() ([]byte, error)

func (*Options) ResetConfig added in v2.3.1

func (o *Options) ResetConfig() error

ResetConfig reset all settings to default value

func (*Options) SaveConfig added in v2.3.1

func (o *Options) SaveConfig() error

SaveConfig save all current settings as default value

func (*Options) ShowConfig added in v2.3.1

func (o *Options) ShowConfig() string

ShowConfig Get current settings for fields that can be saved

func (*Options) String

func (o *Options) String() string

Jump to

Keyboard shortcuts

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