import "github.com/cognusion/go-zulipsend"

Package files



var (
    // DebugOut is a log.Logger that gets debug output. Hook it up to get output
    DebugOut = log.New(ioutil.Discard, "[DEBUG]", log.Lshortfile)

type Zulip

type Zulip struct {
    BaseURL  string
    Username string
    Token    string
    Retries  int           // Number of times to retry sending a message (disabled with 0)
    Interval time.Duration // Interval between retries

Zulip is a struct to enable repeatable transmissions to a Zulip instance

func (*Zulip) Send

func (z *Zulip) Send(stream, topic, message string) (err error)

Send a message to Zulip, possibly retrying if Interval > 0

func (*Zulip) ToWriter

func (z *Zulip) ToWriter(stream, topic string) io.Writer

ToWriter returns an io.Writer (zulip.Writer) suitable of being pumped into a log.New or anywhere else you can use an io.Writer


View Github