Documentation
¶
Index ¶
- Variables
- func GenerateActionID() string
- func GenerateBlockID() string
- func GenerateID(prefix string) string
- type Actions
- type ActionsElement
- type ActionsOption
- type Block
- type Builder
- func (b *Builder) Add(block Block) *Builder
- func (b *Builder) AddActions(elements []ActionsElement, opts ...ActionsOption) *Builder
- func (b *Builder) AddContext(elements []ContextElement, opts ...ContextOption) *Builder
- func (b *Builder) AddDivider(opts ...DividerOption) *Builder
- func (b *Builder) AddHeader(text string, opts ...HeaderOption) *Builder
- func (b *Builder) AddImage(imageURL, altText string, opts ...ImageBlockOption) *Builder
- func (b *Builder) AddInput(label string, element InputElement, opts ...InputOption) *Builder
- func (b *Builder) AddSection(text TextObject, opts ...SectionOption) *Builder
- func (b *Builder) AddSectionWithFields(fields []TextObject, opts ...SectionOption) *Builder
- func (b *Builder) BlocksJSON() ([]byte, error)
- func (b *Builder) Build() ([]Block, error)
- func (b *Builder) Errors() []error
- func (b *Builder) HasErrors() bool
- func (b *Builder) JSON() ([]byte, error)
- func (b *Builder) MustBuild() []Block
- func (b *Builder) MustToHomeTab(opts ...HomeTabOption) HomeTab
- func (b *Builder) MustToMessage(fallbackText string, opts ...MessageOption) Message
- func (b *Builder) MustToModal(title string, opts ...ModalOption) Modal
- func (b *Builder) PrettyJSON() ([]byte, error)
- func (b *Builder) ToHomeTab(opts ...HomeTabOption) (HomeTab, error)
- func (b *Builder) ToMessage(fallbackText string, opts ...MessageOption) (Message, error)
- func (b *Builder) ToModal(title string, opts ...ModalOption) (Modal, error)
- type Button
- type ButtonOption
- type ButtonStyle
- type ChannelsSelect
- type ChannelsSelectOption
- func WithChannelsSelectActionID(id string) ChannelsSelectOption
- func WithChannelsSelectConfirm(confirm ConfirmDialog) ChannelsSelectOption
- func WithChannelsSelectFocusOnLoad() ChannelsSelectOption
- func WithChannelsSelectPlaceholder(text string) ChannelsSelectOption
- func WithChannelsSelectResponseURLEnabled() ChannelsSelectOption
- func WithInitialChannel(channelID string) ChannelsSelectOption
- type Checkboxes
- type CheckboxesOption
- type ConfirmDialog
- type ConfirmDialogOption
- type ConfirmStyle
- type Context
- type ContextActions
- type ContextActionsElement
- type ContextActionsOption
- type ContextElement
- type ContextOption
- type ConversationFilter
- type ConversationFilterOption
- type ConversationType
- type ConversationsSelect
- type ConversationsSelectOption
- func WithConversationsFilter(filter ConversationFilter) ConversationsSelectOption
- func WithConversationsSelectActionID(id string) ConversationsSelectOption
- func WithConversationsSelectConfirm(confirm ConfirmDialog) ConversationsSelectOption
- func WithConversationsSelectFocusOnLoad() ConversationsSelectOption
- func WithConversationsSelectPlaceholder(text string) ConversationsSelectOption
- func WithDefaultToCurrentConversation() ConversationsSelectOption
- func WithInitialConversation(conversationID string) ConversationsSelectOption
- func WithResponseURLEnabled() ConversationsSelectOption
- type DatePicker
- type DatePickerOption
- type DatetimePicker
- type DatetimePickerOption
- type DispatchActionConfig
- type Divider
- type DividerOption
- type EmailInput
- type EmailInputOption
- func WithEmailInputActionID(id string) EmailInputOption
- func WithEmailInputDispatchActionConfig(config DispatchActionConfig) EmailInputOption
- func WithEmailInputFocusOnLoad() EmailInputOption
- func WithEmailInputInitialValue(value string) EmailInputOption
- func WithEmailInputPlaceholder(text string) EmailInputOption
- type ExternalSelect
- type ExternalSelectOption
- func WithExternalSelectActionID(id string) ExternalSelectOption
- func WithExternalSelectConfirm(confirm ConfirmDialog) ExternalSelectOption
- func WithExternalSelectFocusOnLoad() ExternalSelectOption
- func WithExternalSelectInitialOption(option Option) ExternalSelectOption
- func WithExternalSelectPlaceholder(text string) ExternalSelectOption
- func WithMinQueryLength(length int) ExternalSelectOption
- type FeedbackButtons
- type FeedbackButtonsOption
- type File
- type FileInput
- type FileInputOption
- type FileOption
- type Header
- type HeaderOption
- type HomeTab
- type HomeTabOption
- type Icon
- type IconButton
- type IconButtonOption
- type ImageBlock
- type ImageBlockOption
- type ImageElement
- type ImageElementOption
- type Input
- type InputElement
- type InputOption
- type InputParameter
- type Markdown
- type MarkdownBlock
- type MarkdownBlockOption
- type MarkdownOption
- type Message
- type MessageOption
- type Modal
- type ModalOption
- func WithModalCallbackID(id string) ModalOption
- func WithModalClearOnClose() ModalOption
- func WithModalClose(text string) ModalOption
- func WithModalExternalID(id string) ModalOption
- func WithModalNotifyOnClose() ModalOption
- func WithModalPrivateMetadata(metadata string) ModalOption
- func WithModalSubmit(text string) ModalOption
- func WithModalSubmitDisabled() ModalOption
- type MultiChannelsSelect
- type MultiChannelsSelectOption
- func WithInitialChannels(channelIDs ...string) MultiChannelsSelectOption
- func WithMultiChannelsSelectActionID(id string) MultiChannelsSelectOption
- func WithMultiChannelsSelectConfirm(confirm ConfirmDialog) MultiChannelsSelectOption
- func WithMultiChannelsSelectFocusOnLoad() MultiChannelsSelectOption
- func WithMultiChannelsSelectMaxItems(max int) MultiChannelsSelectOption
- func WithMultiChannelsSelectPlaceholder(text string) MultiChannelsSelectOption
- type MultiConversationsSelect
- type MultiConversationsSelectOption
- func WithInitialConversations(conversationIDs ...string) MultiConversationsSelectOption
- func WithMultiConversationsDefaultToCurrentConversation() MultiConversationsSelectOption
- func WithMultiConversationsFilter(filter ConversationFilter) MultiConversationsSelectOption
- func WithMultiConversationsSelectActionID(id string) MultiConversationsSelectOption
- func WithMultiConversationsSelectConfirm(confirm ConfirmDialog) MultiConversationsSelectOption
- func WithMultiConversationsSelectFocusOnLoad() MultiConversationsSelectOption
- func WithMultiConversationsSelectMaxItems(max int) MultiConversationsSelectOption
- func WithMultiConversationsSelectPlaceholder(text string) MultiConversationsSelectOption
- type MultiExternalSelect
- type MultiExternalSelectOption
- func WithMultiExternalSelectActionID(id string) MultiExternalSelectOption
- func WithMultiExternalSelectConfirm(confirm ConfirmDialog) MultiExternalSelectOption
- func WithMultiExternalSelectFocusOnLoad() MultiExternalSelectOption
- func WithMultiExternalSelectInitialOptions(options ...Option) MultiExternalSelectOption
- func WithMultiExternalSelectMaxItems(max int) MultiExternalSelectOption
- func WithMultiExternalSelectMinQueryLength(length int) MultiExternalSelectOption
- func WithMultiExternalSelectPlaceholder(text string) MultiExternalSelectOption
- type MultiStaticSelect
- type MultiStaticSelectOption
- func WithMultiStaticSelectActionID(id string) MultiStaticSelectOption
- func WithMultiStaticSelectConfirm(confirm ConfirmDialog) MultiStaticSelectOption
- func WithMultiStaticSelectFocusOnLoad() MultiStaticSelectOption
- func WithMultiStaticSelectInitialOptions(options ...Option) MultiStaticSelectOption
- func WithMultiStaticSelectMaxItems(max int) MultiStaticSelectOption
- func WithMultiStaticSelectPlaceholder(text string) MultiStaticSelectOption
- type MultiUsersSelect
- type MultiUsersSelectOption
- func WithInitialUsers(userIDs ...string) MultiUsersSelectOption
- func WithMultiUsersSelectActionID(id string) MultiUsersSelectOption
- func WithMultiUsersSelectConfirm(confirm ConfirmDialog) MultiUsersSelectOption
- func WithMultiUsersSelectFocusOnLoad() MultiUsersSelectOption
- func WithMultiUsersSelectMaxItems(max int) MultiUsersSelectOption
- func WithMultiUsersSelectPlaceholder(text string) MultiUsersSelectOption
- type NumberInput
- type NumberInputOption
- func WithNumberInputActionID(id string) NumberInputOption
- func WithNumberInputDispatchActionConfig(config DispatchActionConfig) NumberInputOption
- func WithNumberInputFocusOnLoad() NumberInputOption
- func WithNumberInputInitialValue(value string) NumberInputOption
- func WithNumberInputMaxValue(value string) NumberInputOption
- func WithNumberInputMinValue(value string) NumberInputOption
- func WithNumberInputPlaceholder(text string) NumberInputOption
- type Option
- type OptionConfig
- type OptionGroup
- type Overflow
- type OverflowOption
- type PlainText
- type PlainTextInput
- type PlainTextInputOption
- func WithDispatchActionConfig(config DispatchActionConfig) PlainTextInputOption
- func WithInitialValue(value string) PlainTextInputOption
- func WithMaxLength(max int) PlainTextInputOption
- func WithMinLength(min int) PlainTextInputOption
- func WithMultiline() PlainTextInputOption
- func WithPlainTextInputActionID(id string) PlainTextInputOption
- func WithPlainTextInputFocusOnLoad() PlainTextInputOption
- func WithPlainTextInputPlaceholder(text string) PlainTextInputOption
- type PlainTextOnly
- type PlainTextOption
- type Plan
- type PlanItem
- type PlanItemStatus
- type PlanOption
- type PlanSection
- type RadioButtons
- type RadioButtonsOption
- type RichText
- type RichTextBroadcast
- type RichTextChannel
- type RichTextElement
- type RichTextEmoji
- type RichTextInput
- type RichTextInputOption
- func WithRichTextInputActionID(id string) RichTextInputOption
- func WithRichTextInputDispatchActionConfig(config DispatchActionConfig) RichTextInputOption
- func WithRichTextInputFocusOnLoad() RichTextInputOption
- func WithRichTextInputInitialValue(value *RichText) RichTextInputOption
- func WithRichTextInputPlaceholder(text string) RichTextInputOption
- type RichTextLink
- type RichTextList
- type RichTextListOption
- type RichTextOption
- type RichTextPreformatted
- type RichTextQuote
- type RichTextSection
- type RichTextSectionElement
- type RichTextStyle
- type RichTextText
- type RichTextUser
- type RichTextUserGroup
- type Section
- type SectionAccessory
- type SectionOption
- type SlackFile
- type StaticSelect
- type StaticSelectOption
- func WithStaticSelectActionID(id string) StaticSelectOption
- func WithStaticSelectConfirm(confirm ConfirmDialog) StaticSelectOption
- func WithStaticSelectFocusOnLoad() StaticSelectOption
- func WithStaticSelectInitialOption(option Option) StaticSelectOption
- func WithStaticSelectPlaceholder(text string) StaticSelectOption
- type Table
- type TableCell
- type TableCellRichText
- type TableCellText
- type TableCellValue
- type TableColumn
- type TableColumnOption
- type TableOption
- type TableRow
- type TaskCard
- type TaskCardOption
- type TaskCardStatus
- type TextObject
- type TimePicker
- type TimePickerOption
- func WithInitialTime(time string) TimePickerOption
- func WithTimePickerActionID(id string) TimePickerOption
- func WithTimePickerConfirm(confirm ConfirmDialog) TimePickerOption
- func WithTimePickerFocusOnLoad() TimePickerOption
- func WithTimePickerPlaceholder(text string) TimePickerOption
- func WithTimezone(tz string) TimePickerOption
- type Trigger
- type TriggerAction
- type TriggerOption
- type URLInput
- type URLInputOption
- type URLSource
- type URLSourceOption
- type UsersSelect
- type UsersSelectOption
- type ValidationError
- type Video
- type VideoOption
- type Workflow
- type WorkflowButton
- type WorkflowButtonOption
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptyText = errors.New("text cannot be empty") ErrExceedsMaxLen = errors.New("exceeds maximum length") ErrInvalidFormat = errors.New("invalid format") ErrMissingRequired = errors.New("missing required field") ErrMutuallyExclusive = errors.New("mutually exclusive fields set") ErrExceedsMaxItems = errors.New("exceeds maximum items") ErrMinItems = errors.New("requires minimum items") )
Sentinel errors for common validation failures.
Functions ¶
func GenerateActionID ¶
func GenerateActionID() string
GenerateActionID creates a unique action_id with "act" prefix.
func GenerateBlockID ¶
func GenerateBlockID() string
GenerateBlockID creates a unique block_id with "blk" prefix.
func GenerateID ¶
GenerateID creates a unique ID suitable for action_id or block_id. Format: prefix_timestamp_counter_random Ensures uniqueness across concurrent calls and process restarts.
Types ¶
type Actions ¶
type Actions struct {
// contains filtered or unexported fields
}
Actions holds multiple interactive elements.
func NewActions ¶
func NewActions(elements []ActionsElement, opts ...ActionsOption) (Actions, error)
NewActions creates an actions block. Max 25 elements.
func (Actions) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type ActionsElement ¶
ActionsElement marks elements valid in actions blocks. Valid types: Button, StaticSelect, MultiStaticSelect, ExternalSelect, MultiExternalSelect, UsersSelect, MultiUsersSelect, ConversationsSelect, MultiConversationsSelect, ChannelsSelect, MultiChannelsSelect, DatePicker, TimePicker, Checkboxes, RadioButtons, Overflow
type ActionsOption ¶
type ActionsOption func(*Actions)
ActionsOption configures an Actions block.
func WithActionsBlockID ¶
func WithActionsBlockID(id string) ActionsOption
WithActionsBlockID sets the block_id.
type Block ¶
Block is the base interface for all top-level layout blocks. The unexported method seals the interface - only types in this package can implement it.
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder provides a fluent API for building block collections.
func (*Builder) AddActions ¶
func (b *Builder) AddActions(elements []ActionsElement, opts ...ActionsOption) *Builder
AddActions adds an actions block.
func (*Builder) AddContext ¶
func (b *Builder) AddContext(elements []ContextElement, opts ...ContextOption) *Builder
AddContext adds a context block.
func (*Builder) AddDivider ¶
func (b *Builder) AddDivider(opts ...DividerOption) *Builder
AddDivider adds a divider block.
func (*Builder) AddHeader ¶
func (b *Builder) AddHeader(text string, opts ...HeaderOption) *Builder
AddHeader adds a header block.
func (*Builder) AddImage ¶
func (b *Builder) AddImage(imageURL, altText string, opts ...ImageBlockOption) *Builder
AddImage adds an image block.
func (*Builder) AddInput ¶
func (b *Builder) AddInput(label string, element InputElement, opts ...InputOption) *Builder
AddInput adds an input block.
func (*Builder) AddSection ¶
func (b *Builder) AddSection(text TextObject, opts ...SectionOption) *Builder
AddSection adds a section block with text.
func (*Builder) AddSectionWithFields ¶
func (b *Builder) AddSectionWithFields(fields []TextObject, opts ...SectionOption) *Builder
AddSectionWithFields adds a section block with fields.
func (*Builder) BlocksJSON ¶
BlocksJSON returns just the blocks array as JSON.
func (*Builder) MustToHomeTab ¶
func (b *Builder) MustToHomeTab(opts ...HomeTabOption) HomeTab
MustToHomeTab converts to a home tab or panics on error.
func (*Builder) MustToMessage ¶
func (b *Builder) MustToMessage(fallbackText string, opts ...MessageOption) Message
MustToMessage converts to a message or panics on error.
func (*Builder) MustToModal ¶
func (b *Builder) MustToModal(title string, opts ...ModalOption) Modal
MustToModal converts to a modal or panics on error.
func (*Builder) PrettyJSON ¶
PrettyJSON returns indented JSON.
func (*Builder) ToHomeTab ¶
func (b *Builder) ToHomeTab(opts ...HomeTabOption) (HomeTab, error)
ToHomeTab converts the blocks to a home tab.
type Button ¶
type Button struct {
// contains filtered or unexported fields
}
Button represents an interactive button element.
func MustButton ¶
func MustButton(text string, opts ...ButtonOption) Button
MustButton creates a Button or panics on error.
func NewButton ¶
func NewButton(text string, opts ...ButtonOption) (Button, error)
NewButton creates a new Button with the given text. text max: 75 characters
func (Button) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type ButtonOption ¶
type ButtonOption func(*Button)
ButtonOption configures a Button.
func WithAccessibilityLabel ¶
func WithAccessibilityLabel(label string) ButtonOption
WithAccessibilityLabel sets a label for screen readers. Max 75 characters.
func WithActionID ¶
func WithActionID(id string) ButtonOption
WithActionID sets the button's action_id. Max 255 characters.
func WithButtonConfirm ¶
func WithButtonConfirm(confirm ConfirmDialog) ButtonOption
WithButtonConfirm adds a confirmation dialog to the button.
func WithButtonStyle ¶
func WithButtonStyle(style ButtonStyle) ButtonOption
WithButtonStyle sets the button's visual style.
func WithURL ¶
func WithURL(url string) ButtonOption
WithURL sets a URL to load when the button is clicked. Max 3000 characters.
func WithValue ¶
func WithValue(value string) ButtonOption
WithValue sets the button's value sent in interaction payload. Max 2000 characters.
type ButtonStyle ¶
type ButtonStyle string
ButtonStyle represents button visual styles.
const ( ButtonStylePrimary ButtonStyle = "primary" ButtonStyleDanger ButtonStyle = "danger" )
type ChannelsSelect ¶
type ChannelsSelect struct {
// contains filtered or unexported fields
}
ChannelsSelect allows users to select a public channel.
func NewChannelsSelect ¶
func NewChannelsSelect(opts ...ChannelsSelectOption) ChannelsSelect
NewChannelsSelect creates a channel select element.
func (ChannelsSelect) MarshalJSON ¶
func (c ChannelsSelect) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type ChannelsSelectOption ¶
type ChannelsSelectOption func(*ChannelsSelect)
ChannelsSelectOption configures a ChannelsSelect.
func WithChannelsSelectActionID ¶
func WithChannelsSelectActionID(id string) ChannelsSelectOption
WithChannelsSelectActionID sets the action_id.
func WithChannelsSelectConfirm ¶
func WithChannelsSelectConfirm(confirm ConfirmDialog) ChannelsSelectOption
WithChannelsSelectConfirm adds a confirmation dialog.
func WithChannelsSelectFocusOnLoad ¶
func WithChannelsSelectFocusOnLoad() ChannelsSelectOption
WithChannelsSelectFocusOnLoad sets auto-focus.
func WithChannelsSelectPlaceholder ¶
func WithChannelsSelectPlaceholder(text string) ChannelsSelectOption
WithChannelsSelectPlaceholder sets placeholder text.
func WithChannelsSelectResponseURLEnabled ¶
func WithChannelsSelectResponseURLEnabled() ChannelsSelectOption
WithChannelsSelectResponseURLEnabled enables response URL for workflows.
func WithInitialChannel ¶
func WithInitialChannel(channelID string) ChannelsSelectOption
WithInitialChannel sets the initially selected channel ID.
type Checkboxes ¶
type Checkboxes struct {
// contains filtered or unexported fields
}
Checkboxes allows users to choose multiple items from a list.
func NewCheckboxes ¶
func NewCheckboxes(options []Option, opts ...CheckboxesOption) (Checkboxes, error)
NewCheckboxes creates a new checkboxes element. Max 10 options.
func (Checkboxes) MarshalJSON ¶
func (c Checkboxes) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type CheckboxesOption ¶
type CheckboxesOption func(*Checkboxes)
CheckboxesOption configures a Checkboxes element.
func WithCheckboxesActionID ¶
func WithCheckboxesActionID(id string) CheckboxesOption
WithCheckboxesActionID sets the action_id.
func WithCheckboxesConfirm ¶
func WithCheckboxesConfirm(confirm ConfirmDialog) CheckboxesOption
WithCheckboxesConfirm adds a confirmation dialog.
func WithCheckboxesFocusOnLoad ¶
func WithCheckboxesFocusOnLoad() CheckboxesOption
WithCheckboxesFocusOnLoad sets auto-focus.
func WithInitialOptions ¶
func WithInitialOptions(options ...Option) CheckboxesOption
WithInitialOptions sets initially selected options.
type ConfirmDialog ¶
type ConfirmDialog struct {
// contains filtered or unexported fields
}
ConfirmDialog represents a confirmation dialog composition object. Adds a confirmation step to interactive elements.
func NewConfirmDialog ¶
func NewConfirmDialog(title, text, confirm, deny string, opts ...ConfirmDialogOption) (ConfirmDialog, error)
NewConfirmDialog creates a new confirmation dialog. title max: 100 chars, text max: 300 chars, confirm/deny max: 30 chars
func NewConfirmDialogWithMarkdown ¶
func NewConfirmDialogWithMarkdown(title, text, confirm, deny string, opts ...ConfirmDialogOption) (ConfirmDialog, error)
NewConfirmDialogWithMarkdown creates a confirm dialog with markdown text.
func (ConfirmDialog) MarshalJSON ¶
func (c ConfirmDialog) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type ConfirmDialogOption ¶
type ConfirmDialogOption func(*ConfirmDialog)
ConfirmDialogOption configures a ConfirmDialog.
func WithConfirmStyle ¶
func WithConfirmStyle(style ConfirmStyle) ConfirmDialogOption
WithConfirmStyle sets the style of the confirm button.
type ConfirmStyle ¶
type ConfirmStyle string
ConfirmStyle represents the style of the confirm button.
const ( ConfirmStylePrimary ConfirmStyle = "primary" ConfirmStyleDanger ConfirmStyle = "danger" )
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context displays contextual information. Elements can be images and text (PlainText or Markdown).
func NewContext ¶
func NewContext(elements []ContextElement, opts ...ContextOption) (Context, error)
NewContext creates a new context block. Max 10 elements.
func (Context) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type ContextActions ¶
type ContextActions struct {
// contains filtered or unexported fields
}
ContextActions displays actions as contextual information. Available in messages only. Contains feedback buttons and icon buttons.
func MustContextActions ¶
func MustContextActions(elements []ContextActionsElement, opts ...ContextActionsOption) ContextActions
MustContextActions creates a ContextActions or panics on error.
func NewContextActions ¶
func NewContextActions(elements []ContextActionsElement, opts ...ContextActionsOption) (ContextActions, error)
NewContextActions creates a new context actions block. elements: 1-5 elements (FeedbackButtons, IconButton)
func (ContextActions) MarshalJSON ¶
func (c ContextActions) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type ContextActionsElement ¶
ContextActionsElement marks elements valid in context actions blocks. Valid types: FeedbackButtons, IconButton
type ContextActionsOption ¶
type ContextActionsOption func(*ContextActions)
ContextActionsOption configures a ContextActions block.
func WithContextActionsBlockID ¶
func WithContextActionsBlockID(id string) ContextActionsOption
WithContextActionsBlockID sets the block_id.
type ContextElement ¶
ContextElement marks elements valid in context blocks. Valid types: ImageElement, PlainText, Markdown
type ContextOption ¶
type ContextOption func(*Context)
ContextOption configures a Context.
func WithContextBlockID ¶
func WithContextBlockID(id string) ContextOption
WithContextBlockID sets the block_id.
type ConversationFilter ¶
type ConversationFilter struct {
// contains filtered or unexported fields
}
ConversationFilter provides filtering for conversation selector menus.
func NewConversationFilter ¶
func NewConversationFilter(opts ...ConversationFilterOption) (ConversationFilter, error)
NewConversationFilter creates a new conversation filter. At least one option must be set.
func (ConversationFilter) MarshalJSON ¶
func (f ConversationFilter) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type ConversationFilterOption ¶
type ConversationFilterOption func(*ConversationFilter)
ConversationFilterOption configures a ConversationFilter.
func WithExcludeBotUsers ¶
func WithExcludeBotUsers() ConversationFilterOption
WithExcludeBotUsers excludes bot users.
func WithExcludeExternalSharedChannels ¶
func WithExcludeExternalSharedChannels() ConversationFilterOption
WithExcludeExternalSharedChannels excludes external shared channels.
func WithInclude ¶
func WithInclude(types ...ConversationType) ConversationFilterOption
WithInclude specifies which conversation types to include.
type ConversationType ¶
type ConversationType string
ConversationType represents types of conversations to include in filter.
const ( ConversationIM ConversationType = "im" ConversationMPIM ConversationType = "mpim" ConversationPrivate ConversationType = "private" ConversationPublic ConversationType = "public" )
type ConversationsSelect ¶
type ConversationsSelect struct {
// contains filtered or unexported fields
}
ConversationsSelect allows users to select a conversation.
func NewConversationsSelect ¶
func NewConversationsSelect(opts ...ConversationsSelectOption) ConversationsSelect
NewConversationsSelect creates a conversation select element.
func (ConversationsSelect) MarshalJSON ¶
func (c ConversationsSelect) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type ConversationsSelectOption ¶
type ConversationsSelectOption func(*ConversationsSelect)
ConversationsSelectOption configures a ConversationsSelect.
func WithConversationsFilter ¶
func WithConversationsFilter(filter ConversationFilter) ConversationsSelectOption
WithConversationsFilter sets a filter for the conversation list.
func WithConversationsSelectActionID ¶
func WithConversationsSelectActionID(id string) ConversationsSelectOption
WithConversationsSelectActionID sets the action_id.
func WithConversationsSelectConfirm ¶
func WithConversationsSelectConfirm(confirm ConfirmDialog) ConversationsSelectOption
WithConversationsSelectConfirm adds a confirmation dialog.
func WithConversationsSelectFocusOnLoad ¶
func WithConversationsSelectFocusOnLoad() ConversationsSelectOption
WithConversationsSelectFocusOnLoad sets auto-focus.
func WithConversationsSelectPlaceholder ¶
func WithConversationsSelectPlaceholder(text string) ConversationsSelectOption
WithConversationsSelectPlaceholder sets placeholder text.
func WithDefaultToCurrentConversation ¶
func WithDefaultToCurrentConversation() ConversationsSelectOption
WithDefaultToCurrentConversation defaults to current conversation.
func WithInitialConversation ¶
func WithInitialConversation(conversationID string) ConversationsSelectOption
WithInitialConversation sets the initially selected conversation ID.
func WithResponseURLEnabled ¶
func WithResponseURLEnabled() ConversationsSelectOption
WithResponseURLEnabled enables response URL for workflows.
type DatePicker ¶
type DatePicker struct {
// contains filtered or unexported fields
}
DatePicker allows users to select a date from a calendar UI.
func NewDatePicker ¶
func NewDatePicker(opts ...DatePickerOption) DatePicker
NewDatePicker creates a new date picker element.
func (DatePicker) MarshalJSON ¶
func (d DatePicker) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type DatePickerOption ¶
type DatePickerOption func(*DatePicker)
DatePickerOption configures a DatePicker.
func WithDatePickerActionID ¶
func WithDatePickerActionID(id string) DatePickerOption
WithDatePickerActionID sets the action_id.
func WithDatePickerConfirm ¶
func WithDatePickerConfirm(confirm ConfirmDialog) DatePickerOption
WithDatePickerConfirm adds a confirmation dialog.
func WithDatePickerFocusOnLoad ¶
func WithDatePickerFocusOnLoad() DatePickerOption
WithDatePickerFocusOnLoad sets auto-focus.
func WithDatePickerPlaceholder ¶
func WithDatePickerPlaceholder(text string) DatePickerOption
WithDatePickerPlaceholder sets placeholder text. Max 150 characters.
func WithInitialDate ¶
func WithInitialDate(date string) DatePickerOption
WithInitialDate sets the initially selected date. Format: YYYY-MM-DD
type DatetimePicker ¶
type DatetimePicker struct {
// contains filtered or unexported fields
}
DatetimePicker allows users to select both date and time.
func NewDatetimePicker ¶
func NewDatetimePicker(opts ...DatetimePickerOption) DatetimePicker
NewDatetimePicker creates a new datetime picker element.
func (DatetimePicker) MarshalJSON ¶
func (d DatetimePicker) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type DatetimePickerOption ¶
type DatetimePickerOption func(*DatetimePicker)
DatetimePickerOption configures a DatetimePicker.
func WithDatetimePickerActionID ¶
func WithDatetimePickerActionID(id string) DatetimePickerOption
WithDatetimePickerActionID sets the action_id.
func WithDatetimePickerConfirm ¶
func WithDatetimePickerConfirm(confirm ConfirmDialog) DatetimePickerOption
WithDatetimePickerConfirm adds a confirmation dialog.
func WithDatetimePickerFocusOnLoad ¶
func WithDatetimePickerFocusOnLoad() DatetimePickerOption
WithDatetimePickerFocusOnLoad sets auto-focus.
func WithInitialDateTime ¶
func WithInitialDateTime(timestamp int64) DatetimePickerOption
WithInitialDateTime sets the initial date/time as Unix timestamp.
type DispatchActionConfig ¶
type DispatchActionConfig struct {
// contains filtered or unexported fields
}
DispatchActionConfig defines when a plain-text input dispatches actions.
func NewDispatchActionConfig ¶
func NewDispatchActionConfig(triggers ...TriggerAction) DispatchActionConfig
NewDispatchActionConfig creates a new dispatch action configuration.
func (DispatchActionConfig) MarshalJSON ¶
func (d DispatchActionConfig) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type Divider ¶
type Divider struct {
// contains filtered or unexported fields
}
Divider is a visual separator between blocks.
func NewDivider ¶
func NewDivider(opts ...DividerOption) Divider
NewDivider creates a new divider block.
func (Divider) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type DividerOption ¶
type DividerOption func(*Divider)
DividerOption configures a Divider.
func WithDividerBlockID ¶
func WithDividerBlockID(id string) DividerOption
WithDividerBlockID sets the block_id.
type EmailInput ¶
type EmailInput struct {
// contains filtered or unexported fields
}
EmailInput allows users to enter an email into a single-line field.
func NewEmailInput ¶
func NewEmailInput(opts ...EmailInputOption) EmailInput
NewEmailInput creates a new email input element.
func (EmailInput) MarshalJSON ¶
func (e EmailInput) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type EmailInputOption ¶
type EmailInputOption func(*EmailInput)
EmailInputOption configures an EmailInput.
func WithEmailInputActionID ¶
func WithEmailInputActionID(id string) EmailInputOption
WithEmailInputActionID sets the action_id.
func WithEmailInputDispatchActionConfig ¶
func WithEmailInputDispatchActionConfig(config DispatchActionConfig) EmailInputOption
WithEmailInputDispatchActionConfig sets when to dispatch block_actions.
func WithEmailInputFocusOnLoad ¶
func WithEmailInputFocusOnLoad() EmailInputOption
WithEmailInputFocusOnLoad sets auto-focus.
func WithEmailInputInitialValue ¶
func WithEmailInputInitialValue(value string) EmailInputOption
WithEmailInputInitialValue sets the initial email value.
func WithEmailInputPlaceholder ¶
func WithEmailInputPlaceholder(text string) EmailInputOption
WithEmailInputPlaceholder sets placeholder text. Max 150 characters.
type ExternalSelect ¶
type ExternalSelect struct {
// contains filtered or unexported fields
}
ExternalSelect allows users to choose from options loaded from an external source.
func NewExternalSelect ¶
func NewExternalSelect(opts ...ExternalSelectOption) ExternalSelect
NewExternalSelect creates an external data source select.
func (ExternalSelect) MarshalJSON ¶
func (e ExternalSelect) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type ExternalSelectOption ¶
type ExternalSelectOption func(*ExternalSelect)
ExternalSelectOption configures an ExternalSelect.
func WithExternalSelectActionID ¶
func WithExternalSelectActionID(id string) ExternalSelectOption
WithExternalSelectActionID sets the action_id.
func WithExternalSelectConfirm ¶
func WithExternalSelectConfirm(confirm ConfirmDialog) ExternalSelectOption
WithExternalSelectConfirm adds a confirmation dialog.
func WithExternalSelectFocusOnLoad ¶
func WithExternalSelectFocusOnLoad() ExternalSelectOption
WithExternalSelectFocusOnLoad sets auto-focus.
func WithExternalSelectInitialOption ¶
func WithExternalSelectInitialOption(option Option) ExternalSelectOption
WithExternalSelectInitialOption sets the initially selected option.
func WithExternalSelectPlaceholder ¶
func WithExternalSelectPlaceholder(text string) ExternalSelectOption
WithExternalSelectPlaceholder sets placeholder text.
func WithMinQueryLength ¶
func WithMinQueryLength(length int) ExternalSelectOption
WithMinQueryLength sets minimum characters before querying.
type FeedbackButtons ¶
type FeedbackButtons struct {
// contains filtered or unexported fields
}
FeedbackButtons displays buttons to indicate positive or negative feedback. Used in context actions blocks for AI/assistant responses.
func NewFeedbackButtons ¶
func NewFeedbackButtons(opts ...FeedbackButtonsOption) FeedbackButtons
NewFeedbackButtons creates a new feedback buttons element.
func (FeedbackButtons) MarshalJSON ¶
func (f FeedbackButtons) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type FeedbackButtonsOption ¶
type FeedbackButtonsOption func(*FeedbackButtons)
FeedbackButtonsOption configures FeedbackButtons.
func WithFeedbackButtonsActionID ¶
func WithFeedbackButtonsActionID(id string) FeedbackButtonsOption
WithFeedbackButtonsActionID sets the action_id.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File displays information about a remote file. This block appears when retrieving messages that contain remote files. You cannot add this block directly to messages.
func MustFile ¶
func MustFile(externalID string, opts ...FileOption) File
MustFile creates a File or panics on error.
func NewFile ¶
func NewFile(externalID string, opts ...FileOption) (File, error)
NewFile creates a new file block. externalID is the external unique ID for the file. source is always "remote" for remote files.
func (File) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type FileInput ¶
type FileInput struct {
// contains filtered or unexported fields
}
FileInput allows users to upload files.
func NewFileInput ¶
func NewFileInput(opts ...FileInputOption) FileInput
NewFileInput creates a new file input element.
func (FileInput) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type FileInputOption ¶
type FileInputOption func(*FileInput)
FileInputOption configures a FileInput.
func WithFileInputActionID ¶
func WithFileInputActionID(id string) FileInputOption
WithFileInputActionID sets the action_id.
func WithFileInputFiletypes ¶
func WithFileInputFiletypes(filetypes []string) FileInputOption
WithFileInputFiletypes sets the allowed file types. Example: []string{"pdf", "doc", "docx"}
func WithFileInputMaxFiles ¶
func WithFileInputMaxFiles(max int) FileInputOption
WithFileInputMaxFiles sets the maximum number of files. Minimum 1, maximum 10. Defaults to 10 if not specified.
type FileOption ¶
type FileOption func(*File)
FileOption configures a File block.
func WithFileBlockID ¶
func WithFileBlockID(id string) FileOption
WithFileBlockID sets the block_id.
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header displays larger-sized text.
func MustHeader ¶
func MustHeader(text string, opts ...HeaderOption) Header
MustHeader creates a Header or panics on error.
func NewHeader ¶
func NewHeader(text string, opts ...HeaderOption) (Header, error)
NewHeader creates a new header block. text max: 150 characters, must be plain_text
func (Header) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type HeaderOption ¶
type HeaderOption func(*Header)
HeaderOption configures a Header.
func WithHeaderBlockID ¶
func WithHeaderBlockID(id string) HeaderOption
WithHeaderBlockID sets the block_id.
type HomeTab ¶
type HomeTab struct {
// contains filtered or unexported fields
}
HomeTab represents the App Home tab surface.
func MustHomeTab ¶
func MustHomeTab(blocks []Block, opts ...HomeTabOption) HomeTab
MustHomeTab creates a HomeTab or panics on error.
func NewHomeTab ¶
func NewHomeTab(blocks []Block, opts ...HomeTabOption) (HomeTab, error)
NewHomeTab creates a new home tab. max 100 blocks
func (HomeTab) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type HomeTabOption ¶
type HomeTabOption func(*HomeTab)
HomeTabOption configures a HomeTab.
func WithHomeTabCallbackID ¶
func WithHomeTabCallbackID(id string) HomeTabOption
WithHomeTabCallbackID sets the callback ID. Max 255 characters.
func WithHomeTabExternalID ¶
func WithHomeTabExternalID(id string) HomeTabOption
WithHomeTabExternalID sets an external ID.
func WithHomeTabPrivateMetadata ¶
func WithHomeTabPrivateMetadata(metadata string) HomeTabOption
WithHomeTabPrivateMetadata sets private metadata. Max 3000 characters.
type Icon ¶
type Icon struct {
// contains filtered or unexported fields
}
Icon represents an icon for the icon button.
func (Icon) MarshalJSON ¶
MarshalJSON implements json.Marshaler for Icon.
type IconButton ¶
type IconButton struct {
// contains filtered or unexported fields
}
IconButton displays an icon button for performing actions. Used in context actions blocks.
func NewIconButton ¶
func NewIconButton(icon Icon, opts ...IconButtonOption) IconButton
NewIconButton creates a new icon button element.
func (IconButton) MarshalJSON ¶
func (b IconButton) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type IconButtonOption ¶
type IconButtonOption func(*IconButton)
IconButtonOption configures an IconButton.
func WithIconButtonActionID ¶
func WithIconButtonActionID(id string) IconButtonOption
WithIconButtonActionID sets the action_id.
func WithIconButtonAltText ¶
func WithIconButtonAltText(text string) IconButtonOption
WithIconButtonAltText sets the alt text for accessibility.
type ImageBlock ¶
type ImageBlock struct {
// contains filtered or unexported fields
}
ImageBlock displays an image.
func NewImageBlock ¶
func NewImageBlock(imageURL, altText string, opts ...ImageBlockOption) (ImageBlock, error)
NewImageBlock creates an image block from a URL. imageURL max: 3000 chars, altText max: 2000 chars
func NewImageBlockFromSlackFile ¶
func NewImageBlockFromSlackFile(slackFile SlackFile, altText string, opts ...ImageBlockOption) (ImageBlock, error)
NewImageBlockFromSlackFile creates an image block from a Slack file.
func (ImageBlock) MarshalJSON ¶
func (i ImageBlock) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type ImageBlockOption ¶
type ImageBlockOption func(*ImageBlock)
ImageBlockOption configures an ImageBlock.
func WithImageBlockID ¶
func WithImageBlockID(id string) ImageBlockOption
WithImageBlockID sets the block_id.
func WithImageBlockTitle ¶
func WithImageBlockTitle(title string) ImageBlockOption
WithImageBlockTitle sets the image title. Max 2000 characters.
type ImageElement ¶
type ImageElement struct {
// contains filtered or unexported fields
}
ImageElement represents an image element for use in section/context blocks.
func NewImageElement ¶
func NewImageElement(imageURL, altText string) (ImageElement, error)
NewImageElement creates an image element from a URL. imageURL max: 3000 chars, altText max: 2000 chars
func NewImageElementFromSlackFile ¶
func NewImageElementFromSlackFile(slackFile SlackFile, altText string) (ImageElement, error)
NewImageElementFromSlackFile creates an image element from a Slack file.
func (ImageElement) MarshalJSON ¶
func (i ImageElement) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type ImageElementOption ¶
type ImageElementOption func(*ImageElement)
ImageElementOption configures an ImageElement.
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
Input collects information from users via input elements.
func MustInput ¶
func MustInput(label string, element InputElement, opts ...InputOption) Input
MustInput creates an Input or panics on error.
func NewInput ¶
func NewInput(label string, element InputElement, opts ...InputOption) (Input, error)
NewInput creates an input block with required label and element. label max: 2000 characters
func (Input) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type InputElement ¶
InputElement marks elements valid in input blocks. Valid types: PlainTextInput, StaticSelect, MultiStaticSelect, ExternalSelect, MultiExternalSelect, UsersSelect, MultiUsersSelect, ConversationsSelect, MultiConversationsSelect, ChannelsSelect, MultiChannelsSelect, DatePicker, TimePicker, DatetimePicker, Checkboxes, RadioButtons, EmailInput, NumberInput, URLInput, FileInput, RichTextInput
type InputOption ¶
type InputOption func(*Input)
InputOption configures an Input block.
func AsInputOptional ¶
func AsInputOptional() InputOption
AsInputOptional marks the input as optional.
func WithInputBlockID ¶
func WithInputBlockID(id string) InputOption
WithInputBlockID sets the block_id.
func WithInputDispatchAction ¶
func WithInputDispatchAction() InputOption
WithInputDispatchAction enables block_actions dispatch.
func WithInputHint ¶
func WithInputHint(hint string) InputOption
WithInputHint adds a hint below the input. Max 2000 characters.
type InputParameter ¶
type InputParameter struct {
// contains filtered or unexported fields
}
InputParameter defines an input parameter for workflow triggers.
func MustInputParameter ¶
func MustInputParameter(name, value string) InputParameter
MustInputParameter creates an InputParameter or panics on error.
func NewInputParameter ¶
func NewInputParameter(name, value string) (InputParameter, error)
NewInputParameter creates a new input parameter.
func (InputParameter) MarshalJSON ¶
func (p InputParameter) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type Markdown ¶
type Markdown struct {
// contains filtered or unexported fields
}
Markdown represents a mrkdwn composition object.
func MustMarkdown ¶
func MustMarkdown(text string, opts ...MarkdownOption) Markdown
MustMarkdown creates a Markdown or panics on error.
func NewMarkdown ¶
func NewMarkdown(text string, opts ...MarkdownOption) (Markdown, error)
NewMarkdown creates a new Markdown text object.
func (Markdown) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type MarkdownBlock ¶
type MarkdownBlock struct {
// contains filtered or unexported fields
}
MarkdownBlock displays formatted markdown content. Available in messages only.
func MustMarkdownBlock ¶
func MustMarkdownBlock(text string, opts ...MarkdownBlockOption) MarkdownBlock
MustMarkdownBlock creates a MarkdownBlock or panics on error.
func NewMarkdownBlock ¶
func NewMarkdownBlock(text string, opts ...MarkdownBlockOption) (MarkdownBlock, error)
NewMarkdownBlock creates a new markdown block.
func (MarkdownBlock) MarshalJSON ¶
func (m MarkdownBlock) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type MarkdownBlockOption ¶
type MarkdownBlockOption func(*MarkdownBlock)
MarkdownBlockOption configures a MarkdownBlock.
func WithMarkdownBlockID ¶
func WithMarkdownBlockID(id string) MarkdownBlockOption
WithMarkdownBlockID sets the block_id.
type MarkdownOption ¶
type MarkdownOption func(*Markdown)
MarkdownOption configures a Markdown.
func WithVerbatim ¶
func WithVerbatim(verbatim bool) MarkdownOption
WithVerbatim disables automatic parsing of URLs, mentions, and emoji.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message represents a message surface.
func MustMessage ¶
func MustMessage(text string, blocks []Block, opts ...MessageOption) Message
MustMessage creates a Message or panics on error.
func NewMessage ¶
func NewMessage(text string, blocks []Block, opts ...MessageOption) (Message, error)
NewMessage creates a new message. text is fallback for notifications, max 50 blocks
func NewMessageWithBlocks ¶
func NewMessageWithBlocks(blocks []Block, opts ...MessageOption) (Message, error)
NewMessageWithBlocks creates a message with blocks only.
func (Message) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type MessageOption ¶
type MessageOption func(*Message)
MessageOption configures a Message.
func WithMessageMrkdwn ¶
func WithMessageMrkdwn() MessageOption
WithMessageMrkdwn enables markdown parsing for the text.
func WithMessageThreadTS ¶
func WithMessageThreadTS(ts string) MessageOption
WithMessageThreadTS sets the thread timestamp for replies.
type Modal ¶
type Modal struct {
// contains filtered or unexported fields
}
Modal represents a modal dialog surface.
func MustModal ¶
func MustModal(title string, blocks []Block, opts ...ModalOption) Modal
MustModal creates a Modal or panics on error.
func NewModal ¶
func NewModal(title string, blocks []Block, opts ...ModalOption) (Modal, error)
NewModal creates a new modal. title max: 24 characters, max 100 blocks
func (Modal) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type ModalOption ¶
type ModalOption func(*Modal)
ModalOption configures a Modal.
func WithModalCallbackID ¶
func WithModalCallbackID(id string) ModalOption
WithModalCallbackID sets the callback ID. Max 255 characters.
func WithModalClearOnClose ¶
func WithModalClearOnClose() ModalOption
WithModalClearOnClose clears all views when closed.
func WithModalClose ¶
func WithModalClose(text string) ModalOption
WithModalClose sets the close button text. Max 24 characters.
func WithModalExternalID ¶
func WithModalExternalID(id string) ModalOption
WithModalExternalID sets an external ID.
func WithModalNotifyOnClose ¶
func WithModalNotifyOnClose() ModalOption
WithModalNotifyOnClose sends view_closed event when closed.
func WithModalPrivateMetadata ¶
func WithModalPrivateMetadata(metadata string) ModalOption
WithModalPrivateMetadata sets private metadata. Max 3000 characters.
func WithModalSubmit ¶
func WithModalSubmit(text string) ModalOption
WithModalSubmit sets the submit button text. Max 24 characters.
func WithModalSubmitDisabled ¶
func WithModalSubmitDisabled() ModalOption
WithModalSubmitDisabled disables the submit button.
type MultiChannelsSelect ¶
type MultiChannelsSelect struct {
// contains filtered or unexported fields
}
MultiChannelsSelect allows selecting multiple public channels.
func NewMultiChannelsSelect ¶
func NewMultiChannelsSelect(opts ...MultiChannelsSelectOption) MultiChannelsSelect
NewMultiChannelsSelect creates a multi-channel select element.
func (MultiChannelsSelect) MarshalJSON ¶
func (m MultiChannelsSelect) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type MultiChannelsSelectOption ¶
type MultiChannelsSelectOption func(*MultiChannelsSelect)
MultiChannelsSelectOption configures a MultiChannelsSelect.
func WithInitialChannels ¶
func WithInitialChannels(channelIDs ...string) MultiChannelsSelectOption
WithInitialChannels sets initially selected channel IDs.
func WithMultiChannelsSelectActionID ¶
func WithMultiChannelsSelectActionID(id string) MultiChannelsSelectOption
WithMultiChannelsSelectActionID sets the action_id.
func WithMultiChannelsSelectConfirm ¶
func WithMultiChannelsSelectConfirm(confirm ConfirmDialog) MultiChannelsSelectOption
WithMultiChannelsSelectConfirm adds a confirmation dialog.
func WithMultiChannelsSelectFocusOnLoad ¶
func WithMultiChannelsSelectFocusOnLoad() MultiChannelsSelectOption
WithMultiChannelsSelectFocusOnLoad sets auto-focus.
func WithMultiChannelsSelectMaxItems ¶
func WithMultiChannelsSelectMaxItems(max int) MultiChannelsSelectOption
WithMultiChannelsSelectMaxItems sets max selectable items.
func WithMultiChannelsSelectPlaceholder ¶
func WithMultiChannelsSelectPlaceholder(text string) MultiChannelsSelectOption
WithMultiChannelsSelectPlaceholder sets placeholder text.
type MultiConversationsSelect ¶
type MultiConversationsSelect struct {
// contains filtered or unexported fields
}
MultiConversationsSelect allows selecting multiple conversations.
func NewMultiConversationsSelect ¶
func NewMultiConversationsSelect(opts ...MultiConversationsSelectOption) MultiConversationsSelect
NewMultiConversationsSelect creates a multi-conversation select element.
func (MultiConversationsSelect) MarshalJSON ¶
func (m MultiConversationsSelect) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type MultiConversationsSelectOption ¶
type MultiConversationsSelectOption func(*MultiConversationsSelect)
MultiConversationsSelectOption configures a MultiConversationsSelect.
func WithInitialConversations ¶
func WithInitialConversations(conversationIDs ...string) MultiConversationsSelectOption
WithInitialConversations sets initially selected conversation IDs.
func WithMultiConversationsDefaultToCurrentConversation ¶
func WithMultiConversationsDefaultToCurrentConversation() MultiConversationsSelectOption
WithMultiConversationsDefaultToCurrentConversation defaults to current.
func WithMultiConversationsFilter ¶
func WithMultiConversationsFilter(filter ConversationFilter) MultiConversationsSelectOption
WithMultiConversationsFilter sets a filter for the conversation list.
func WithMultiConversationsSelectActionID ¶
func WithMultiConversationsSelectActionID(id string) MultiConversationsSelectOption
WithMultiConversationsSelectActionID sets the action_id.
func WithMultiConversationsSelectConfirm ¶
func WithMultiConversationsSelectConfirm(confirm ConfirmDialog) MultiConversationsSelectOption
WithMultiConversationsSelectConfirm adds a confirmation dialog.
func WithMultiConversationsSelectFocusOnLoad ¶
func WithMultiConversationsSelectFocusOnLoad() MultiConversationsSelectOption
WithMultiConversationsSelectFocusOnLoad sets auto-focus.
func WithMultiConversationsSelectMaxItems ¶
func WithMultiConversationsSelectMaxItems(max int) MultiConversationsSelectOption
WithMultiConversationsSelectMaxItems sets max selectable items.
func WithMultiConversationsSelectPlaceholder ¶
func WithMultiConversationsSelectPlaceholder(text string) MultiConversationsSelectOption
WithMultiConversationsSelectPlaceholder sets placeholder text.
type MultiExternalSelect ¶
type MultiExternalSelect struct {
// contains filtered or unexported fields
}
MultiExternalSelect allows multiple selections from an external source.
func NewMultiExternalSelect ¶
func NewMultiExternalSelect(opts ...MultiExternalSelectOption) MultiExternalSelect
NewMultiExternalSelect creates a multi-select with external data source.
func (MultiExternalSelect) MarshalJSON ¶
func (m MultiExternalSelect) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type MultiExternalSelectOption ¶
type MultiExternalSelectOption func(*MultiExternalSelect)
MultiExternalSelectOption configures a MultiExternalSelect.
func WithMultiExternalSelectActionID ¶
func WithMultiExternalSelectActionID(id string) MultiExternalSelectOption
WithMultiExternalSelectActionID sets the action_id.
func WithMultiExternalSelectConfirm ¶
func WithMultiExternalSelectConfirm(confirm ConfirmDialog) MultiExternalSelectOption
WithMultiExternalSelectConfirm adds a confirmation dialog.
func WithMultiExternalSelectFocusOnLoad ¶
func WithMultiExternalSelectFocusOnLoad() MultiExternalSelectOption
WithMultiExternalSelectFocusOnLoad sets auto-focus.
func WithMultiExternalSelectInitialOptions ¶
func WithMultiExternalSelectInitialOptions(options ...Option) MultiExternalSelectOption
WithMultiExternalSelectInitialOptions sets initially selected options.
func WithMultiExternalSelectMaxItems ¶
func WithMultiExternalSelectMaxItems(max int) MultiExternalSelectOption
WithMultiExternalSelectMaxItems sets max selectable items.
func WithMultiExternalSelectMinQueryLength ¶
func WithMultiExternalSelectMinQueryLength(length int) MultiExternalSelectOption
WithMultiExternalSelectMinQueryLength sets minimum characters before querying.
func WithMultiExternalSelectPlaceholder ¶
func WithMultiExternalSelectPlaceholder(text string) MultiExternalSelectOption
WithMultiExternalSelectPlaceholder sets placeholder text.
type MultiStaticSelect ¶
type MultiStaticSelect struct {
// contains filtered or unexported fields
}
MultiStaticSelect allows users to choose multiple options from a static list.
func NewMultiStaticSelect ¶
func NewMultiStaticSelect(options []Option, opts ...MultiStaticSelectOption) (MultiStaticSelect, error)
NewMultiStaticSelect creates a multi-select with options.
func NewMultiStaticSelectWithGroups ¶
func NewMultiStaticSelectWithGroups(groups []OptionGroup, opts ...MultiStaticSelectOption) (MultiStaticSelect, error)
NewMultiStaticSelectWithGroups creates a multi-select with option groups.
func (MultiStaticSelect) MarshalJSON ¶
func (m MultiStaticSelect) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type MultiStaticSelectOption ¶
type MultiStaticSelectOption func(*MultiStaticSelect)
MultiStaticSelectOption configures a MultiStaticSelect.
func WithMultiStaticSelectActionID ¶
func WithMultiStaticSelectActionID(id string) MultiStaticSelectOption
WithMultiStaticSelectActionID sets the action_id.
func WithMultiStaticSelectConfirm ¶
func WithMultiStaticSelectConfirm(confirm ConfirmDialog) MultiStaticSelectOption
WithMultiStaticSelectConfirm adds a confirmation dialog.
func WithMultiStaticSelectFocusOnLoad ¶
func WithMultiStaticSelectFocusOnLoad() MultiStaticSelectOption
WithMultiStaticSelectFocusOnLoad sets auto-focus.
func WithMultiStaticSelectInitialOptions ¶
func WithMultiStaticSelectInitialOptions(options ...Option) MultiStaticSelectOption
WithMultiStaticSelectInitialOptions sets initially selected options.
func WithMultiStaticSelectMaxItems ¶
func WithMultiStaticSelectMaxItems(max int) MultiStaticSelectOption
WithMultiStaticSelectMaxItems sets max selectable items.
func WithMultiStaticSelectPlaceholder ¶
func WithMultiStaticSelectPlaceholder(text string) MultiStaticSelectOption
WithMultiStaticSelectPlaceholder sets placeholder text.
type MultiUsersSelect ¶
type MultiUsersSelect struct {
// contains filtered or unexported fields
}
MultiUsersSelect allows selecting multiple users.
func NewMultiUsersSelect ¶
func NewMultiUsersSelect(opts ...MultiUsersSelectOption) MultiUsersSelect
NewMultiUsersSelect creates a multi-user select element.
func (MultiUsersSelect) MarshalJSON ¶
func (m MultiUsersSelect) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type MultiUsersSelectOption ¶
type MultiUsersSelectOption func(*MultiUsersSelect)
MultiUsersSelectOption configures a MultiUsersSelect.
func WithInitialUsers ¶
func WithInitialUsers(userIDs ...string) MultiUsersSelectOption
WithInitialUsers sets initially selected user IDs.
func WithMultiUsersSelectActionID ¶
func WithMultiUsersSelectActionID(id string) MultiUsersSelectOption
WithMultiUsersSelectActionID sets the action_id.
func WithMultiUsersSelectConfirm ¶
func WithMultiUsersSelectConfirm(confirm ConfirmDialog) MultiUsersSelectOption
WithMultiUsersSelectConfirm adds a confirmation dialog.
func WithMultiUsersSelectFocusOnLoad ¶
func WithMultiUsersSelectFocusOnLoad() MultiUsersSelectOption
WithMultiUsersSelectFocusOnLoad sets auto-focus.
func WithMultiUsersSelectMaxItems ¶
func WithMultiUsersSelectMaxItems(max int) MultiUsersSelectOption
WithMultiUsersSelectMaxItems sets max selectable items.
func WithMultiUsersSelectPlaceholder ¶
func WithMultiUsersSelectPlaceholder(text string) MultiUsersSelectOption
WithMultiUsersSelectPlaceholder sets placeholder text.
type NumberInput ¶
type NumberInput struct {
// contains filtered or unexported fields
}
NumberInput allows users to enter a number into a single-line field.
func NewNumberInput ¶
func NewNumberInput(isDecimalAllowed bool, opts ...NumberInputOption) NumberInput
NewNumberInput creates a new number input element. isDecimalAllowed specifies whether decimal numbers are allowed.
func (NumberInput) MarshalJSON ¶
func (n NumberInput) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type NumberInputOption ¶
type NumberInputOption func(*NumberInput)
NumberInputOption configures a NumberInput.
func WithNumberInputActionID ¶
func WithNumberInputActionID(id string) NumberInputOption
WithNumberInputActionID sets the action_id.
func WithNumberInputDispatchActionConfig ¶
func WithNumberInputDispatchActionConfig(config DispatchActionConfig) NumberInputOption
WithNumberInputDispatchActionConfig sets when to dispatch block_actions.
func WithNumberInputFocusOnLoad ¶
func WithNumberInputFocusOnLoad() NumberInputOption
WithNumberInputFocusOnLoad sets auto-focus.
func WithNumberInputInitialValue ¶
func WithNumberInputInitialValue(value string) NumberInputOption
WithNumberInputInitialValue sets the initial number value.
func WithNumberInputMaxValue ¶
func WithNumberInputMaxValue(value string) NumberInputOption
WithNumberInputMaxValue sets the maximum value.
func WithNumberInputMinValue ¶
func WithNumberInputMinValue(value string) NumberInputOption
WithNumberInputMinValue sets the minimum value.
func WithNumberInputPlaceholder ¶
func WithNumberInputPlaceholder(text string) NumberInputOption
WithNumberInputPlaceholder sets placeholder text. Max 150 characters.
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option represents an option composition object. Used in select menus, checkboxes, radio buttons, and overflow menus.
func NewOption ¶
func NewOption(text, value string, opts ...OptionConfig) (Option, error)
NewOption creates a new Option with plain text. text max: 75 chars, value max: 150 chars
func NewOptionWithMarkdown ¶
func NewOptionWithMarkdown(text, value string, opts ...OptionConfig) (Option, error)
NewOptionWithMarkdown creates an Option with markdown text. Only valid for checkboxes and radio buttons.
func (Option) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type OptionConfig ¶
type OptionConfig func(*Option)
OptionConfig configures an Option.
func WithDescription ¶
func WithDescription(description string) OptionConfig
WithDescription adds a description to the option. Max 75 characters.
func WithMarkdownDescription ¶
func WithMarkdownDescription(description string) OptionConfig
WithMarkdownDescription adds a markdown description (for checkboxes/radio).
func WithOptionURL ¶
func WithOptionURL(url string) OptionConfig
WithOptionURL adds a URL to the option (only for overflow menu). Max 3000 characters.
type OptionGroup ¶
type OptionGroup struct {
// contains filtered or unexported fields
}
OptionGroup represents an option group composition object. Groups options in select menus.
func NewOptionGroup ¶
func NewOptionGroup(label string, options []Option) (OptionGroup, error)
NewOptionGroup creates a new OptionGroup. label max: 75 chars, options max: 100 items
func (OptionGroup) MarshalJSON ¶
func (g OptionGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type Overflow ¶
type Overflow struct {
// contains filtered or unexported fields
}
Overflow represents an overflow menu element.
func NewOverflow ¶
func NewOverflow(options []Option, opts ...OverflowOption) (Overflow, error)
NewOverflow creates a new overflow menu. Requires 1-5 options.
func (Overflow) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type OverflowOption ¶
type OverflowOption func(*Overflow)
OverflowOption configures an Overflow.
func WithOverflowActionID ¶
func WithOverflowActionID(id string) OverflowOption
WithOverflowActionID sets the action_id.
func WithOverflowConfirm ¶
func WithOverflowConfirm(confirm ConfirmDialog) OverflowOption
WithOverflowConfirm adds a confirmation dialog.
type PlainText ¶
type PlainText struct {
// contains filtered or unexported fields
}
PlainText represents a plain_text composition object.
func MustPlainText ¶
func MustPlainText(text string, opts ...PlainTextOption) PlainText
MustPlainText creates a PlainText or panics on error.
func NewPlainText ¶
func NewPlainText(text string, opts ...PlainTextOption) (PlainText, error)
NewPlainText creates a new PlainText with the given text. By default, emoji rendering is enabled.
func (PlainText) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type PlainTextInput ¶
type PlainTextInput struct {
// contains filtered or unexported fields
}
PlainTextInput allows users to enter freeform text.
func NewPlainTextInput ¶
func NewPlainTextInput(opts ...PlainTextInputOption) PlainTextInput
NewPlainTextInput creates a new plain text input element.
func (PlainTextInput) MarshalJSON ¶
func (p PlainTextInput) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type PlainTextInputOption ¶
type PlainTextInputOption func(*PlainTextInput)
PlainTextInputOption configures a PlainTextInput.
func WithDispatchActionConfig ¶
func WithDispatchActionConfig(config DispatchActionConfig) PlainTextInputOption
WithDispatchActionConfig sets when to dispatch block_actions.
func WithInitialValue ¶
func WithInitialValue(value string) PlainTextInputOption
WithInitialValue sets the initial text value.
func WithMaxLength ¶
func WithMaxLength(max int) PlainTextInputOption
WithMaxLength sets maximum input length.
func WithMinLength ¶
func WithMinLength(min int) PlainTextInputOption
WithMinLength sets minimum input length.
func WithMultiline ¶
func WithMultiline() PlainTextInputOption
WithMultiline enables multiline input.
func WithPlainTextInputActionID ¶
func WithPlainTextInputActionID(id string) PlainTextInputOption
WithPlainTextInputActionID sets the action_id.
func WithPlainTextInputFocusOnLoad ¶
func WithPlainTextInputFocusOnLoad() PlainTextInputOption
WithPlainTextInputFocusOnLoad sets auto-focus.
func WithPlainTextInputPlaceholder ¶
func WithPlainTextInputPlaceholder(text string) PlainTextInputOption
WithPlainTextInputPlaceholder sets placeholder text. Max 150 characters.
type PlainTextOnly ¶
type PlainTextOnly interface {
TextObject
// contains filtered or unexported methods
}
PlainTextOnly restricts to plain_text only. Used for headers, placeholders, button text, etc.
type PlainTextOption ¶
type PlainTextOption func(*PlainText)
PlainTextOption configures a PlainText.
func WithEmoji ¶
func WithEmoji(emoji bool) PlainTextOption
WithEmoji sets whether to render emoji codes.
type Plan ¶
type Plan struct {
// contains filtered or unexported fields
}
Plan displays a collection of related tasks. Available in messages only.
func MustPlan ¶
func MustPlan(title string, sections []PlanSection, opts ...PlanOption) Plan
MustPlan creates a Plan or panics on error.
func NewPlan ¶
func NewPlan(title string, sections []PlanSection, opts ...PlanOption) (Plan, error)
NewPlan creates a new plan block.
func (Plan) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type PlanItem ¶
type PlanItem struct {
// contains filtered or unexported fields
}
PlanItem represents an item within a plan section.
func MustPlanItem ¶
func MustPlanItem(text string, status PlanItemStatus) PlanItem
MustPlanItem creates a PlanItem or panics on error.
func NewPlanItem ¶
func NewPlanItem(text string, status PlanItemStatus) (PlanItem, error)
NewPlanItem creates a new plan item.
func (PlanItem) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type PlanItemStatus ¶
type PlanItemStatus string
PlanItemStatus represents the status of a plan item.
const ( PlanItemStatusPending PlanItemStatus = "pending" PlanItemStatusInProgress PlanItemStatus = "in_progress" PlanItemStatusComplete PlanItemStatus = "complete" )
type PlanOption ¶
type PlanOption func(*Plan)
PlanOption configures a Plan block.
func WithPlanBlockID ¶
func WithPlanBlockID(id string) PlanOption
WithPlanBlockID sets the block_id.
type PlanSection ¶
type PlanSection struct {
// contains filtered or unexported fields
}
PlanSection represents a section within a plan.
func MustPlanSection ¶
func MustPlanSection(title string, items []PlanItem) PlanSection
MustPlanSection creates a PlanSection or panics on error.
func NewPlanSection ¶
func NewPlanSection(title string, items []PlanItem) (PlanSection, error)
NewPlanSection creates a new plan section.
func (PlanSection) MarshalJSON ¶
func (s PlanSection) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type RadioButtons ¶
type RadioButtons struct {
// contains filtered or unexported fields
}
RadioButtons allows users to choose one item from a list.
func NewRadioButtons ¶
func NewRadioButtons(options []Option, opts ...RadioButtonsOption) (RadioButtons, error)
NewRadioButtons creates a new radio buttons element. Max 10 options.
func (RadioButtons) MarshalJSON ¶
func (r RadioButtons) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type RadioButtonsOption ¶
type RadioButtonsOption func(*RadioButtons)
RadioButtonsOption configures a RadioButtons element.
func WithRadioButtonInitialOption ¶
func WithRadioButtonInitialOption(option Option) RadioButtonsOption
WithRadioButtonInitialOption sets the initially selected option.
func WithRadioButtonsActionID ¶
func WithRadioButtonsActionID(id string) RadioButtonsOption
WithRadioButtonsActionID sets the action_id.
func WithRadioButtonsConfirm ¶
func WithRadioButtonsConfirm(confirm ConfirmDialog) RadioButtonsOption
WithRadioButtonsConfirm adds a confirmation dialog.
func WithRadioButtonsFocusOnLoad ¶
func WithRadioButtonsFocusOnLoad() RadioButtonsOption
WithRadioButtonsFocusOnLoad sets auto-focus.
type RichText ¶
type RichText struct {
// contains filtered or unexported fields
}
RichText displays formatted, structured representation of text.
func MustRichText ¶
func MustRichText(elements []RichTextElement, opts ...RichTextOption) RichText
MustRichText creates a RichText or panics on error.
func NewRichText ¶
func NewRichText(elements []RichTextElement, opts ...RichTextOption) (RichText, error)
NewRichText creates a new rich text block.
func (RichText) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type RichTextBroadcast ¶
type RichTextBroadcast struct {
// contains filtered or unexported fields
}
RichTextBroadcast represents a broadcast mention (@channel, @here, @everyone).
func NewRichTextBroadcast ¶
func NewRichTextBroadcast(rang string) RichTextBroadcast
NewRichTextBroadcast creates a new broadcast mention. rang: "channel", "here", or "everyone"
func (RichTextBroadcast) MarshalJSON ¶
func (b RichTextBroadcast) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type RichTextChannel ¶
type RichTextChannel struct {
// contains filtered or unexported fields
}
RichTextChannel represents a channel mention in a rich text section.
func NewRichTextChannel ¶
func NewRichTextChannel(channelID string, style *RichTextStyle) RichTextChannel
NewRichTextChannel creates a new channel mention for rich text sections.
func (RichTextChannel) MarshalJSON ¶
func (c RichTextChannel) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type RichTextElement ¶
RichTextElement marks elements valid in rich text blocks. Valid types: RichTextSection, RichTextList, RichTextPreformatted, RichTextQuote
type RichTextEmoji ¶
type RichTextEmoji struct {
// contains filtered or unexported fields
}
RichTextEmoji represents an emoji in a rich text section.
func NewRichTextEmoji ¶
func NewRichTextEmoji(name string) RichTextEmoji
NewRichTextEmoji creates a new emoji element for rich text sections.
func (RichTextEmoji) MarshalJSON ¶
func (e RichTextEmoji) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type RichTextInput ¶
type RichTextInput struct {
// contains filtered or unexported fields
}
RichTextInput allows users to enter formatted text in a WYSIWYG composer.
func NewRichTextInput ¶
func NewRichTextInput(opts ...RichTextInputOption) RichTextInput
NewRichTextInput creates a new rich text input element.
func (RichTextInput) MarshalJSON ¶
func (r RichTextInput) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type RichTextInputOption ¶
type RichTextInputOption func(*RichTextInput)
RichTextInputOption configures a RichTextInput.
func WithRichTextInputActionID ¶
func WithRichTextInputActionID(id string) RichTextInputOption
WithRichTextInputActionID sets the action_id.
func WithRichTextInputDispatchActionConfig ¶
func WithRichTextInputDispatchActionConfig(config DispatchActionConfig) RichTextInputOption
WithRichTextInputDispatchActionConfig sets when to dispatch block_actions.
func WithRichTextInputFocusOnLoad ¶
func WithRichTextInputFocusOnLoad() RichTextInputOption
WithRichTextInputFocusOnLoad sets auto-focus.
func WithRichTextInputInitialValue ¶
func WithRichTextInputInitialValue(value *RichText) RichTextInputOption
WithRichTextInputInitialValue sets the initial rich text value.
func WithRichTextInputPlaceholder ¶
func WithRichTextInputPlaceholder(text string) RichTextInputOption
WithRichTextInputPlaceholder sets placeholder text. Max 150 characters.
type RichTextLink ¶
type RichTextLink struct {
// contains filtered or unexported fields
}
RichTextLink represents a link in a rich text section.
func NewRichTextLink ¶
func NewRichTextLink(url string, text string, style *RichTextStyle) RichTextLink
NewRichTextLink creates a new link element for rich text sections.
func (RichTextLink) MarshalJSON ¶
func (l RichTextLink) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type RichTextList ¶
type RichTextList struct {
// contains filtered or unexported fields
}
RichTextList represents a list in rich text.
func NewRichTextList ¶
func NewRichTextList(style string, elements []RichTextSection, opts ...RichTextListOption) RichTextList
NewRichTextList creates a new rich text list. style: "bullet" or "ordered"
func (RichTextList) MarshalJSON ¶
func (l RichTextList) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type RichTextListOption ¶
type RichTextListOption func(*RichTextList)
RichTextListOption configures a RichTextList.
func WithRichTextListBorder ¶
func WithRichTextListBorder(border int) RichTextListOption
WithRichTextListBorder sets the border (0 or 1).
func WithRichTextListIndent ¶
func WithRichTextListIndent(indent int) RichTextListOption
WithRichTextListIndent sets the indent level (0-8).
func WithRichTextListOffset ¶
func WithRichTextListOffset(offset int) RichTextListOption
WithRichTextListOffset sets the offset for ordered lists.
type RichTextOption ¶
type RichTextOption func(*RichText)
RichTextOption configures a RichText block.
func WithRichTextBlockID ¶
func WithRichTextBlockID(id string) RichTextOption
WithRichTextBlockID sets the block_id.
type RichTextPreformatted ¶
type RichTextPreformatted struct {
// contains filtered or unexported fields
}
RichTextPreformatted represents preformatted text (code block).
func NewRichTextPreformatted ¶
func NewRichTextPreformatted(elements []RichTextSectionElement, border int) RichTextPreformatted
NewRichTextPreformatted creates a new preformatted text element.
func (RichTextPreformatted) MarshalJSON ¶
func (p RichTextPreformatted) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type RichTextQuote ¶
type RichTextQuote struct {
// contains filtered or unexported fields
}
RichTextQuote represents a quote in rich text.
func NewRichTextQuote ¶
func NewRichTextQuote(elements []RichTextSectionElement, border int) RichTextQuote
NewRichTextQuote creates a new quote element.
func (RichTextQuote) MarshalJSON ¶
func (q RichTextQuote) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type RichTextSection ¶
type RichTextSection struct {
// contains filtered or unexported fields
}
RichTextSection represents a section of rich text content.
func NewRichTextSection ¶
func NewRichTextSection(elements []RichTextSectionElement) RichTextSection
NewRichTextSection creates a new rich text section.
func (RichTextSection) MarshalJSON ¶
func (s RichTextSection) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type RichTextSectionElement ¶
RichTextSectionElement is an element within a rich text section.
type RichTextStyle ¶
type RichTextStyle struct {
Bold bool `json:"bold,omitempty"`
Italic bool `json:"italic,omitempty"`
Strike bool `json:"strike,omitempty"`
Code bool `json:"code,omitempty"`
}
RichTextStyle defines text styling options.
func NewRichTextStyle ¶
func NewRichTextStyle(bold, italic, strike, code bool) *RichTextStyle
NewRichTextStyle creates a new style configuration.
type RichTextText ¶
type RichTextText struct {
// contains filtered or unexported fields
}
RichTextText represents plain or styled text in a rich text section.
func NewRichTextText ¶
func NewRichTextText(text string, style *RichTextStyle) RichTextText
NewRichTextText creates a new text element for rich text sections.
func (RichTextText) MarshalJSON ¶
func (t RichTextText) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type RichTextUser ¶
type RichTextUser struct {
// contains filtered or unexported fields
}
RichTextUser represents a user mention in a rich text section.
func NewRichTextUser ¶
func NewRichTextUser(userID string, style *RichTextStyle) RichTextUser
NewRichTextUser creates a new user mention for rich text sections.
func (RichTextUser) MarshalJSON ¶
func (u RichTextUser) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type RichTextUserGroup ¶
type RichTextUserGroup struct {
// contains filtered or unexported fields
}
RichTextUserGroup represents a user group mention in a rich text section.
func NewRichTextUserGroup ¶
func NewRichTextUserGroup(usergroupID string, style *RichTextStyle) RichTextUserGroup
NewRichTextUserGroup creates a new user group mention for rich text sections.
func (RichTextUserGroup) MarshalJSON ¶
func (g RichTextUserGroup) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type Section ¶
type Section struct {
// contains filtered or unexported fields
}
Section is a flexible block for displaying text and accessories.
func MustSection ¶
func MustSection(text TextObject, opts ...SectionOption) Section
MustSection creates a Section or panics on error.
func NewSection ¶
func NewSection(text TextObject, opts ...SectionOption) (Section, error)
NewSection creates a section with text.
func NewSectionWithFields ¶
func NewSectionWithFields(fields []TextObject, opts ...SectionOption) (Section, error)
NewSectionWithFields creates a section with fields instead of text. Max 10 fields.
func (Section) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type SectionAccessory ¶
SectionAccessory marks elements valid as section block accessories. Valid types: Button, ImageElement, StaticSelect, MultiStaticSelect, ExternalSelect, MultiExternalSelect, UsersSelect, MultiUsersSelect, ConversationsSelect, MultiConversationsSelect, ChannelsSelect, MultiChannelsSelect, DatePicker, TimePicker, Checkboxes, RadioButtons, Overflow
type SectionOption ¶
type SectionOption func(*Section)
SectionOption configures a Section.
func WithSectionAccessory ¶
func WithSectionAccessory(accessory SectionAccessory) SectionOption
WithSectionAccessory adds an accessory element. Type-safety is enforced via the SectionAccessory interface.
func WithSectionBlockID ¶
func WithSectionBlockID(id string) SectionOption
WithSectionBlockID sets the block_id.
func WithSectionFields ¶
func WithSectionFields(fields ...TextObject) SectionOption
WithSectionFields adds fields to the section. Max 10 fields.
type SlackFile ¶
type SlackFile struct {
// contains filtered or unexported fields
}
SlackFile represents a Slack file composition object. Used in image blocks/elements to reference Slack-hosted files. Either URL or ID must be provided, but not both.
func NewSlackFileFromID ¶
NewSlackFileFromID creates a SlackFile from a Slack file ID.
func NewSlackFileFromURL ¶
NewSlackFileFromURL creates a SlackFile from a URL. The URL can be url_private or permalink of a Slack file.
func (SlackFile) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type StaticSelect ¶
type StaticSelect struct {
// contains filtered or unexported fields
}
StaticSelect allows users to choose one option from a static list.
func NewStaticSelect ¶
func NewStaticSelect(options []Option, opts ...StaticSelectOption) (StaticSelect, error)
NewStaticSelect creates a static select with options. Max 100 options.
func NewStaticSelectWithGroups ¶
func NewStaticSelectWithGroups(groups []OptionGroup, opts ...StaticSelectOption) (StaticSelect, error)
NewStaticSelectWithGroups creates a static select with option groups. Max 100 groups.
func (StaticSelect) MarshalJSON ¶
func (s StaticSelect) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type StaticSelectOption ¶
type StaticSelectOption func(*StaticSelect)
StaticSelectOption configures a StaticSelect.
func WithStaticSelectActionID ¶
func WithStaticSelectActionID(id string) StaticSelectOption
WithStaticSelectActionID sets the action_id.
func WithStaticSelectConfirm ¶
func WithStaticSelectConfirm(confirm ConfirmDialog) StaticSelectOption
WithStaticSelectConfirm adds a confirmation dialog.
func WithStaticSelectFocusOnLoad ¶
func WithStaticSelectFocusOnLoad() StaticSelectOption
WithStaticSelectFocusOnLoad sets auto-focus.
func WithStaticSelectInitialOption ¶
func WithStaticSelectInitialOption(option Option) StaticSelectOption
WithStaticSelectInitialOption sets the initially selected option.
func WithStaticSelectPlaceholder ¶
func WithStaticSelectPlaceholder(text string) StaticSelectOption
WithStaticSelectPlaceholder sets placeholder text.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table displays structured information in a table format. Available in messages only.
func MustTable ¶
func MustTable(columns []TableColumn, rows []TableRow, opts ...TableOption) Table
MustTable creates a Table or panics on error.
func NewTable ¶
func NewTable(columns []TableColumn, rows []TableRow, opts ...TableOption) (Table, error)
NewTable creates a new table block.
func (Table) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type TableCell ¶
type TableCell struct {
// contains filtered or unexported fields
}
TableCell represents a cell in a table row.
func NewTableCell ¶
func NewTableCell(columnID string, value TableCellValue) TableCell
NewTableCell creates a new table cell.
func (TableCell) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type TableCellRichText ¶
type TableCellRichText struct {
// contains filtered or unexported fields
}
TableCellRichText is a rich text value for a table cell.
func NewTableCellRichText ¶
func NewTableCellRichText(elements []RichTextElement) TableCellRichText
NewTableCellRichText creates a new rich text value for a table cell.
func (TableCellRichText) MarshalJSON ¶
func (r TableCellRichText) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type TableCellText ¶
type TableCellText struct {
// contains filtered or unexported fields
}
TableCellText is a text value for a table cell.
func NewTableCellText ¶
func NewTableCellText(text string) TableCellText
NewTableCellText creates a new text value for a table cell.
func (TableCellText) MarshalJSON ¶
func (t TableCellText) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type TableCellValue ¶
TableCellValue represents the value content of a table cell.
type TableColumn ¶
type TableColumn struct {
// contains filtered or unexported fields
}
TableColumn defines a column in a table.
func NewTableColumn ¶
func NewTableColumn(id, name string, opts ...TableColumnOption) TableColumn
NewTableColumn creates a new table column.
func (TableColumn) MarshalJSON ¶
func (c TableColumn) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type TableColumnOption ¶
type TableColumnOption func(*TableColumn)
TableColumnOption configures a TableColumn.
func WithTableColumnWidth ¶
func WithTableColumnWidth(width int) TableColumnOption
WithTableColumnWidth sets the column width.
type TableOption ¶
type TableOption func(*Table)
TableOption configures a Table block.
func WithTableBlockID ¶
func WithTableBlockID(id string) TableOption
WithTableBlockID sets the block_id.
type TableRow ¶
type TableRow struct {
// contains filtered or unexported fields
}
TableRow represents a row in a table.
func NewTableRow ¶
NewTableRow creates a new table row.
func (TableRow) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type TaskCard ¶
type TaskCard struct {
// contains filtered or unexported fields
}
TaskCard displays a single task, representing a single action. Available in messages only.
func MustTaskCard ¶
func MustTaskCard(taskID, title string, status TaskCardStatus, opts ...TaskCardOption) TaskCard
MustTaskCard creates a TaskCard or panics on error.
func NewTaskCard ¶
func NewTaskCard(taskID, title string, status TaskCardStatus, opts ...TaskCardOption) (TaskCard, error)
NewTaskCard creates a new task card block.
func (TaskCard) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type TaskCardOption ¶
type TaskCardOption func(*TaskCard)
TaskCardOption configures a TaskCard block.
func WithTaskCardBlockID ¶
func WithTaskCardBlockID(id string) TaskCardOption
WithTaskCardBlockID sets the block_id.
func WithTaskCardDescription ¶
func WithTaskCardDescription(text string) TaskCardOption
WithTaskCardDescription sets the description.
func WithTaskCardSources ¶
func WithTaskCardSources(sources []URLSource) TaskCardOption
WithTaskCardSources sets the URL sources.
type TaskCardStatus ¶
type TaskCardStatus string
TaskCardStatus represents the status of a task.
const ( TaskCardStatusOpen TaskCardStatus = "open" TaskCardStatusInProgress TaskCardStatus = "in_progress" TaskCardStatusComplete TaskCardStatus = "complete" )
type TextObject ¶
TextObject represents any text composition object (plain_text or mrkdwn).
type TimePicker ¶
type TimePicker struct {
// contains filtered or unexported fields
}
TimePicker allows users to select a time.
func NewTimePicker ¶
func NewTimePicker(opts ...TimePickerOption) TimePicker
NewTimePicker creates a new time picker element.
func (TimePicker) MarshalJSON ¶
func (t TimePicker) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type TimePickerOption ¶
type TimePickerOption func(*TimePicker)
TimePickerOption configures a TimePicker.
func WithInitialTime ¶
func WithInitialTime(time string) TimePickerOption
WithInitialTime sets the initially selected time. Format: HH:mm
func WithTimePickerActionID ¶
func WithTimePickerActionID(id string) TimePickerOption
WithTimePickerActionID sets the action_id.
func WithTimePickerConfirm ¶
func WithTimePickerConfirm(confirm ConfirmDialog) TimePickerOption
WithTimePickerConfirm adds a confirmation dialog.
func WithTimePickerFocusOnLoad ¶
func WithTimePickerFocusOnLoad() TimePickerOption
WithTimePickerFocusOnLoad sets auto-focus.
func WithTimePickerPlaceholder ¶
func WithTimePickerPlaceholder(text string) TimePickerOption
WithTimePickerPlaceholder sets placeholder text.
func WithTimezone ¶
func WithTimezone(tz string) TimePickerOption
WithTimezone sets the timezone for the time picker.
type Trigger ¶
type Trigger struct {
// contains filtered or unexported fields
}
Trigger defines a workflow trigger with URL and optional input parameters.
func MustTrigger ¶
func MustTrigger(url string, opts ...TriggerOption) Trigger
MustTrigger creates a Trigger or panics on error.
func NewTrigger ¶
func NewTrigger(url string, opts ...TriggerOption) (Trigger, error)
NewTrigger creates a new trigger with the given URL.
func (Trigger) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type TriggerAction ¶
type TriggerAction string
TriggerAction represents when to dispatch a block_actions payload.
const ( TriggerOnEnterPressed TriggerAction = "on_enter_pressed" TriggerOnCharacterEntered TriggerAction = "on_character_entered" )
type TriggerOption ¶
type TriggerOption func(*Trigger)
TriggerOption configures a Trigger.
func WithInputParameters ¶
func WithInputParameters(params ...InputParameter) TriggerOption
WithInputParameters sets the customizable input parameters.
type URLInput ¶
type URLInput struct {
// contains filtered or unexported fields
}
URLInput allows users to enter a URL into a single-line field.
func NewURLInput ¶
func NewURLInput(opts ...URLInputOption) URLInput
NewURLInput creates a new URL input element.
func (URLInput) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type URLInputOption ¶
type URLInputOption func(*URLInput)
URLInputOption configures a URLInput.
func WithURLInputActionID ¶
func WithURLInputActionID(id string) URLInputOption
WithURLInputActionID sets the action_id.
func WithURLInputDispatchActionConfig ¶
func WithURLInputDispatchActionConfig(config DispatchActionConfig) URLInputOption
WithURLInputDispatchActionConfig sets when to dispatch block_actions.
func WithURLInputFocusOnLoad ¶
func WithURLInputFocusOnLoad() URLInputOption
WithURLInputFocusOnLoad sets auto-focus.
func WithURLInputInitialValue ¶
func WithURLInputInitialValue(value string) URLInputOption
WithURLInputInitialValue sets the initial URL value.
func WithURLInputPlaceholder ¶
func WithURLInputPlaceholder(text string) URLInputOption
WithURLInputPlaceholder sets placeholder text. Max 150 characters.
type URLSource ¶
type URLSource struct {
// contains filtered or unexported fields
}
URLSource represents a URL source for referencing within a task card.
func MustURLSource ¶
func MustURLSource(url string, opts ...URLSourceOption) URLSource
MustURLSource creates a URLSource or panics on error.
func NewURLSource ¶
func NewURLSource(url string, opts ...URLSourceOption) (URLSource, error)
NewURLSource creates a new URL source element.
func (URLSource) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type URLSourceOption ¶
type URLSourceOption func(*URLSource)
URLSourceOption configures a URLSource.
func WithURLSourceTitle ¶
func WithURLSourceTitle(title string) URLSourceOption
WithURLSourceTitle sets the title for the URL source.
type UsersSelect ¶
type UsersSelect struct {
// contains filtered or unexported fields
}
UsersSelect allows users to select a user from the workspace.
func NewUsersSelect ¶
func NewUsersSelect(opts ...UsersSelectOption) UsersSelect
NewUsersSelect creates a user select element.
func (UsersSelect) MarshalJSON ¶
func (u UsersSelect) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type UsersSelectOption ¶
type UsersSelectOption func(*UsersSelect)
UsersSelectOption configures a UsersSelect.
func WithInitialUser ¶
func WithInitialUser(userID string) UsersSelectOption
WithInitialUser sets the initially selected user ID.
func WithUsersSelectActionID ¶
func WithUsersSelectActionID(id string) UsersSelectOption
WithUsersSelectActionID sets the action_id.
func WithUsersSelectConfirm ¶
func WithUsersSelectConfirm(confirm ConfirmDialog) UsersSelectOption
WithUsersSelectConfirm adds a confirmation dialog.
func WithUsersSelectFocusOnLoad ¶
func WithUsersSelectFocusOnLoad() UsersSelectOption
WithUsersSelectFocusOnLoad sets auto-focus.
func WithUsersSelectPlaceholder ¶
func WithUsersSelectPlaceholder(text string) UsersSelectOption
WithUsersSelectPlaceholder sets placeholder text.
type ValidationError ¶
ValidationError represents a validation failure with context.
func (ValidationError) Error ¶
func (e ValidationError) Error() string
func (ValidationError) Unwrap ¶
func (e ValidationError) Unwrap() error
type Video ¶
type Video struct {
// contains filtered or unexported fields
}
Video displays an embedded video player.
func MustVideo ¶
func MustVideo(altText, title, thumbnailURL, videoURL string, opts ...VideoOption) Video
MustVideo creates a Video or panics on error.
func NewVideo ¶
func NewVideo(altText, title, thumbnailURL, videoURL string, opts ...VideoOption) (Video, error)
NewVideo creates a new video block. altText: max 2000 characters title: max 200 characters
func (Video) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type VideoOption ¶
type VideoOption func(*Video)
VideoOption configures a Video block.
func WithVideoAuthorName ¶
func WithVideoAuthorName(name string) VideoOption
WithVideoAuthorName sets the author name.
func WithVideoBlockID ¶
func WithVideoBlockID(id string) VideoOption
WithVideoBlockID sets the block_id.
func WithVideoDescription ¶
func WithVideoDescription(text string) VideoOption
WithVideoDescription sets the description.
func WithVideoProviderIconURL ¶
func WithVideoProviderIconURL(url string) VideoOption
WithVideoProviderIconURL sets the provider icon URL.
func WithVideoProviderName ¶
func WithVideoProviderName(name string) VideoOption
WithVideoProviderName sets the provider name.
func WithVideoTitleURL ¶
func WithVideoTitleURL(url string) VideoOption
WithVideoTitleURL sets the title URL (clickable link).
type Workflow ¶
type Workflow struct {
// contains filtered or unexported fields
}
Workflow defines a workflow object containing trigger information.
func NewWorkflow ¶
NewWorkflow creates a new workflow with the given trigger.
func (Workflow) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
type WorkflowButton ¶
type WorkflowButton struct {
// contains filtered or unexported fields
}
WorkflowButton allows users to run a link trigger with customizable inputs.
func MustWorkflowButton ¶
func MustWorkflowButton(text string, workflow Workflow, opts ...WorkflowButtonOption) WorkflowButton
MustWorkflowButton creates a WorkflowButton or panics on error.
func NewWorkflowButton ¶
func NewWorkflowButton(text string, workflow Workflow, opts ...WorkflowButtonOption) (WorkflowButton, error)
NewWorkflowButton creates a new workflow button element. text max: 75 characters
func (WorkflowButton) MarshalJSON ¶
func (w WorkflowButton) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
type WorkflowButtonOption ¶
type WorkflowButtonOption func(*WorkflowButton)
WorkflowButtonOption configures a WorkflowButton.
func WithWorkflowButtonAccessibilityLabel ¶
func WithWorkflowButtonAccessibilityLabel(label string) WorkflowButtonOption
WithWorkflowButtonAccessibilityLabel sets the accessibility label. Max 75 characters.
func WithWorkflowButtonActionID ¶
func WithWorkflowButtonActionID(id string) WorkflowButtonOption
WithWorkflowButtonActionID sets the action_id.
func WithWorkflowButtonStyle ¶
func WithWorkflowButtonStyle(style ButtonStyle) WorkflowButtonOption
WithWorkflowButtonStyle sets the button style (primary or danger).
Source Files
¶
- base_builder.go
- base_errors.go
- base_id.go
- base_interfaces.go
- block_actions.go
- block_context.go
- block_context_actions.go
- block_divider.go
- block_file.go
- block_header.go
- block_image.go
- block_input.go
- block_markdown.go
- block_plan.go
- block_rich_text.go
- block_section.go
- block_table.go
- block_task_card.go
- block_video.go
- comp_confirm.go
- comp_filter.go
- comp_option.go
- comp_slack_file.go
- comp_text.go
- comp_workflow.go
- elem_button.go
- elem_checkboxes.go
- elem_datepicker.go
- elem_datetimepicker.go
- elem_email_input.go
- elem_feedback_buttons.go
- elem_file_input.go
- elem_icon_button.go
- elem_image.go
- elem_number_input.go
- elem_overflow.go
- elem_plain_text_input.go
- elem_radio_buttons.go
- elem_rich_text_input.go
- elem_select_channels.go
- elem_select_conversations.go
- elem_select_external.go
- elem_select_static.go
- elem_select_users.go
- elem_timepicker.go
- elem_url_input.go
- elem_workflow_button.go
- surface_home_tab.go
- surface_message.go
- surface_modal.go