curator

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package curator - Defines the type used to interact with leaps documents. The curator manages all documents, edit sessions, and any clean up duties. Uses dependency injected store and acl types for accessing documents and enforcing authentication/access control.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBinderNotFound = errors.New("binder was not found")
)

Errors for the Curator type.

Functions

This section is empty.

Types

type Config

type Config struct {
	BinderConfig binder.Config `json:"binder" yaml:"binder"`
}

Config - Holds configuration options for a curator.

func NewConfig

func NewConfig() Config

NewConfig - Returns a fully defined curator configuration with the default values for each field.

type Type

type Type interface {
	// EditDocument - Find and return a binder portal to an existing document
	EditDocument(userID, token, documentID string, timeout time.Duration) (binder.Portal, error)

	// ReadDocument - Find and return a binder portal to an existing document with read only
	// privileges
	ReadDocument(userID, token, documentID string, timeout time.Duration) (binder.Portal, error)

	// CreateDocument - Create and return a binder portal to a new document
	CreateDocument(
		userID, token string, document store.Document, timeout time.Duration,
	) (binder.Portal, error)

	// Kick a user from a document, needs the documentID and userID.
	KickUser(documentID, userID string, timeout time.Duration) error

	// Get the list of all users connected to all open binders.
	GetUsers(timeout time.Duration) (map[string][]string, error)

	// Close - Close the Curator
	Close()
}

Type - Provides thread safe implementations of basic document and session creation.

func New

func New(
	config Config,
	log log.Modular,
	stats metrics.Aggregator,
	auth acl.Authenticator,
	store store.Type,
) (Type, error)

New - Creates and returns a new curator, and launches its internal loop.

Jump to

Keyboard shortcuts

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