json_store

package module
v0.0.0-...-61db446 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

README

json-store

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionCursor

type CollectionCursor interface {
	Next() (*pb.Collection, error)
	Close() error
}

type JSON

type JSON string

func (JSON) String

func (j JSON) String() string

type JSONCursor

type JSONCursor interface {
	Read() (JSON, error)
	Close() error
}

func JSONCursorFromIds

func JSONCursorFromIds(ids StringCursor, reader JSONReader) JSONCursor

type JSONReader

type JSONReader interface {
	Read(objectId string) (JSON, error)
}

type JSONReaderFunc

type JSONReaderFunc func(objectId string) (JSON, error)

func (JSONReaderFunc) Read

func (f JSONReaderFunc) Read(objectId string) (JSON, error)

type JSONWriter

type JSONWriter interface {
	Write(data JSON) error
}

type JSONWriterFunc

type JSONWriterFunc func(data JSON) error

func (JSONWriterFunc) Write

func (f JSONWriterFunc) Write(data JSON) error

type Repository

type Repository interface {
	SaveCollection(collectionId *pb.Collection) error

	GetCollection(collectionId string) (*pb.Collection, error)

	GetCollectionList() (CollectionCursor, error)

	DeleteCollection(collectionId string) error

	SaveObject(collectionId string, id string, object JSON) error

	PatchObject(collectionId string, objectId string, path string, data JSON) error

	GetObject(collectionId string, objectID string) (JSON, error)

	GetObjectList(collectionId string, offset uint32, count uint32) ([]JSON, error)

	DeleteObject(collectionId string, objectID string) error
}

type Service

type Service interface {
	CreateCollection(collection *pb.Collection) error
	GetCollection(collectionId string) (*pb.Collection, error)
	ListCollections() (CollectionCursor, error)
	DeleteCollection(collectionId string) error

	PutObject(collectionId string, data JSON) (string, error)
	PatchObject(collectionId string, objectId string, path string, data JSON) error
	MoveObject(collectionId string, objectID string, targetCollectionId string) error
	GetObject(collectionId string, objectId string) (JSON, error)
	GetObjects(collectionId string, objectsIds StringCursor) (JSONCursor, error)
	DeleteObject(collectionId string, objectId string) error
}

func NewService

func NewService(repository Repository) Service

type StringCursor

type StringCursor interface {
	Next() (string, error)
	Close() error
}

Directories

Path Synopsis
Package pb is a reverse proxy.
Package pb is a reverse proxy.

Jump to

Keyboard shortcuts

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