redis

package
v0.0.0-...-d65df50 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2016 License: BSD-2-Clause Imports: 12 Imported by: 1

Documentation

Overview

Package redis provides a redis based schema provider and deployer

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deployer

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

Deployer implements a schema deployer to our schema redis server

func NewDeployer

func NewDeployer(net, addr string) Deployer

NewDeployer creates a new deployer for the given redis net/addr

func (Deployer) Deploy

func (d Deployer) Deploy(r io.Reader) error

Deploy deploys the data in reader r under the name name - if it is a valid schema. If it succeeds, it publishes a message to the provider's pubsub channel

func (Deployer) DeployUri

func (d Deployer) DeployUri(uri string) error

DeployUri wraps Deploy with a URI of a schema file, reads it and loads it. It currently supports only deployment from local files

TODO: Consider removing this completely

type Provider

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

Provider implements a schema provider with updates, based on a redis HASH storing all schemas, and a redis PUBSUB channel for updates

func NewProvider

func NewProvider(net, addr string) *Provider

NewProvider creates a new provider for a given redis server in net/addr

func (*Provider) Init

func (p *Provider) Init() error

Init connects to the redis server and reads all the schemas in its schemas HASH key.

func (*Provider) Schemas

func (p *Provider) Schemas() []*schema.Schema

Schemas returns a list of all the currently read schemas

func (*Provider) Stop

func (p *Provider) Stop()

Stop actually does nothing in this provider

func (*Provider) Updates

func (p *Provider) Updates() (<-chan *schema.Schema, error)

Updates registers to a pubsub redis channel on schema updates, and fires changed schemas into the returned channel

Jump to

Keyboard shortcuts

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