groveclient

package module
v0.0.0-...-88c9c8a Latest Latest
Warning

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

Go to latest
Published: May 31, 2017 License: MIT Imports: 6 Imported by: 0

README

Grove client

Go client library for interacting with Grove.

Usage

TODO

Contributions

Clone this repository into your GOPATH ($GOPATH/src/github.com/t11e/) and use Glide to install its dependencies.

brew install glide
go get github.com/t11e/go-groveclient
cd "$GOPATH"/src/github.com/t11e/go-groveclient
glide install --strip-vendor

You can then run the tests:

go test $(go list ./... | grep -v /vendor/)

There is no need to use go install as any project that requires this library can include it as a dependency like so:

cd my_other_project
glide get --strip-vendor github.com/t11e/go-groveclient

If you change any of the interfaces that have a mock in mocks/ directory be sure to execute go generate and check in the updated mock files.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(value bool) *bool

func Int

func Int(value int) *int

func Register

func Register(connector *pc.Connector)

Register registers us in a connector.

func String

func String(value string) *string

Types

type Client

type Client interface {
	Get(uid string, options GetOptions) (*PostItem, error)
	GetMany(uids []string, options GetManyOptions) (*GetManyOutput, error)
	Update(uid string, pu PostUpdate, options UpdateOptions) (*PostItem, error)
}

func New

func New(pebbleClient pc.Client) (Client, error)

type ConflictError

type ConflictError struct {
	UID string
}

func (ConflictError) Error

func (e ConflictError) Error() string

type DocumentAttributes

type DocumentAttributes map[string]interface{}

type GetManyOptions

type GetManyOptions struct {
	Limit *int
	Raw   *bool
}

type GetManyOutput

type GetManyOutput struct {
	Posts []PostItem `json:"posts"`
}

type GetOptions

type GetOptions struct {
	Raw *bool
}

type NoSuchPostError

type NoSuchPostError struct {
	UID string
}

func (NoSuchPostError) Error

func (e NoSuchPostError) Error() string

type Post

type Post struct {
	UID              pebble.UID       `json:"uid"`
	CreatedAt        time.Time        `json:"created_at"`
	UpdatedAt        time.Time        `json:"updated_at"`
	Document         *json.RawMessage `json:"document,omitempty"`
	ExternalDocument *json.RawMessage `json:"external_document,omitempty"`
	Sensitive        *json.RawMessage `json:"sensitive,omitempty"`
	Protected        *json.RawMessage `json:"protected,omitempty"`
	Tags             []string         `json:"tags"`
	Deleted          bool             `json:"deleted"`
	Published        bool             `json:"published"`
	ExternalID       string           `json:"external_id"`
	Version          int              `json:"version"`
}

func (*Post) GetDocument

func (post *Post) GetDocument() (DocumentAttributes, error)

func (*Post) GetExternalDocument

func (post *Post) GetExternalDocument() (DocumentAttributes, error)

func (*Post) GetProtected

func (post *Post) GetProtected() (DocumentAttributes, error)

func (*Post) GetSensitive

func (post *Post) GetSensitive() (DocumentAttributes, error)

type PostItem

type PostItem struct {
	Post *Post `json:"post"`
}

type PostUpdate

type PostUpdate struct {
	CreatedAt        *time.Time      `json:"created_at,omitempty"`
	UpdatedAt        *time.Time      `json:"updated_at,omitempty"`
	Document         json.RawMessage `json:"document,omitempty"`
	ExternalDocument json.RawMessage `json:"external_document,omitempty"`
	Sensitive        json.RawMessage `json:"sensitive,omitempty"`
	Protected        json.RawMessage `json:"protected,omitempty"`
	Tags             *[]string       `json:"tags,omitempty"`
	Deleted          *bool           `json:"deleted,omitempty"`
	Published        *bool           `json:"published,omitempty"`
	ExternalID       string          `json:"external_id,omitempty"`
	Version          int             `json:"version,omitempty"`
}

type UpdateOptions

type UpdateOptions struct {
	Merge      *bool   `json:"merge,omitempty"`
	ExternalID *string `json:"external_id,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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