Documentation ¶
Index ¶
- Variables
- func AllDocs(c *Clippan, args []string) error
- func CreateDB(c *Clippan, args []string) error
- func Databases(c *Clippan, args []string) error
- func DeleteDB(c *Clippan, args []string) error
- func Edit(c *Clippan, args []string) error
- func EditPut(c *Clippan, args []string, onlyEdit bool) error
- func Exit(c *Clippan, args []string) error
- func Get(c *Clippan, args []string) error
- func GetDocRaw(c *Clippan, id string) ([]byte, map[string]interface{}, error)
- func Help(c *Clippan, args []string) error
- func MatchDatabases(c *Clippan, patterns ...string) ([]string, []string, error)
- func MustMarshal(v interface{}) []byte
- func MustUnmarshal(raw []byte, target interface{})
- func Put(c *Clippan, args []string) error
- func Query(c *Clippan, args []string) error
- func UseDB(c *Clippan, args []string) error
- func ValidateJSON(data []byte) error
- type Clippan
- func (c *Clippan) Connect() error
- func (c *Clippan) Debug(format string, args ...interface{})
- func (c *Clippan) Error(format string, args ...interface{})
- func (c *Clippan) Executer(s string)
- func (c *Clippan) JSON(raw []byte)
- func (c *Clippan) Print(format string, args ...interface{})
- func (c *Clippan) Run(cmds string)
- func (c *Clippan) RunCmds(cmds string)
- func (c *Clippan) UseDB(db string) bool
- type Command
- type Editor
- type Flag
- type Printer
- type Prompt
- type Prompter
- type QueryResult
- type RealEditor
- type TextPrinter
Constants ¶
This section is empty.
Variables ¶
View Source
var Commands []*Command
View Source
var DatabaseDoesNotExist = errors.New("Database does not exist")
View Source
var DatabaseExists = errors.New("Database already exists")
View Source
var DocumentNotFoundError = errors.New("Document not found")
View Source
var NoDatabaseError = errors.New("Not connected to a database")
View Source
var UsageError = errors.New("Incorrect Usage")
Functions ¶
func AllDocs ¶
AllDocs simply returns what _all_docs returns, Will eventually support pagination and simple start/end filtering
func GetDocRaw ¶
GetDocRaw gets a document as raw bytes. It returns DocumentNotFoundError if not found, or any other error encountered
func MatchDatabases ¶
func MustMarshal ¶
func MustMarshal(v interface{}) []byte
func MustUnmarshal ¶
func MustUnmarshal(raw []byte, target interface{})
func ValidateJSON ¶
Types ¶
type Clippan ¶
type Clippan struct { // DI Printer Printer Editor Editor Prompt Prompter // contains filtered or unexported fields }
func NewClippan ¶
type Prompt ¶
type Prompt struct {
// contains filtered or unexported fields
}
type QueryResult ¶
type QueryResult struct { ID string `json:"id"` Key interface{} `json:"key"` Value interface{} `json:"value"` }
type RealEditor ¶
type RealEditor struct {
// contains filtered or unexported fields
}
Actually edit a file using a real editor and a tempfile
func NewRealEditor ¶
func NewRealEditor(editor string) *RealEditor
type TextPrinter ¶
type TextPrinter struct {
// contains filtered or unexported fields
}
func (*TextPrinter) Debug ¶
func (p *TextPrinter) Debug(format string, args ...interface{})
func (*TextPrinter) Error ¶
func (p *TextPrinter) Error(format string, args ...interface{})
func (*TextPrinter) JSON ¶
func (p *TextPrinter) JSON(raw []byte)
func (*TextPrinter) Print ¶
func (p *TextPrinter) Print(format string, args ...interface{})
Click to show internal directories.
Click to hide internal directories.