plasma-go: github.com/openfresh/plasma-go Index | Examples | Files | Directories

package plasma_client

import "github.com/openfresh/plasma-go"

Index

Examples

Package Files

publisher.go redis.go

Constants

const TypeRedis = "redis"

type Publisher Uses

type Publisher interface {
    Publish(payload event.Payload) error
}

func New Uses

func New(config config.Config) (Publisher, error)

New returns a publisher by Config

Code:

config := config.Config{
    Type: plasma_client.TypeRedis,
}

client, err := plasma_client.New(config)
if err != nil {
    log.Fatal(err)
}

payload := event.Payload{
    Meta: event.MetaData{
        Type: "video:1234:views",
    },
    Data: json.RawMessage(`{"data":55301}`),
}
err = client.Publish(payload)
if err != nil {
    log.Fatal(err)
}

type Redis Uses

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

func (*Redis) Publish Uses

func (r *Redis) Publish(payload event.Payload) error

Publish sends payload to the redis channel

Directories

PathSynopsis
config
event

Package plasma_client imports 5 packages (graph). Updated 2017-12-30. Refresh now. Tools for package owners.