cli

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthExpired = errors.New("authentication token expired")
	ErrRateLimited = errors.New("rate limited")
	ErrNotFound    = errors.New("resource not found")
	ErrForbidden   = errors.New("permission denied")
)

Functions

func FindLarkCLI

func FindLarkCLI(hint string) (string, error)

func JSONParam

func JSONParam(kv map[string]any) string

func ParseJSON

func ParseJSON[T any](data []byte) (T, error)

func ParseNDJSON

func ParseNDJSON[T any](data []byte) ([]T, error)

func StreamNDJSON

func StreamNDJSON[T any](r io.Reader, fn func(T) error) error

Types

type CLIError

type CLIError struct {
	ExitCode int
	Stderr   string
	Cmd      string
}

func (*CLIError) Error

func (e *CLIError) Error() string

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

func NewExecutor

func NewExecutor(binaryPath string) (*Executor, error)

func (*Executor) Path

func (e *Executor) Path() string

func (*Executor) Run

func (e *Executor) Run(ctx context.Context, args ...string) ([]byte, error)

func (*Executor) RunJSON

func (e *Executor) RunJSON(ctx context.Context, args ...string) ([]byte, error)

func (*Executor) SetMiddleware

func (e *Executor) SetMiddleware(mw RunMiddleware)

type RunMiddleware

type RunMiddleware func(ctx context.Context, fn func() ([]byte, error)) ([]byte, error)

Jump to

Keyboard shortcuts

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