ma

package
v0.0.0-...-d093a13 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2015 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectionNames

func CollectionNames(params martini.Params, r render.Render)

func CollectionQuery

func CollectionQuery(params martini.Params, query Query, r render.Render)

func CollectionUpdate

func CollectionUpdate(params martini.Params, msg Msg, r render.Render)

func DatabaseNames

func DatabaseNames(r render.Render)

func DbClose

func DbClose()

func DbOpen

func DbOpen(ip string) (err error)

func LogDev

func LogDev()

func LogFile

func LogFile(file string)

func Path

func Path(m *martini.ClassicMartini, p string)

func SliceRemove

func SliceRemove(slice, element interface{})

Types

type Config

type Config struct {
	Address string
	Users   []User
	White   []string
}

func ConfigLoad

func ConfigLoad() (config Config)

func (*Config) Load

func (c *Config) Load(configFilePath string) error

func (*Config) Save

func (c *Config) Save(configFilePath string) error

type Msg

type Msg struct {
	Ok   bool        `json:"ok"`
	Err  string      `json:"err,omitempty"`
	Data interface{} `json:"data,omitempty"`
}

type Query

type Query struct {
	Db         string `json:"db,omitempty"`
	Collection string `json:"collection,omitempty"`
	// start 1
	Page int `json:"page,omitempty"`
	// page size
	Limit   int                    `json:"limit,omitempty"`
	Count   int                    `json:"count,omitempty"`
	Sorting []string               `json:"sorting,omitempty"`
	Filter  map[string]interface{} `json:"filter,omitempty"`
	Results []interface{}          `json:"results,omitempty"`
	Names   []string               `json:"names,omitempty"`
}

func (*Query) Run

func (q *Query) Run(db *mgo.Database) error

func (*Query) Skip

func (q *Query) Skip() int

func (*Query) Sort

func (q *Query) Sort(def string) string

type User

type User struct {
	Name     string
	Password string
}

Jump to

Keyboard shortcuts

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