config

package
v0.0.0-...-7fec016 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SyncModeAddOnly = "add-only"
	SyncModeDryRun  = "dry-run"
	SyncModeFull    = "full"
)

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 {
	CookieAtMain   *string  `koanf:"COOKIEATMAIN"`
	CookieUbidMain *string  `koanf:"COOKIEUBIDMAIN"`
	Lists          []string `koanf:"LISTS"`
}

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"`
	SkipHistory *bool   `koanf:"SKIPHISTORY"`
}

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