config

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IMDbAuthMethodCredentials = "credentials"
	IMDbAuthMethodCookies     = "cookies"
	IMDbAuthMethodNone        = "none"
	SyncModeAddOnly           = "add-only"
	SyncModeDryRun            = "dry-run"
	SyncModeFull              = "full"
	SyncTimeoutDefault        = time.Minute * 15
)

Variables

View Source
var (
	ErrUserAborted = errors.New("user aborted")
)

Functions

func NewTeaProgram

func NewTeaProgram(conf map[string]interface{}, opts ...tea.ProgramOption) *tea.Program

Types

type Config

type Config struct {
	IMDb  IMDb  `koanf:"IMDB"`
	Trakt Trakt `koanf:"TRAKT"`
	Sync  Sync  `koanf:"SYNC"`
	// contains filtered or unexported fields
}

func New

func New(path string, includeEnv bool) (*Config, error)

func NewFromMap

func NewFromMap(data map[string]interface{}) (*Config, error)

func (*Config) Flatten

func (c *Config) Flatten() map[string]interface{}

func (*Config) Validate

func (c *Config) Validate() error

func (*Config) WriteFile

func (c *Config) WriteFile(path string) error

type IMDb

type IMDb struct {
	Auth           *string   `koanf:"AUTH"`
	Email          *string   `koanf:"EMAIL"`
	Password       *string   `koanf:"PASSWORD"`
	CookieAtMain   *string   `koanf:"COOKIEATMAIN"`
	CookieUbidMain *string   `koanf:"COOKIEUBIDMAIN"`
	Lists          *[]string `koanf:"LISTS"`
	Trace          *bool     `koanf:"TRACE"`
	Headless       *bool     `koanf:"HEADLESS"`
	BrowserPath    *string   `koanf:"BROWSERPATH"`
}

type Model

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

func (*Model) Config

func (m *Model) Config() map[string]interface{}

func (*Model) Err

func (m *Model) Err() error

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Model) View

func (m *Model) View() string

type Sync

type Sync struct {
	Mode      *string        `koanf:"MODE"`
	History   *bool          `koanf:"HISTORY"`
	Ratings   *bool          `koanf:"RATINGS"`
	Watchlist *bool          `koanf:"WATCHLIST"`
	Lists     *bool          `koanf:"LISTS"`
	Timeout   *time.Duration `koanf:"TIMEOUT"`
}

type Trakt

type Trakt struct {
	Email        *string `koanf:"EMAIL"`
	Password     *string `koanf:"PASSWORD"`
	ClientID     *string `koanf:"CLIENTID"`
	ClientSecret *string `koanf:"CLIENTSECRET"`
}

Jump to

Keyboard shortcuts

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