axon

package module
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2023 License: GPL-2.0 Imports: 6 Imported by: 8

README

Axon.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyStoreName          = errors.New("Sorry, you must provide a valid store name")
	ErrInvalidURL              = errors.New("Sorry, you must provide a valid store URL")
	ErrInvalidTlsConfiguration = errors.New("Sorry, you have provided an invalid tls configuration")
	ErrCloseConn               = errors.New("connection closed")
)

Functions

This section is empty.

Types

type Close added in v2.0.9

type Close func()

type Event

type Event interface {
	Ack()
	NAck()
	Message() *messages.Message
	Data() []byte
	Topic() string
}

type EventHandler

type EventHandler func() error

func (EventHandler) Run

func (f EventHandler) Run()

type EventStore

type EventStore interface {
	Publish(topic string, data []byte, opts ...options.PublisherOption) error
	Subscribe(topic string, handler SubscriptionHandler, opts ...options.SubscriptionOption) error
	Request(topic string, params []byte, opts ...options.PublisherOption) (*messages.Message, error)
	Reply(topic string, handler ReplyHandler, opts ...options.SubscriptionOption) error
	GetServiceName() string
	Run(ctx context.Context, handlers ...EventHandler)
	NewKVStore(opts ...options.KVOption) (KVStore, error)
	NewStreamer(opts ...options.StreamerOption) (Streamer, error)
	Close()
}

type KVStore

type KVStore interface {
	Get(key string) ([]byte, error)
	Set(key string, value []byte) error
	Del(key string) error
	Purge() error
	Watch(ctx context.Context, key string) (stream <-chan []byte, err error)
	Keys() []string
}

type ReplyHandler

type ReplyHandler func(mg *messages.Message) (*messages.Message, error)

type Send added in v2.0.9

type Send func(b []byte) error

type Stream added in v2.0.9

type Stream interface {
	ID() string
	Send(b []byte) error
	Recv() (<-chan []byte, error)
	Close()
	String() string
}

type StreamHandler added in v2.0.9

type StreamHandler func(Send, Close)

type StreamReceiver added in v2.0.9

type StreamReceiver interface {
	Recv(ctx context.Context) (<-chan []byte, error)
	Close()
}

type Streamer added in v2.0.9

type Streamer interface {
	Run()
	NewStream(handler StreamHandler) Stream
	JoinStream(id string) (Stream, error)
	Close()
}

type SubscriptionHandler

type SubscriptionHandler func(event Event)

Directories

Path Synopsis
_lab
Package codec is an interface for encoding messages
Package codec is an interface for encoding messages
bytes
Package bytes provides a bytes codec which does not encode or decode anything
Package bytes provides a bytes codec which does not encode or decode anything
msgpack
Package msgpack provides a msgpack codec
Package msgpack provides a msgpack codec
text
Package text reads any text/* content-type
Package text reads any text/* content-type
systems

Jump to

Keyboard shortcuts

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