lib

package
v0.0.0-...-792b534 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: AGPL-3.0 Imports: 20 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 ExecuteJobLocal

func ExecuteJobLocal(prefix, id string, l *zap.Logger, jobImpl interfaces.JobImpl, opts TaskLocalOpts, state jobstate.State) error

Executes a job 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 NewLocalLogger

func NewLocalLogger(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 Progress

type Progress struct{}

func (Progress) GetProgress

func (ts Progress) GetProgress() (*jobstate.Progress, error)

func (Progress) SetProgress

func (ts Progress) SetProgress(prog *jobstate.Progress) error

type State

type State struct {
	GuildId       string
	DiscordSess   *discordgo.Session
	BotUser       *discordgo.User
	DebugInfoData *debug.BuildInfo
	ContextUse    context.Context
}

Implementor of jobstate.State

func (State) Context

func (ts State) Context() context.Context

func (State) DebugInfo

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

func (State) Discord

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

func (State) GuildID

func (ts State) GuildID() string

func (State) OperationMode

func (State) OperationMode() string

func (State) Transport

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

type TaskLocalOpts

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

Jump to

Keyboard shortcuts

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