config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package config manages the user configuration file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractJWTClaims

func ExtractJWTClaims(token string) (map[string]string, error)

ExtractJWTClaims extracts fields from JWT payload without verifying signature.

func Save

func Save(cfg *Config) error

Save writes config file.

Types

type Config

type Config struct {
	Token        string `json:"token"`
	DeviceID     string `json:"device_id"`
	SessionID    string `json:"session_id"`
	UserID       string `json:"user_id"`
	Language     string `json:"language"`
	ShowProgress bool   `json:"show_progress"`
}

Config holds user credentials and preferences.

func InitInteractive

func InitInteractive() (*Config, error)

InitInteractive runs an interactive prompt to create or update the config file.

func Load

func Load() (*Config, error)

Load reads config file.

Jump to

Keyboard shortcuts

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