util

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2016 License: GPL-3.0 Imports: 13 Imported by: 60

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func BeQuiet added in v1.2.0

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 added in v1.0.0

func FirstNonBlank(candidates ...string) string

func GetLocaleCharset added in v1.0.0

func GetLocaleCharset(env map[string]string) string

func IsUtf8Locale added in v1.0.0

func IsUtf8Locale(env map[string]string) bool

func Printf

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

func ReadLine

func ReadLine() string

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 added in v1.2.0

func WithSpinner(delay int, f func())

Types

type Config

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

func GetConfig added in v1.0.0

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

func (*Config) ApiToken added in v1.0.0

func (c *Config) ApiToken() string

func (*Config) ApiUrl added in v1.0.0

func (c *Config) ApiUrl() string

func (*Config) PlayMaxWait added in v1.1.0

func (c *Config) PlayMaxWait() uint

func (*Config) RecordCommand added in v1.0.0

func (c *Config) RecordCommand() string

func (*Config) RecordMaxWait added in v1.0.0

func (c *Config) RecordMaxWait() uint

func (*Config) RecordYes added in v1.0.0

func (c *Config) RecordYes() bool

type ConfigAPI added in v1.0.0

type ConfigAPI struct {
	Token string
	URL   string
}

type ConfigFile added in v1.0.0

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

type ConfigPlay added in v1.1.0

type ConfigPlay struct {
	MaxWait uint
}

type ConfigRecord added in v1.0.0

type ConfigRecord struct {
	Command string
	MaxWait uint
	Yes     bool
}

type ConfigUser added in v1.0.0

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