lib

package
v0.0.0-...-2cfa979 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StatusBoldBlue            = color.New(color.Bold, color.FgBlue).PrintlnFunc()
	StatusGood                = color.New(color.Bold, color.FgCyan).PrintlnFunc()
	StatusBoldYellow          = color.New(color.Bold, color.FgYellow).PrintlnFunc()
	StatusBoldYellowNoNewline = color.New(color.Bold, color.FgYellow).PrintfFunc()
)

Functions

func ExecuteTaskLocal

func ExecuteTaskLocal(prefix, taskId string, l *zap.Logger, task taskdef.TaskDefinition, opts TaskLocalOpts, taskState taskstate.TaskState) error

Executes a task locally

func OpenDefault

func OpenDefault(fileOrURL string) error

From https://github.com/icza/gox/blob/master/osx/osx.go

OpenDefault opens the specified file or URL with the default associated application.

You may use it to open a web site:

OpenDefault("https://google.com")

Or open a file:

OpenDefault("/home/bob/story.txt")

Or open a folder in your default file manager:

OpenDefault("/home/bob")

For details, see https://stackoverflow.com/a/39324149/1705598

func UserInput

func UserInput(prompt string) string

func UserInputBoolean

func UserInputBoolean(prompt string) bool

Types

type LocalMutLogger

type LocalMutLogger struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewLocalTaskLogger

func NewLocalTaskLogger(taskId string, l *zap.Logger) (*zap.Logger, *LocalMutLogger)

func (*LocalMutLogger) Sync

func (m *LocalMutLogger) Sync() error

func (*LocalMutLogger) Write

func (m *LocalMutLogger) Write(p []byte) (n int, err error)

type TaskLocalOpts

type TaskLocalOpts struct {
	OnStateChange func(state string) error
}

type TaskProgress

type TaskProgress struct{}

func (TaskProgress) GetProgress

func (ts TaskProgress) GetProgress() (*taskstate.Progress, error)

func (TaskProgress) SetProgress

func (ts TaskProgress) SetProgress(prog *taskstate.Progress) error

type TaskState

type TaskState struct {
	HttpTransport *http.Transport
	DiscordSess   *discordgo.Session
	BotUser       *discordgo.User
	DebugInfoData *debug.BuildInfo
	ContextUse    context.Context
}

Implementor of tasks.TaskState

func (TaskState) Context

func (ts TaskState) Context() context.Context

func (TaskState) DebugInfo

func (ts TaskState) DebugInfo() *debug.BuildInfo

func (TaskState) Discord

func (ts TaskState) Discord() (*discordgo.Session, *discordgo.User, bool)

func (TaskState) OperationMode

func (TaskState) OperationMode() string

func (TaskState) Transport

func (ts TaskState) Transport() *http.Transport

Jump to

Keyboard shortcuts

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