ui

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Agreed = true
View Source
var Disagreed = false
View Source
var Extract = false
View Source
var LicenseAgreed *bool

Functions

func DisplayAndWaitForEULA

func DisplayAndWaitForEULA(licenseTitle, licenseContents string) (bool, error)

DisplayAndWaitForEULA prints out the license to the user through a UI and waits for user confirmation.

Types

type LicenseWindowType

type LicenseWindowType struct {
	// LayoutManager is a function that defines the elements in the ui
	LayoutManager func(g *gocui.Gui) error

	Scroll   func(v *gocui.View, dy int) error
	ScrollUp func(g *gocui.Gui, v *gocui.View) error

	ScrollDown func(g *gocui.Gui, v *gocui.View) error

	Agree func(g *gocui.Gui, v *gocui.View) error

	Disagree func(g *gocui.Gui, v *gocui.View) error

	Extract func(g *gocui.Gui, v *gocui.View) error

	Gui *gocui.Gui
}

LicenseWindowType defines the struct to handle UI

func NewLicenseWindow

func NewLicenseWindow(licenseTitle, licenseContents, promptText string) *LicenseWindowType

func (*LicenseWindowType) PromptUser

func (l *LicenseWindowType) PromptUser() (bool, error)

func (*LicenseWindowType) Setup

func (l *LicenseWindowType) Setup() error

Jump to

Keyboard shortcuts

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