zulip

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: Unlicense Imports: 8 Imported by: 1

README

zulip

import "codeberg.org/mgkeller/go-zulipsend"

Overview

Index

Package files

zulip.go

Variables

var (
    // DebugOut is a log.Logger that gets debug output. Hook it up to get output
    DebugOut = log.New(io.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


Generated by godoc2md

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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