transports

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidTransportDSN is returned when the Transport's DSN is invalid.
	ErrInvalidTransportDSN = errors.New("invalid transport DSN")
	// ErrClosedTransport is returned by the Transport's Dispatch and AddSubscriber methods after a call to Close.
	ErrClosedTransport = errors.New("hub: read/write on closed Transport")
)

Functions

This section is empty.

Types

type BoltTransport

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

BoltTransport implements the TransportInterface using the Bolt database.

func NewBoltTransport

func NewBoltTransport(u *url.URL) (*BoltTransport, error)

NewBoltTransport create a new BoltTransport.

func (*BoltTransport) Count

func (b *BoltTransport) Count() (int64, error)

func (*BoltTransport) Get

func (b *BoltTransport) Get(id string) (string, error)

func (*BoltTransport) Put

func (b *BoltTransport) Put(id string, url string) error

type RedisTransport

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

RedisTransport implements the TransportInterface using the Bolt database.

func NewRedisTransport

func NewRedisTransport(u *url.URL) (*RedisTransport, error)

NewBoltTransport create a new RedisTransport.

func (*RedisTransport) Count

func (r *RedisTransport) Count() (int64, error)

func (*RedisTransport) Get

func (r *RedisTransport) Get(id string) (string, error)

func (*RedisTransport) Put

func (r *RedisTransport) Put(id string, url string) error

type Transport

type Transport interface {
	Put(id string, url string) error
	Get(id string) (string, error)
	Count() (int64, error)
}

func NewTransport

func NewTransport(config *c.Config) (Transport, error)

NewTransport create a transport using the backend matching the given TransportURL.

Jump to

Keyboard shortcuts

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