state

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanTransition

func CanTransition(from, to protocol.Phase) bool

CanTransition 檢查從 from 到 to 是否合法

func PhaseToRole

func PhaseToRole(p protocol.Phase) protocol.Role

PhaseToRole 回傳某 phase 預設對應的 role

func ShouldStop

func ShouldStop(s protocol.State) (bool, string)

ShouldStop 檢查是否觸發停止條件

func Transition

func Transition(s protocol.State, to protocol.Phase, role protocol.Role) (protocol.State, error)

Transition 執行 state 轉換,回傳錯誤或更新後的 state

Types

This section is empty.

Jump to

Keyboard shortcuts

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