优化
This commit is contained in:
@@ -31,3 +31,43 @@ type FileStorage interface {
|
||||
DeletePrefix(context.Context, string) error
|
||||
List(context.Context, string, string, int) ([]*StoredFile, string, bool, error)
|
||||
}
|
||||
|
||||
type JWTSettings struct {
|
||||
SigningKey string
|
||||
Issuer string
|
||||
Expires time.Duration
|
||||
Buffer time.Duration
|
||||
}
|
||||
|
||||
type CaptchaSettings struct {
|
||||
KeyLong int
|
||||
ImageWidth int
|
||||
ImageHeight int
|
||||
StoreExpiration time.Duration
|
||||
}
|
||||
|
||||
type MediaSettings struct {
|
||||
SessionTTL int
|
||||
MaxFileSize int64
|
||||
}
|
||||
|
||||
// RuntimeSettings exposes only the active values needed by the application.
|
||||
// The data implementation resolves every call from conf.Runtime so hot reloads
|
||||
// take effect without rebuilding services.
|
||||
type RuntimeSettings interface {
|
||||
RouterPrefix() string
|
||||
JWTSettings() JWTSettings
|
||||
CaptchaSettings() CaptchaSettings
|
||||
MediaSettings() MediaSettings
|
||||
UseMultipoint() bool
|
||||
}
|
||||
|
||||
type IssuedToken struct {
|
||||
Value string
|
||||
ExpiresAt time.Time
|
||||
TTL time.Duration
|
||||
}
|
||||
|
||||
type TokenIssuer interface {
|
||||
IssueToken(*User, uint, bool, time.Duration) (*IssuedToken, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user