sourceloader

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadArchive

func DownloadArchive(repo string, commitHash string) (string, error)

func ExtractArchive

func ExtractArchive(archivePath string, destination string) error

func LoadSourceCmd

func LoadSourceCmd(source string, destination string) tea.Cmd

func RemoveOldTemplates

func RemoveOldTemplates(templatesPath string) error

func ShowProgress

func ShowProgress(sourceLoaderModelState SourceLoaderModelState) bool

func ShowSpinner

func ShowSpinner(sourceLoaderModelState SourceLoaderModelState) bool

Types

type SourceLoaderActiveSubModel

type SourceLoaderActiveSubModel string
const (
	SourceLoaderActiveSubModelSpinner  SourceLoaderActiveSubModel = "Spinner"
	SourceLoaderActiveSubModelProgress SourceLoaderActiveSubModel = "Progress"
)

func GetActiveSubModel

func GetActiveSubModel(sourceLoaderModelState SourceLoaderModelState) SourceLoaderActiveSubModel

type SourceLoaderFinishedMsg

type SourceLoaderFinishedMsg struct {
	Source      string
	Destination string
	ScfConfig   *scfconfig.ScfConfig
}

type SourceLoaderIncrementProgressMsg

type SourceLoaderIncrementProgressMsg struct {
	Increment float64
}

type SourceLoaderModel

type SourceLoaderModel struct {
	CurrentState  SourceLoaderModelState
	Source        string
	Destination   string
	ScfConfig     *scfconfig.ScfConfig
	Content       string
	Spinner       spinner.Model
	Progress      progress.Model
	ProgressWidth int
}

func NewSourceLoaderModel

func NewSourceLoaderModel(source string, destination string) *SourceLoaderModel

func (SourceLoaderModel) Init

func (m SourceLoaderModel) Init() tea.Cmd

func (SourceLoaderModel) Update

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

func (SourceLoaderModel) View

func (m SourceLoaderModel) View() string

type SourceLoaderModelState

type SourceLoaderModelState string
const (
	SourceLoaderModelStateLoading            SourceLoaderModelState = "Loading..."
	SourceLoaderModelStateDownloadingArchive SourceLoaderModelState = "Downloading Template..."
	SourceLoaderModelStateExtractingArchive  SourceLoaderModelState = "Extracting Template..."
	SourceLoaderModelStateLoadingPrompts     SourceLoaderModelState = "Loading Prompts..."
	SourceLoaderModelStateFinished           SourceLoaderModelState = "Finished"
)

type SourceLoaderResetProgressMsg

type SourceLoaderResetProgressMsg struct{}

type SourceLoaderSetModelStateMsg

type SourceLoaderSetModelStateMsg struct {
	State SourceLoaderModelState
}

Jump to

Keyboard shortcuts

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