# README
cmddb
import "github.com/coralproject/shelf/cmd/xenia/cmddb"
Overview
Index
- Variables
- func GetCommands(db *db.DB) *cobra.Command
- type Collection
- type DBMeta
- type Field
- type Index
Package files
Variables
var (
// ErrCollectionExists is return when a collection to be
// created already exists.
ErrCollectionExists = errors.New("Collection already exists.")
)
func GetCommands
func GetCommands(db *db.DB) *cobra.Command
GetCommands returns the db commands.
type Collection
type Collection struct {
Name string `json:"name"`
Indexes []Index `json:"indexes"`
}
Collection is the container for a db collection definition.
type DBMeta
type DBMeta struct {
Cols []Collection `json:"collections"`
}
DBMeta is the container for all db objects.
type Field
type Field struct {
Name string `json:"name"`
Type int `json:"type"`
OtherType string `json:"other"`
}
Field is the container for a field definition.
type Index
type Index struct {
Name string `json:"name"`
IsUnique bool `json:"unique"`
Fields []Field `json:"fields"`
}
Index is the container for an index definition.
Generated by godoc2md
# Functions
GetCommands returns the db commands.
# Variables
ErrCollectionExists is return when a collection to be created already exists.
# Structs
Collection is the container for a db collection definition.
DBMeta is the container for all db objects.
Field is the container for a field definition.
Index is the container for an index definition.