cmddb

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

README

cmddb

import "github.com/coralproject/shelf/cmd/xenia/cmddb"

Overview

Index

Package files

commands.go create.go

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCollectionExists is return when a collection to be
	// created already exists.
	ErrCollectionExists = errors.New("Collection already exists.")
)

Functions

func GetCommands

func GetCommands(db *db.DB) *cobra.Command

GetCommands returns the db commands.

Types

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.

Jump to

Keyboard shortcuts

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