Documentation
¶
Overview ¶
Package format provides formatting functions for different output format types.
Index ¶
- Variables
- func NVL(s string, rest ...string) string
- type CSV
- func (c *CSV) Channels(ctx context.Context, w io.Writer, u []slack.User, chans []slack.Channel) error
- func (c *CSV) Conversation(ctx context.Context, w io.Writer, u []slack.User, conv *types.Conversation) error
- func (c CSV) Extension() string
- func (c *CSV) Users(ctx context.Context, w io.Writer, users []slack.User) error
- type Formatter
- type JSON
- func (j JSON) Channels(ctx context.Context, w io.Writer, u []slack.User, chans []slack.Channel) error
- func (j JSON) Conversation(ctx context.Context, w io.Writer, u []slack.User, conv *types.Conversation) error
- func (j JSON) Extension() string
- func (j JSON) Users(ctx context.Context, w io.Writer, u []slack.User) error
- type Option
- type Text
- func (txt *Text) Channels(ctx context.Context, w io.Writer, u []slack.User, cc []slack.Channel) error
- func (txt *Text) Conversation(ctx context.Context, w io.Writer, u []slack.User, conv *types.Conversation) error
- func (txt Text) Extension() string
- func (txt *Text) Users(ctx context.Context, w io.Writer, u []slack.User) error
- type Type
- type Types
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type CSV ¶
type CSV struct {
// contains filtered or unexported fields
}
func (*CSV) Conversation ¶
type Formatter ¶
type Formatter interface {
// Conversation writes the conversation to the writer.
Conversation(ctx context.Context, w io.Writer, u []slack.User, conv *types.Conversation) error
// Channels writes the channel list to the writer.
Channels(ctx context.Context, w io.Writer, u []slack.User, chans []slack.Channel) error
// Users writes the user list to the writer.
Users(ctx context.Context, w io.Writer, u []slack.User) error
// Extension returns the file extension for the formatter.
Extension() string
}
Formatter is a converter interface that each formatter must implement.
type JSON ¶
type JSON struct {
// contains filtered or unexported fields
}
JSON is the json formatter.
func (JSON) Conversation ¶
type Option ¶
type Option func(*options)
Option is the converter option.
func JSONIndent ¶
func JSONPrefix ¶
func TextNewMessageThreshold ¶
func WithBareFormat ¶
WithBareFormat allows to set the bare output format for the formatter that supports it.
type Text ¶
type Text struct {
// contains filtered or unexported fields
}
func (*Text) Conversation ¶
Click to show internal directories.
Click to hide internal directories.