step

package
v0.0.0-...-2d59575 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

type Processor func(echo.Context) error

Processor 步骤处理逻辑

type Step

type Step struct {
	Name        string // 英文标识名
	Title       string // 步骤标题
	Description string // 步骤说明
	Active      bool   // 是否已完成步骤
	Index       int
	Config      echo.H
	// contains filtered or unexported fields
}

Step 单个步骤信息

func New

func New(stepName string, titleAndDescription ...string) *Step

New 创建新的步骤

func (*Step) AddProcessor

func (s *Step) AddProcessor(processors ...Processor) *Step

AddProcessor 添加处理逻辑

func (*Step) Next

func (s *Step) Next(ss *Steps) *Step

Next 下一步

func (*Step) Prev

func (s *Step) Prev(ss *Steps) *Step

Prev 上一步

func (*Step) Process

func (s *Step) Process(ctx echo.Context) error

Process 执行处理逻辑

func (*Step) SetActive

func (s *Step) SetActive(active bool) *Step

func (*Step) SetActiveByCurrentIndex

func (s *Step) SetActiveByCurrentIndex(currentIndex int) *Step

func (*Step) SetConfig

func (s *Step) SetConfig(config echo.H) *Step

func (*Step) SetConfigKV

func (s *Step) SetConfigKV(key string, value interface{}) *Step

func (*Step) SetDescription

func (s *Step) SetDescription(description string) *Step

func (*Step) SetTitle

func (s *Step) SetTitle(title string) *Step

type Steps

type Steps struct {
	Idents []string
	Detail map[string]*Step
}

Steps 步骤集合

func NewGroup

func NewGroup() *Steps

NewGroup 创建新的步骤集

func (*Steps) Add

func (s *Steps) Add(stepName string, processors ...Processor) *Steps

Add 添加步骤

func (*Steps) AddStep

func (s *Steps) AddStep(step *Step) *Steps

AddStep 添加步骤

func (*Steps) First

func (s *Steps) First() *Step

First 第一步

func (*Steps) Get

func (s *Steps) Get(stepName string) *Step

Get 根据名称获取

func (*Steps) GetAny

func (s *Steps) GetAny(stepNames ...string) *Step

GetAny 根据名称获取

func (*Steps) GetDescription

func (s *Steps) GetDescription(stepName string) string

func (*Steps) GetIndex

func (s *Steps) GetIndex(stepName string) int

func (*Steps) GetTitle

func (s *Steps) GetTitle(stepName string) string

func (*Steps) Last

func (s *Steps) Last() *Step

Last 最后一步

func (*Steps) Max

func (s *Steps) Max() int

func (*Steps) Next

func (s *Steps) Next(index int) *Step

Next 下一步

func (*Steps) NextByName

func (s *Steps) NextByName(stepName string) *Step

NextByName 下一步

func (*Steps) Prev

func (s *Steps) Prev(index int) *Step

Prev 上一步

func (*Steps) PrevByName

func (s *Steps) PrevByName(stepName string) *Step

PrevByName 上一步

func (*Steps) Set

func (s *Steps) Set(stepName string, processors ...Processor) *Steps

Set 设置步骤

func (*Steps) SetStep

func (s *Steps) SetStep(step *Step) *Steps

SetStep 设置步骤

func (*Steps) Size

func (s *Steps) Size() int

Size 步骤总数

func (*Steps) Slice

func (s *Steps) Slice() []*Step

Slice 按顺序返回所有步骤

Jump to

Keyboard shortcuts

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