dodo

package module
v0.0.0-...-102f297 Latest Latest
Warning

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

Go to latest
Published: May 13, 2019 License: MIT Imports: 4 Imported by: 0

README

Dodo Util

A tiny library for interfacing with a Dodo document store in Go!

Dodo document store is available here

Using Dodo Util

This can be installed just as any other Go dependency: go get github.com/danielwoodsdeveloper/dodo-util. Import it to your app: import ("danielwoodsdeveloper/dodo-util").

This gives you access to a number of easy-to-use functions:

  • Store(doc map[string]interface{})
  • Get(id string)
  • Modify(id string, doc map[string]interface{})
  • GetAll()
  • Delete(id string)
  • DeleteAll()

To set up the Dodo connection in the first place:

st := dodo.Settings{"http://localhost:6060", "", "", "", ""}
d, err := dodo.NewDodoConnection(st)
if err != nil {
    panic(err)
}

To Do

At the moment, Dodo document store supports authentication, but currently, Dodo Util does not.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dodo

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

func NewDodoConnection

func NewDodoConnection(st Settings) (*Dodo, error)

func (*Dodo) Delete

func (d *Dodo) Delete(id string) error

func (*Dodo) DeleteAll

func (d *Dodo) DeleteAll(id string) error

func (*Dodo) Get

func (d *Dodo) Get(id string) (map[string]interface{}, error)

func (*Dodo) GetAll

func (d *Dodo) GetAll() ([]map[string]interface{}, error)

func (*Dodo) Modify

func (d *Dodo) Modify(id string, doc map[string]interface{}) error

func (*Dodo) Store

func (d *Dodo) Store(doc map[string]interface{}) (string, error)

type Settings

type Settings struct {
	URL       string
	Username  string
	Password  string
	Salt      string
	JWTSecret string
}

Jump to

Keyboard shortcuts

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