Documentation
¶
Index ¶
- func RunEmailPassCmd(rt mdk.Runtime, args []string) error
- type AuthResponse
- type Module
- func (m *Module) FieldResolvers() map[string]any
- func (m *Module) ID() string
- func (m *Module) Init(ctx context.Context, rt mdk.Runtime) error
- func (m *Module) JWTMiddleware(next http.Handler) http.Handler
- func (m *Module) Login(ctx context.Context, email, password string) (mdk.Actor, error)
- func (m *Module) LoginResolver(ctx context.Context, email string, password string) (*AuthResponse, error)
- func (m *Module) Me(ctx context.Context) (mdk.Actor, error)
- func (m *Module) Middlewares() []func(http.Handler) http.Handler
- func (m *Module) Models() []any
- func (m *Module) Mutations() map[string]any
- func (m *Module) Queries() map[string]any
- func (m *Module) Register(ctx context.Context, email, password, name string) (mdk.Actor, error)
- func (m *Module) RegisterResolver(ctx context.Context, email string, password string, name string) (*AuthResponse, error)
- func (m *Module) Routes() []mdk.Route
- func (m *Module) Shutdown(ctx context.Context) error
- func (m *Module) Store() *jwt.AuthStore
- func (m *Module) ValidateActor(ctx context.Context, input any) (any, error)
- func (m *Module) ValidateActorStep(sCtx mdk.StepContext) mdk.StepResult
- func (m *Module) ValidateToken(ctx context.Context, token string) (mdk.Actor, error)
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthResponse ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) FieldResolvers ¶
func (*Module) JWTMiddleware ¶ added in v0.4.0
func (*Module) LoginResolver ¶
func (*Module) Middlewares ¶ added in v0.4.0
Middlewares implements mdk.MiddlewareProvider interface.
func (*Module) RegisterResolver ¶
func (*Module) ValidateActor ¶
ValidateActor is a workflow handler that verifies an actor exists and is active.
func (*Module) ValidateActorStep ¶
func (m *Module) ValidateActorStep(sCtx mdk.StepContext) mdk.StepResult
ValidateActorStep wraps ValidateActor to conform to mdk.StepHandler.
type User ¶
type User struct {
ID string `gorm:"primaryKey" json:"id"`
Email string `gorm:"uniqueIndex;not null" json:"email"`
PasswordHash string `gorm:"not null" json:"-"`
ActorID string `gorm:"not null" json:"actor_id"`
Actor auth.Actor `gorm:"foreignKey:ActorID" json:"actor"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
User represents a human entity in the system.
Click to show internal directories.
Click to hide internal directories.