mongo

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

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

Log is event log fetched from backing mongo database

func NewLog

func NewLog(url string) (*Log, error)

NewLog creates event log from backing mongo database

func NewLogWithCollection

func NewLogWithCollection(url, collection string) (*Log, error)

NewLogWithCollection creates event log from backing mongo database

func (*Log) Append

func (m *Log) Append(event eventlog.Event) (string, error)

Append appends Event to event log and returns its ID.

func (*Log) Clear

func (m *Log) Clear(id string) error

Clear is a method for clearing entire state of event log

func (*Log) Connect

func (m *Log) Connect() error

Connect establishes a session to the mongo cluster.

func (*Log) Read

func (m *Log) Read() ([]eventlog.Event, error)

Read reads all events in event log.

func (*Log) ReadFrom

func (m *Log) ReadFrom(id string) ([]eventlog.Event, error)

ReadFrom reads all events from the log starting at event with specified id (excluded). If id is not found behaves like Read().

func (*Log) ReadSingle

func (m *Log) ReadSingle(module, version string) (eventlog.Event, error)

ReadSingle gets the module metadata about the given module/version. If something went wrong doing the get operation, returns a non-nil error.

type Registry

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

Registry is a pointer registry for olypus server event logs

func NewRegistry

func NewRegistry(url string) (*Registry, error)

NewRegistry creates a pointer registry from backing mongo database

func NewRegistryWithCollection

func NewRegistryWithCollection(url, collection string) (*Registry, error)

NewRegistryWithCollection creates a registry using the collection provided

func (*Registry) Connect

func (r *Registry) Connect() error

Connect establishes a session with the mongo cluster

func (*Registry) LookupPointer

func (r *Registry) LookupPointer(deploymentID string) (string, error)

LookupPointer returns the pointer to the given deploymentID eventlog

func (*Registry) SetPointer

func (r *Registry) SetPointer(deploymentID, pointer string) error

SetPointer both sets and updates a pointer for a given deploymentID eventlog

Jump to

Keyboard shortcuts

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