service

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorCollectionAlreadyExists = errors.New("collection already exists")
View Source
var ErrorCollectionNotFound = errors.New("collection not found")
View Source
var ErrorInsertBadJson = errors.New("insert bad json")
View Source
var ErrorInsertConflict = errors.New("insert conflict")

Functions

func Acceptance

func Acceptance(a *biff.A, apiRequest func(method, path string) *apitest.Request)

func Save

func Save(response *apitest.Response, title, description string)

Save generates the MD of the tests.

Types

type JSON

type JSON = map[string]interface{}

type Service

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

func NewService

func NewService(db *database.Database) *Service

func (*Service) CreateCollection

func (s *Service) CreateCollection(name string) (*collection.Collection, error)

func (*Service) DeleteCollection

func (s *Service) DeleteCollection(name string) error

func (*Service) GetCollection

func (s *Service) GetCollection(name string) (*collection.Collection, error)

func (*Service) Insert

func (s *Service) Insert(name string, data io.Reader) error

func (*Service) ListCollections

func (s *Service) ListCollections() map[string]*collection.Collection

type Servicer

type Servicer interface {
	CreateCollection(name string) (*collection.Collection, error)
	GetCollection(name string) (*collection.Collection, error)
	ListCollections() map[string]*collection.Collection
	DeleteCollection(name string) error
}

Jump to

Keyboard shortcuts

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