jiji

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 12 Imported by: 0

README

Go Reference

Introduction

Reliable messaging with persistent storage. Project name Jiji was named after the black cat in the anime film Kiki's Delivery Service produced by Studio Ghibli.

  • bbolt as persistent storage.
  • Only Kafka and HTTP are supported for now as messaging target.

Documentation

Check here for API document.

Documentation

Index

Constants

View Source
const (
	ContentTypeJSON = "application/json"
)
View Source
const (
	KAFKA_TIMEOUT_MS = 30000 // 30 seconds
)
View Source
const (
	SYNC_BUCKET = "sync"
)

Variables

View Source
var Retry = 5 * time.Second

retry interval

View Source
var Verbose = false

Functions

This section is empty.

Types

type Delivery

type Delivery struct {
	DBPath    string
	Send      chan interface{}
	Transport Transport
	// contains filtered or unexported fields
}

func NewDelivery added in v0.2.0

func NewDelivery(dbpath string, send chan interface{}, transport Transport) (d *Delivery)

func (*Delivery) Close

func (t *Delivery) Close()

func (*Delivery) Done

func (t *Delivery) Done() <-chan struct{}

func (*Delivery) Run

func (t *Delivery) Run() (err error)

type HTTP

type HTTP struct {
	Client *http.Client
	URL    string
	// contains filtered or unexported fields
}

func (*HTTP) Close

func (t *HTTP) Close()

func (*HTTP) Connect

func (t *HTTP) Connect() (err error)

func (*HTTP) Send

func (t *HTTP) Send(b []byte) (err error)

type Kafka

type Kafka struct {
	Brokers string
	Topic   string
	// contains filtered or unexported fields
}

func (*Kafka) Close

func (t *Kafka) Close()

func (*Kafka) Connect

func (t *Kafka) Connect() (err error)

func (*Kafka) Send

func (t *Kafka) Send(msg []byte) (err error)

type Print

type Print struct{}

func (Print) Close

func (t Print) Close()

func (Print) Connect

func (t Print) Connect() error

func (Print) Send

func (t Print) Send(data []byte) error

type StdLogger

type StdLogger interface {
	Print(...interface{})
	Printf(string, ...interface{})
	Println(...interface{})

	Fatal(...interface{})
	Fatalf(string, ...interface{})
	Fatalln(...interface{})

	Panic(...interface{})
	Panicf(string, ...interface{})
	Panicln(...interface{})
}

Compatible with standard package "log"

var Logger StdLogger

May be replaced by another logger

type Transport

type Transport interface {
	Connect() error
	Close()
	Send([]byte) error
}

Jump to

Keyboard shortcuts

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