cli

package
v0.0.0-...-1d4c075 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2016 License: BSD-3-Clause Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const GistMaxSize = 195 * 1024 * 1024

Actual limit is likely ~200mb.

Variables

View Source
var ErrInvalidCommand = errors.New("invalid command")

Functions

func Register

func Register(cmd string, f interface{}, usage string) *command

func Run

func Run(name string, args []string) error

Types

type ErrAlreadyLogged

type ErrAlreadyLogged struct {
	Err error
}

func (ErrAlreadyLogged) Error

func (e ErrAlreadyLogged) Error() string

type File

type File struct {
	Content string `json:"content"`
}

type Gist

type Gist struct {
	URL         string          `json:"html_url,omitempty"`
	Description string          `json:"description"`
	Public      bool            `json:"public"`
	Files       map[string]File `json:"files"`
	Size        int
}

func (*Gist) AddFile

func (g *Gist) AddFile(name, content string)

func (*Gist) AddLocalFile

func (g *Gist) AddLocalFile(name, filepath string) error

func (*Gist) CreateTarball

func (g *Gist) CreateTarball() (path string, err error)

func (*Gist) Upload

func (g *Gist) Upload(log log15.Logger) error

type LogLine

type LogLine struct {
	Token   int
	Content []byte
}

type LogRing

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

func NewLogRing

func NewLogRing(capacity int) *LogRing

func (*LogRing) Add

func (r *LogRing) Add(l *LogLine)

func (*LogRing) Read

func (r *LogRing) Read() []*LogLine

Jump to

Keyboard shortcuts

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