summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/slack-go/slack/block_header.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-09-04 23:29:13 +0200
committerGitHub <noreply@github.com>2020-09-04 23:29:13 +0200
commit2f59abdda7a1072036ea1fdb4c859cccbb56efa6 (patch)
treee35393f23d12783ae92f0469085efc7dec953f82 /vendor/github.com/slack-go/slack/block_header.go
parent17747a5c8893fd47ba8eb61dd10477170640caf6 (diff)
downloadmatterbridge-msglm-2f59abdda7a1072036ea1fdb4c859cccbb56efa6.tar.gz
matterbridge-msglm-2f59abdda7a1072036ea1fdb4c859cccbb56efa6.tar.bz2
matterbridge-msglm-2f59abdda7a1072036ea1fdb4c859cccbb56efa6.zip
Update vendor (#1228)
Diffstat (limited to 'vendor/github.com/slack-go/slack/block_header.go')
-rw-r--r--vendor/github.com/slack-go/slack/block_header.go38
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/github.com/slack-go/slack/block_header.go b/vendor/github.com/slack-go/slack/block_header.go
new file mode 100644
index 00000000..6dff4b88
--- /dev/null
+++ b/vendor/github.com/slack-go/slack/block_header.go
@@ -0,0 +1,38 @@
+package slack
+
+// HeaderBlock defines a new block of type header
+//
+// More Information: https://api.slack.com/reference/messaging/blocks#header
+type HeaderBlock struct {
+ Type MessageBlockType `json:"type"`
+ Text *TextBlockObject `json:"text,omitempty"`
+ BlockID string `json:"block_id,omitempty"`
+}
+
+// BlockType returns the type of the block
+func (s HeaderBlock) BlockType() MessageBlockType {
+ return s.Type
+}
+
+// HeaderBlockOption allows configuration of options for a new header block
+type HeaderBlockOption func(*HeaderBlock)
+
+func HeaderBlockOptionBlockID(blockID string) HeaderBlockOption {
+ return func(block *HeaderBlock) {
+ block.BlockID = blockID
+ }
+}
+
+// NewHeaderBlock returns a new instance of a header block to be rendered
+func NewHeaderBlock(textObj *TextBlockObject, options ...HeaderBlockOption) *HeaderBlock {
+ block := HeaderBlock{
+ Type: MBTHeader,
+ Text: textObj,
+ }
+
+ for _, option := range options {
+ option(&block)
+ }
+
+ return &block
+}