cli

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cli

type Cli struct {
	Config    *conf.Config
	Client    *stor.Client
	Formatter Formatter
	In        *In
	Out       *Out
}

func New

func New(
	config *conf.Config,
	client *stor.Client,
	formatter Formatter,
	out, err io.Writer,
) *Cli

type Formatter

type Formatter interface {
	FormatBytes(bytes int64) string
}

func DefaultFormatter

func DefaultFormatter() Formatter

func HumanFormatter

func HumanFormatter() Formatter

type In

type In struct{}

func (*In) IsStorUri

func (i *In) IsStorUri(v string) bool

IsStorUri determines if the given string is a STOR uri.

func (*In) ParseStorUri

func (i *In) ParseStorUri(v string) (string, string, error)

ParseStorUri tries to parse the given string. If IsStorUri returns true for the string, then ParseStorUri will also succeed on the same input.

type Out

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

func (*Out) Errorf

func (o *Out) Errorf(format string, a ...any)

func (*Out) FailAndExit

func (o *Out) FailAndExit(err error)

func (*Out) FailAndExitf

func (o *Out) FailAndExitf(format string, a ...any)

func (*Out) NewTabWriter

func (o *Out) NewTabWriter() *TabWriter

func (*Out) Printf

func (o *Out) Printf(format string, a ...any)

func (*Out) Println

func (o *Out) Println(a ...any)

type TabWriter

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

func (*TabWriter) Flush

func (w *TabWriter) Flush()

func (*TabWriter) Writeln

func (w *TabWriter) Writeln(a ...string)

Jump to

Keyboard shortcuts

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