代码拉取完成,页面将自动刷新
// Code generated by go-enum DO NOT EDIT.
// Version:
// Revision:
// Build Date:
// Built By:
package fate
import (
"errors"
"fmt"
)
const (
// SessionStateWaiting is a SessionState of type Waiting.
SessionStateWaiting SessionState = iota
// SessionStateGenerating is a SessionState of type Generating.
SessionStateGenerating
// SessionStateFinish is a SessionState of type Finish.
SessionStateFinish
// SessionStateCanceled is a SessionState of type Canceled.
SessionStateCanceled
// SessionStateFailed is a SessionState of type Failed.
SessionStateFailed
)
var ErrInvalidSessionState = errors.New("not a valid SessionState")
const _SessionStateName = "waitinggeneratingfinishcanceledfailed"
var _SessionStateMap = map[SessionState]string{
SessionStateWaiting: _SessionStateName[0:7],
SessionStateGenerating: _SessionStateName[7:17],
SessionStateFinish: _SessionStateName[17:23],
SessionStateCanceled: _SessionStateName[23:31],
SessionStateFailed: _SessionStateName[31:37],
}
// String implements the Stringer interface.
func (x SessionState) String() string {
if str, ok := _SessionStateMap[x]; ok {
return str
}
return fmt.Sprintf("SessionState(%d)", x)
}
var _SessionStateValue = map[string]SessionState{
_SessionStateName[0:7]: SessionStateWaiting,
_SessionStateName[7:17]: SessionStateGenerating,
_SessionStateName[17:23]: SessionStateFinish,
_SessionStateName[23:31]: SessionStateCanceled,
_SessionStateName[31:37]: SessionStateFailed,
}
// ParseSessionState attempts to convert a string to a SessionState.
func ParseSessionState(name string) (SessionState, error) {
if x, ok := _SessionStateValue[name]; ok {
return x, nil
}
return SessionState(0), fmt.Errorf("%s is %w", name, ErrInvalidSessionState)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。