slackclient

package
v0.8.10 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package slackclient posts bounded text messages to Slack incoming webhooks. It deliberately owns neither webhook configuration nor secret resolution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeliveryError

func NewDeliveryError(kind DeliveryErrorKind, code string, cause error) error

Types

type Client

type Client interface {
	SendWebhook(context.Context, string, Message) (Receipt, error)
}

func New

func New(options Options) (Client, error)

type DeliveryError

type DeliveryError struct {
	Kind DeliveryErrorKind
	Code string
	// contains filtered or unexported fields
}

func (*DeliveryError) Error

func (e *DeliveryError) Error() string

func (*DeliveryError) Unwrap

func (e *DeliveryError) Unwrap() error

type DeliveryErrorKind

type DeliveryErrorKind string
const (
	DeliveryTemporary DeliveryErrorKind = "temporary"
	DeliveryPermanent DeliveryErrorKind = "permanent"
	DeliveryAmbiguous DeliveryErrorKind = "ambiguous"
)

type HTTPClientFactory

type HTTPClientFactory func(safehttp.Policy) HTTPDoer

HTTPClientFactory is injectable for deterministic transport tests. The default creates a safehttp client using the policy supplied for each hook.

type HTTPDoer

type HTTPDoer interface {
	Do(*http.Request) (*http.Response, error)
}

type Message

type Message struct {
	Text string
}

type Options

type Options struct {
	Now               func() time.Time
	HTTPClientFactory HTTPClientFactory
}

type Receipt

type Receipt struct {
	AcceptedAt time.Time
}

Receipt records Slack's acceptance time. Incoming webhooks do not return a Slack message identifier.

Jump to

Keyboard shortcuts

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