store

package
v0.0.0-...-768eb72 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2018 License: AGPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateStream

func CreateStream(c context.Context, name string, s *stream.Stream) (err error)

CreateStream creates a stream using the store on the current context, it returns an error if the stream already exists.

func DeleteStream

func DeleteStream(c context.Context, name string) (err error)

DeleteStream deletes the stream with the specific name using the current context store.

func GetStream

func GetStream(c context.Context, name string) (s *stream.Stream, err error)

GetStream returns the stream with the specific name using the current context store.

func ListStreams

func ListStreams(c context.Context, pageNum, pageSize int) (s []*stream.Stream, err error)

ListStreams lists pages streams from the current context store.

func StreamMiddleware

func StreamMiddleware(c context.Context, s StreamStore) context.Context

StreamMiddleware appends the provided StreamStore to the request context.

func UpdateStream

func UpdateStream(c context.Context, name string, s *stream.Stream) (err error)

UpdateStream saves the provided stream, and returns an error if no stream with the given name exists.

Types

type AlreadyExistsError

type AlreadyExistsError struct {
	Kind   string
	Entity string
}

AlreadyExistsError is returned when an Entity name is already taken.

func (*AlreadyExistsError) Error

func (err *AlreadyExistsError) Error() string

Error message for AlreadyExistsError, implements error interface.

type CorruptDataError

type CorruptDataError struct {
	Kind string
}

CorruptDataError is returned when data at a key has invalid schema.

func (*CorruptDataError) Error

func (err *CorruptDataError) Error() string

Error message for CorruptDataError, implements error interface.

type NoneFoundError

type NoneFoundError struct {
	Kind string
}

NoneFoundError is returned when a list request on a Kind returns no entities.

func (*NoneFoundError) Error

func (err *NoneFoundError) Error() string

Error message for NoneFoundError, implements error interface.

type NotFoundError

type NotFoundError struct {
	Kind   string
	Entity string
}

NotFoundError is returned when the requested Entity is not in the data store.

func (*NotFoundError) Error

func (err *NotFoundError) Error() string

Error message for NotFoundErrors, implements error interface.

type StreamStore

type StreamStore interface {
	CreateStream(name string, s *stream.Stream) (err error)
	GetStream(name string) (s *stream.Stream, err error)
	DeleteStream(name string) (err error)
	ListStreams(pageNum, pageSize int) (s []*stream.Stream, err error)
	UpdateStream(name string, s *stream.Stream) (err error)
}

StreamStore defines the methods required to store and retrieve streams.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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