util

package
v2.0.0-...-9eb79f6 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAPIURL  = "https://asciinema.org"
	DefaultCommand = "/bin/sh"
)

Variables

This section is empty.

Functions

func BeQuiet

func BeQuiet()

func Copy

func Copy(dst io.Writer, src *os.File) func()

func FD_ISSET

func FD_ISSET(p *syscall.FdSet, fd int) bool

func FD_SET

func FD_SET(p *syscall.FdSet, fd int)

func FirstNonBlank

func FirstNonBlank(candidates ...string) string

func GetLocaleCharset

func GetLocaleCharset(env map[string]string) string

func IsUtf8Locale

func IsUtf8Locale(env map[string]string) bool

func Printf

func Printf(s string, args ...interface{})

func ReadLine

func ReadLine() string

func ReplaceWarningf

func ReplaceWarningf(s string, args ...interface{})

func Select

func Select(nfd int, r *syscall.FdSet, w *syscall.FdSet, e *syscall.FdSet, timeout *syscall.Timeval) error

func Warningf

func Warningf(s string, args ...interface{})

func WithSpinner

func WithSpinner(delay int, f func())

Types

type Config

type Config struct {
	File *ConfigFile
	Env  map[string]string
}

func GetConfig

func GetConfig(env map[string]string) (*Config, error)

func (*Config) ApiToken

func (c *Config) ApiToken() string

func (*Config) ApiUrl

func (c *Config) ApiUrl() string

func (*Config) PlayMaxWait

func (c *Config) PlayMaxWait() float64

func (*Config) RecordCommand

func (c *Config) RecordCommand() string

func (*Config) RecordMaxWait

func (c *Config) RecordMaxWait() float64

func (*Config) RecordYes

func (c *Config) RecordYes() bool

type ConfigAPI

type ConfigAPI struct {
	Token string
	URL   string
}

type ConfigFile

type ConfigFile struct {
	API    ConfigAPI
	Record ConfigRecord
	Play   ConfigPlay
	User   ConfigUser // old location of token
}

type ConfigPlay

type ConfigPlay struct {
	MaxWait float64
}

type ConfigRecord

type ConfigRecord struct {
	Command string
	MaxWait float64
	Yes     bool
}

type ConfigUser

type ConfigUser struct {
	Token string
}

type UUID

type UUID [16]byte

func NewUUID

func NewUUID() *UUID

create a new uuid v4

func (*UUID) String

func (u *UUID) String() string

Jump to

Keyboard shortcuts

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