mongodb

package
v0.0.0-...-a6ccfa7 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionCreate = "create"
	ActionUpdate = "update"
	ActionDelete = "delete"
	ActionInsert = "insert"
)

See http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/bulk.html

Variables

This section is empty.

Functions

This section is empty.

Types

type BulkRequest

type BulkRequest struct {
	Action     string
	Database   string
	Collection string
	ID         string
	Filter     map[string]interface{}
	Data       map[string]interface{}
}

type BulkResponse

type BulkResponse struct {
	Code   int
	Took   int  `json:"took"`
	Errors bool `json:"errors"`

	Items []map[string]*BulkResponseItem `json:"items"`
}

type BulkResponseItem

type BulkResponseItem struct {
	Database   string `json:"_index"`
	Collection string `json:"_type"`
	ID         string `json:"_id"`
	Status     int    `json:"status"`
	Found      bool   `json:"found"`
}

type Client

type Client struct {
	Addr     string
	Username string
	Password string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(conf *ClientConfig) *Client

func (*Client) Bulk

func (c *Client) Bulk(items []*BulkRequest) error

type ClientConfig

type ClientConfig struct {
	Addr     string
	Username string
	Password string
}

type Response

type Response struct {
	Code int
	ResponseItem
}

type ResponseItem

type ResponseItem struct {
	ID         string                 `json:"_id"`
	Database   string                 `json:"_index"`
	Collection string                 `json:"_type"`
	Found      bool                   `json:"found"`
	Source     map[string]interface{} `json:"_source"`
}

Jump to

Keyboard shortcuts

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