Some renaming

This commit is contained in:
Daniel Ponte 2022-11-20 13:42:10 -05:00
parent d34814f050
commit 86abb0b618
2 changed files with 15 additions and 15 deletions

View file

@ -17,7 +17,7 @@ type AuthFlowManager struct {
} }
type LoginFlow struct { type LoginFlow struct {
flow.FlowHandlerBase flow.FlowHandler
ClientID common.ClientID ClientID common.ClientID
FlowContext FlowContext
@ -52,9 +52,9 @@ func NewAuthFlowManager() *AuthFlowManager {
func (afm *AuthFlowManager) NewLoginFlow(req *LoginFlowRequest, prov provider.AuthProvider) *LoginFlow { func (afm *AuthFlowManager) NewLoginFlow(req *LoginFlowRequest, prov provider.AuthProvider) *LoginFlow {
lf := &LoginFlow{ lf := &LoginFlow{
FlowHandlerBase: flow.NewFlowHandlerBase(prov, prov.ProviderType()), FlowHandler: flow.NewFlowHandlerBase(prov, prov.ProviderType()),
ClientID: req.ClientID, ClientID: req.ClientID,
FlowContext: req.FlowContext(), FlowContext: req.FlowContext(),
} }
afm.Register(lf) afm.Register(lf)

View file

@ -60,7 +60,7 @@ type (
} }
Handler interface { Handler interface {
Base() FlowHandlerBase Base() FlowHandler
FlowID() FlowID FlowID() FlowID
flowCtime() time.Time flowCtime() time.Time
@ -91,7 +91,7 @@ func NewFlowManager() *FlowManager {
func stepPtr(s Step) *Step { return &s } func stepPtr(s Step) *Step { return &s }
type FlowHandlerBase struct { type FlowHandler struct {
ID FlowID // ID is the FlowID ID FlowID // ID is the FlowID
Handler HandlerKey // Handler key Handler HandlerKey // Handler key
Context Context // flow Context Context Context // flow Context
@ -103,18 +103,18 @@ type FlowHandlerBase struct {
ctime time.Time ctime time.Time
} }
func (f *FlowHandlerBase) Step() Step { return f.curStep } func (f *FlowHandler) Step() Step { return f.curStep }
func (f *FlowHandlerBase) Base() FlowHandlerBase { return *f } func (f *FlowHandler) Base() FlowHandler { return *f }
func (f *FlowHandlerBase) FlowID() FlowID { func (f *FlowHandler) FlowID() FlowID {
return f.ID return f.ID
} }
func (f *FlowHandlerBase) flowCtime() time.Time { return f.ctime } func (f *FlowHandler) flowCtime() time.Time { return f.ctime }
func NewFlowHandlerBase(sch Schemer, hand string) FlowHandlerBase { func NewFlowHandlerBase(sch Schemer, hand string) FlowHandler {
return FlowHandlerBase{ return FlowHandler{
ID: FlowID(generate.UUID()), ID: FlowID(generate.UUID()),
Handler: HandlerKey(hand), Handler: HandlerKey(hand),
Schema: sch.FlowSchema(), Schema: sch.FlowSchema(),
@ -128,7 +128,7 @@ func (hk *HandlerKey) String() string {
return string(*hk) return string(*hk)
} }
func (fm *FlowHandlerBase) Handlers() []*HandlerKey { func (fm *FlowHandler) Handlers() []*HandlerKey {
return []*HandlerKey{&fm.Handler, nil} return []*HandlerKey{&fm.Handler, nil}
} }
@ -140,7 +140,7 @@ func resultErrs(e Errors) Errors {
return e return e
} }
func (fm *FlowHandlerBase) ShowForm(errs Errors) *Result { func (fm *FlowHandler) ShowForm(errs Errors) *Result {
res := &Result{ res := &Result{
Type: TypeForm, Type: TypeForm,
ID: fm.ID, ID: fm.ID,
@ -168,7 +168,7 @@ const (
TypeMenu ResultType = "menu" TypeMenu ResultType = "menu"
) )
func (f *FlowHandlerBase) touch() { func (f *FlowHandler) touch() {
f.ctime = time.Now() f.ctime = time.Now()
} }