steps

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action added in v0.0.23

type Action struct {
	model.PostAction
	OnClick func(userID string) (int, Attachment)
	Dialog  *Dialog
}

type Attachment added in v0.0.23

type Attachment struct {
	SlackAttachment *model.SlackAttachment
	Actions         []Action
}

func (*Attachment) ToSlackAttachment added in v0.0.23

func (a *Attachment) ToSlackAttachment() *model.SlackAttachment

type Button added in v0.0.23

type Button struct {
	Name     string
	Disabled bool
	Style    Color
	OnClick  func(userID string) int

	Dialog *Dialog
}

type Color added in v0.0.23

type Color string
const (
	ColorDefault Color = "default"
	ColorPrimary Color = "primary"
	ColorSuccess Color = "success"
	ColorGood    Color = "good"
	ColorWarning Color = "warning"
	ColorDanger  Color = "danger"
)

type CustomStepBuilder added in v0.0.23

type CustomStepBuilder struct {
	// contains filtered or unexported fields
}

func NewCustomStepBuilder added in v0.0.23

func NewCustomStepBuilder(name, title, message string) *CustomStepBuilder

NewCustomStepBuilder create a new builder for a custom step.

name must be a unique identifier for a step within the plugin.

func (*CustomStepBuilder) Build added in v0.0.23

func (b *CustomStepBuilder) Build() Step

func (*CustomStepBuilder) IsNotEmpty added in v0.0.23

func (b *CustomStepBuilder) IsNotEmpty() *CustomStepBuilder

func (*CustomStepBuilder) WithButton added in v0.0.23

func (b *CustomStepBuilder) WithButton(button Button) *CustomStepBuilder

func (*CustomStepBuilder) WithColor added in v0.0.23

func (b *CustomStepBuilder) WithColor(color Color) *CustomStepBuilder

func (*CustomStepBuilder) WithImage added in v0.0.23

func (b *CustomStepBuilder) WithImage(path string) *CustomStepBuilder

func (*CustomStepBuilder) WithPretext added in v0.0.23

func (b *CustomStepBuilder) WithPretext(text string) *CustomStepBuilder

type Dialog added in v0.0.23

type Dialog struct {
	Dialog         model.Dialog
	OnDialogSubmit func(userID string, submission map[string]interface{}) (int, *Attachment, string, map[string]string)
	OnCancel       func(userID string) (int, *Attachment)
}

type EmptyStep added in v0.0.23

type EmptyStep struct {
	OnRender func(userID string)
	// contains filtered or unexported fields
}

func NewEmptyStep

func NewEmptyStep(name, title, message string) *EmptyStep

func (*EmptyStep) Attachment added in v0.0.23

func (s *EmptyStep) Attachment(pluginURL string) Attachment

func (*EmptyStep) IsEmpty added in v0.0.23

func (s *EmptyStep) IsEmpty() bool

func (*EmptyStep) Name added in v0.0.23

func (s *EmptyStep) Name() string

type Step

type Step interface {
	Attachment(pluginURL string) Attachment
	Name() string
	IsEmpty() bool
}

func NewSimpleStep

func NewSimpleStep(
	name,
	title,
	message,
	trueButtonMessage,
	falseButtonMessage,
	trueResponseMessage,
	falseResponseMessage string,
	trueSkip,
	falseSkip int,
) Step

Jump to

Keyboard shortcuts

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