chat/internal/domain/usecase/auth.go

14 lines
625 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package usecase
import "context"
// AuthUseCase 定義認證相關的業務邏輯介面
type AuthUseCase interface {
// AnonLogin 匿名登入,返回 UID、API token、Centrifugo token 和過期時間
AnonLogin(ctx context.Context, name string) (uid string, token string, centrifugoToken string, expireAt int64, err error)
// RefreshToken 刷新 token使用現有的 token 來生成新的 API token 和 Centrifugo token
// 返回新的 API token、Centrifugo token 和過期時間
RefreshToken(ctx context.Context, oldToken string) (uid string, token string, centrifugoToken string, expireAt int64, err error)
}