Versions in this module Expand all Collapse all v0 v0.2.0 Jan 18, 2026 v0.1.0 Jan 17, 2026 Changes in this version + const BcryptCost + const MinPasswordLength + var ErrBadRequest = NewAppError("Permintaan tidak valid", 400) + var ErrConflict = NewAppError("Konflik", 409) + var ErrForbidden = NewAppError("Dilarang", 403) + var ErrInternalServerError = NewAppError("Kesalahan server internal", 500) + var ErrNotFound = NewAppError("Tidak ditemukan", 404) + var ErrUnauthorized = NewAppError("Tidak terotorisasi", 401) + var ErrValidation = NewAppError("Validasi gagal", 400) + func BadRequest(w http.ResponseWriter, message string, errors map[string]string) error + func BuiltinConstraintValidators() map[string]ConstraintValidator + func CleanIPAddress(address string) string + func Conflict(w http.ResponseWriter, message string, errors map[string]string) error + func ContainsDigit(s string) bool + func ContainsLowercase(s string) bool + func ContainsRune(s string, predicate func(rune) bool) bool + func ContainsSpecial(s string) bool + func ContainsUppercase(s string) bool + func CreatePasswordResetTokensTable(pool *pgxpool.Pool) error + func CreateRateLimitsTable(pool *pgxpool.Pool) error + func CreateRefreshTokensTable(pool *pgxpool.Pool) error + func CreateTokenBlocklistTable(pool *pgxpool.Pool) error + func Created(w http.ResponseWriter, data interface{}) error + func DetectContentType(filename string) string + func DropPasswordResetTokensTable(pool *pgxpool.Pool) error + func DropRateLimitsTable(pool *pgxpool.Pool) error + func DropRefreshTokensTable(pool *pgxpool.Pool) error + func DropTokenBlocklistTable(pool *pgxpool.Pool) error + func Forbidden(w http.ResponseWriter, message string) error + func GenerateCSRFToken(length int) (string, error) + func GenerateSecureToken(length int) (string, error) + func GenerateTokenHash(token string) string + func GetAuthToken(r *http.Request) (string, bool) + func GetCSRFToken(r *http.Request, headerName string) string + func GetClaims(r *http.Request) map[string]interface + func GetClientIP(r *http.Request) string + func GetCookie(r *http.Request, name string) string + func GetEnv(key string) string + func GetEnvOrDefault(key, defaultValue string) string + func GetHeaderValue(r *http.Request, key string) string + func GetParam(r *http.Request, key string) string + func GetQueryParam(r *http.Request, key string) string + func GetQueryParams(r *http.Request, keys ...string) map[string]string + func GetRequestID(r *http.Request) string + func HashPassword(password string) (string, error) + func InternalServerError(w http.ResponseWriter, message string) error + func IsAppError(err error) bool + func IsHexChar(char byte) bool + func IsSafeHttpMethod(method string) bool + func IsSafeRead(query string) bool + func IsValidDateFormat(date string) bool + func IsValidUuid(s string) bool + func Json(w http.ResponseWriter, status int, data interface{}) error + func JsonAppError(w http.ResponseWriter, appErr *AppError) error + func JsonError(w http.ResponseWriter, status int, message string, errors map[string]string) error + func JsonPagination(w http.ResponseWriter, status int, data interface{}, meta PaginationMeta) error + func LoadEnvFile(filename string) error + func LoadEnvFileFromPath(dir string) error + func MiddlewareToHandler(m MiddlewareFunc, next http.Handler) http.Handler + func NoContent(w http.ResponseWriter) error + func NotFound(w http.ResponseWriter, message string) error + func OK(w http.ResponseWriter, data interface{}) error + func ParseEnvBool(s string) bool + func ParseEnvDuration(value string) (time.Duration, error) + func ParseEnvInt(value string) (int, error) + func PathMatches(path string, patterns []string) bool + func Register(m Migration) + func RegisterMIMEType(ext, mimeType string) + func RollbackMigration(db *PostgresDatabase, migration Migration) error + func RunMigrations(db *PostgresDatabase, migrations []Migration) error + func ServeFile(w http.ResponseWriter, filename, filePath string, statusCode int) error + func ServeFileInline(w http.ResponseWriter, filename, filePath string, statusCode int) error + func SetCSRFToken(w http.ResponseWriter, token string, config CSRFConfig) + func SetContentType(w http.ResponseWriter, contentType string) + func SetCookie(w http.ResponseWriter, cookie *http.Cookie) + func SetHeader(w http.ResponseWriter, key, value string) + func SetHeaders(w http.ResponseWriter, headers map[string]string) + func SetRequestID(r *http.Request, requestID string) *http.Request + func SetStatus(w http.ResponseWriter, status int) + func SetUser(r *http.Request, user Authenticatable) *http.Request + func SimpleGlobMatch(path, pattern string) bool + func StartServer(ctx context.Context, config ServerConfig, handler http.Handler) error + func StripComments(query string) string + func ToCamelCase(s string) string + func TooManyRequests(w http.ResponseWriter, retryAfterSeconds int) error + func Unauthorized(w http.ResponseWriter, message string) error + func UploadFiles(ctx context.Context, disk storage.Storage, files []*multipart.FileHeader, ...) ([]string, error) + func ValidatePasswordStrength(password string) error + func VerifyPassword(hashedPassword, password string) error + func VerifyTokenHash(hash, token string) error + type AmountRange = Range[float64] + type AppError struct + Errors map[string]string + Message string + StatusCode int + func AsAppError(err error) (*AppError, bool) + func NewAppError(message string, statusCode int) *AppError + func (e *AppError) Error() string + func (e *AppError) WithFieldError(field, message string) *AppError + func (e *AppError) WithFieldErrors(errors map[string]string) *AppError + type AuthService struct + func NewAuthService(userStore AuthUserStore, tokenStore TokenStore, jwtConfig *JWTConfig) (*AuthService, error) + func (s *AuthService) Login(ctx context.Context, email, password string) (string, string, error) + func (s *AuthService) Logout(ctx context.Context, refreshTokenStr string) error + func (s *AuthService) RefreshToken(ctx context.Context, refreshTokenStr string) (string, string, error) + func (s *AuthService) RequestPasswordReset(ctx context.Context, email string) (string, error) + func (s *AuthService) ResetPassword(ctx context.Context, resetTokenStr, newPassword string) error + func (s *AuthService) WithClaimsProvider(provider ClaimsProvider) *AuthService + type AuthUserStore interface + FindByEmail func(ctx context.Context, email string) (Authenticatable, error) + FindByID func(ctx context.Context, id string) (Authenticatable, error) + Update func(ctx context.Context, user Authenticatable) error + type Authenticatable interface + GetEmail func() string + GetID func() string + GetPassword func() string + SetPassword func(string) + func GetUser(r *http.Request) (Authenticatable, bool) + type CORSConfig struct + AllowCredentials bool + AllowedHeaders []string + AllowedMethods []string + AllowedOrigins []string + MaxAge int + type CSRFConfig struct + CookieName string + Enabled bool + ExemptPaths []string + HeaderName string + TokenLength int + type ClaimsProvider func(ctx context.Context, user Authenticatable) (map[string]interface{}, error) + type Command interface + Description func() string + Execute func(ctx *CommandContext) error + Name func() string + type CommandContext struct + Args []string + Config *Config + DB *PostgresDatabase + Err io.Writer + Out io.Writer + Router *Router + type Config struct + CORS CORSConfig + CSRF CSRFConfig + Database DatabaseConfig + Email EmailConfig + JWT JWTConfig + RateLimit RateLimitConfig + Server ServerConfig + func LoadConfig() (*Config, error) + func (c *Config) Validate() error + type Console struct + func NewConsole(db *PostgresDatabase, router *Router, config *Config) *Console + func (c *Console) Register(cmd Command) error + func (c *Console) RegisterBuiltInCommands() + func (c *Console) Run(args []string) error + func (c *Console) SetOutput(out, err io.Writer) + type ConstraintValidator interface + Name func() string + Validate func(values []string, constraint string, fieldType reflect.Type) error + type Database interface + Begin func(ctx context.Context) (pgx.Tx, error) + Close func() error + Exec func(ctx context.Context, query string, args ...interface{}) error + Query func(ctx context.Context, query string, args ...interface{}) (Rows, error) + QueryRow func(ctx context.Context, query string, args ...interface{}) Row + type DatabaseConfig struct + Database string + MaxConns int + Password string + Port int + QueryExecMode string + ReadHosts []string + RuntimeParams map[string]string + SSLMode string + Username string + WriteHost string + type DateRange = Range[string] + type EmailConfig struct + From string + type ErrorResponse struct + Errors map[string]string + Message string + type FilterParser struct + MaxValuesPerField int + TimestampTimezone *time.Location + func NewFilterParser(r *http.Request) *FilterParser + func (fp *FilterParser) Errors() map[string]string + func (fp *FilterParser) HasErrors() bool + func (fp *FilterParser) Parse(target interface{}) *FilterParser + func (fp *FilterParser) RegisterConstraintValidator(validator ConstraintValidator) *FilterParser + func (fp *FilterParser) WithMaxValues(max int) *FilterParser + func (fp *FilterParser) WithTimezone(tz *time.Location) *FilterParser + type FlaggedCommand interface + DefineFlags func(fs *flag.FlagSet) + type HandlerFunc func(http.ResponseWriter, *http.Request) + func Chain(handler HandlerFunc, middleware ...MiddlewareFunc) HandlerFunc + func (h HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (h HandlerFunc) ToHandler() http.Handler + type HelpCommand struct + func (c *HelpCommand) Description() string + func (c *HelpCommand) Execute(ctx *CommandContext) error + func (c *HelpCommand) Name() string + type InConstraintValidator struct + func (v *InConstraintValidator) Name() string + func (v *InConstraintValidator) Validate(values []string, constraint string, fieldType reflect.Type) error + type InMemoryBlocklist struct + func NewInMemoryBlocklist() *InMemoryBlocklist + func (m *InMemoryBlocklist) Invalidate(ctx context.Context, jti string, expiresIn time.Duration) error + func (m *InMemoryBlocklist) IsRevoked(ctx context.Context, jti string) (bool, error) + type InMemoryRateLimitStore struct + func NewInMemoryRateLimitStore(window time.Duration) *InMemoryRateLimitStore + func (s *InMemoryRateLimitStore) Allow(ctx context.Context, key string, limit int, window time.Duration) (bool, error) + func (s *InMemoryRateLimitStore) Close() error + type IntRange = Range[int64] + type JWTConfig struct + AccessTokenExpiry time.Duration + HMACSecret string + JWKSURL string + PrivateKey string + PublicKeys map[string]string + RefreshTokenExpiry time.Duration + SigningMethod string + type JWTManager struct + func NewJWTManager(config *JWTConfig) (*JWTManager, error) + func (m *JWTManager) GenerateAccessToken(userID string, email string, extraClaims map[string]interface{}) (string, error) + func (m *JWTManager) GenerateRefreshToken(userID string) (string, error) + func (m *JWTManager) GetTokenExpiry(tokenString string) (time.Time, error) + func (m *JWTManager) IsTokenExpired(tokenString string) (bool, error) + func (m *JWTManager) VerifyRefreshToken(tokenString string) (string, error) + func (m *JWTManager) VerifyToken(tokenString string) (jwt.MapClaims, error) + type JsonNull = jsonull.JsonNull[T] + func JsonNullFromPtr[T any](ptr *T) JsonNull[T] + func NewJsonNullNull[T any]() JsonNull[T] + func NewJsonNull[T any](value T) JsonNull[T] + type Logger struct + func NewLogger(level slog.Level) *Logger + func NewLoggerWithWriter(w io.Writer, level slog.Level) *Logger + func NewTextLogger(level slog.Level) *Logger + func NewTextLoggerWithWriter(w io.Writer, level slog.Level) *Logger + func (l *Logger) Debug(msg string, args ...any) + func (l *Logger) Error(msg string, args ...any) + func (l *Logger) Info(msg string, args ...any) + func (l *Logger) Warn(msg string, args ...any) + func (l *Logger) WithAttrs(attrs ...slog.Attr) *Logger + func (l *Logger) WithGroup(name string) *Logger + type LoginRequest struct + Email string + Password string + type MakeMigrationCommand struct + func (c *MakeMigrationCommand) DefineFlags(fs *flag.FlagSet) + func (c *MakeMigrationCommand) Description() string + func (c *MakeMigrationCommand) Execute(ctx *CommandContext) error + func (c *MakeMigrationCommand) Name() string + type MiddlewareFunc func(HandlerFunc) HandlerFunc + func AllowBearerToken() MiddlewareFunc + func CORS(config CORSConfig) MiddlewareFunc + func CSRFMiddleware(config CSRFConfig) MiddlewareFunc + func ChainMiddleware(middleware ...MiddlewareFunc) MiddlewareFunc + func Compose(middleware ...MiddlewareFunc) MiddlewareFunc + func ExpectBearerToken() MiddlewareFunc + func HandlerToMiddleware(h http.Handler) MiddlewareFunc + func LoggerMiddleware(logger *Logger) MiddlewareFunc + func OptionalAuth(jwtManager *JWTManager) MiddlewareFunc + func RateLimit(config RateLimitConfig, store ...RateLimitStore) MiddlewareFunc + func Recovery(logger *Logger) MiddlewareFunc + func RequireAuth(jwtManager *JWTManager) MiddlewareFunc + type MigrateCommand struct + func (c *MigrateCommand) DefineFlags(fs *flag.FlagSet) + func (c *MigrateCommand) Description() string + func (c *MigrateCommand) Execute(ctx *CommandContext) error + func (c *MigrateCommand) Name() string + type MigrateListCommand struct + func (c *MigrateListCommand) Description() string + func (c *MigrateListCommand) Execute(ctx *CommandContext) error + func (c *MigrateListCommand) Name() string + type MigrateRollbackCommand struct + func (c *MigrateRollbackCommand) DefineFlags(fs *flag.FlagSet) + func (c *MigrateRollbackCommand) Description() string + func (c *MigrateRollbackCommand) Execute(ctx *CommandContext) error + func (c *MigrateRollbackCommand) Name() string + type Migration struct + Down func(*pgxpool.Pool) error + Name string + Up func(*pgxpool.Pool) error + Version int64 + func GetFrameworkMigrations() []Migration + func GetRateLimitMigrations() []Migration + func GetRegisteredMigrations() []Migration + func GetTokenMigrations() []Migration + func GetUserMigrations() []Migration + type MigrationHistory struct + Name string + Version int64 + type MockTokenStore struct + func NewMockTokenStore() *MockTokenStore + func (s *MockTokenStore) FindPasswordResetToken(ctx context.Context, tokenHash string) (*PasswordResetToken, error) + func (s *MockTokenStore) FindRefreshToken(ctx context.Context, tokenHash string) (*RefreshToken, error) + func (s *MockTokenStore) MarkPasswordResetUsed(ctx context.Context, tokenHash string) error + func (s *MockTokenStore) RevokeAllUserTokens(ctx context.Context, userID string) error + func (s *MockTokenStore) RevokeRefreshToken(ctx context.Context, tokenHash string) error + func (s *MockTokenStore) SavePasswordResetToken(ctx context.Context, token *PasswordResetToken) error + func (s *MockTokenStore) SaveRefreshToken(ctx context.Context, token *RefreshToken) error + type Observable interface + AddHook func(hook QueryHook) + type Pagination struct + Limit int + Page int + func (p *Pagination) Offset() int + type PaginationMeta struct + Page int + PerPage int + Total int + TotalPages int + type PaginationParser struct + DefaultLimit int + MaxLimit int + func NewPaginationParser(defaultLimit, maxLimit int) *PaginationParser + func (p *PaginationParser) Parse(r *http.Request) (*Pagination, error) + type PaginationResponse struct + Data interface{} + Meta PaginationMeta + type PasswordResetToken struct + CreatedAt time.Time + ExpiresAt time.Time + ID int64 + TokenHash string + UsedAt *time.Time + UserID string + type PasswordValidator struct + func NewPasswordValidator() *PasswordValidator + func (pv *PasswordValidator) RequireDigit(required bool) *PasswordValidator + func (pv *PasswordValidator) RequireLowercase(required bool) *PasswordValidator + func (pv *PasswordValidator) RequireSpecial(required bool) *PasswordValidator + func (pv *PasswordValidator) RequireUppercase(required bool) *PasswordValidator + func (pv *PasswordValidator) SetMinLength(length int) *PasswordValidator + func (pv *PasswordValidator) Validate(password string) error + type PostgresBlocklist struct + func NewPostgresBlocklist(db Database) *PostgresBlocklist + func (p *PostgresBlocklist) Cleanup(ctx context.Context) error + func (p *PostgresBlocklist) InitSchema(ctx context.Context) error + func (p *PostgresBlocklist) Invalidate(ctx context.Context, jti string, expiresIn time.Duration) error + func (p *PostgresBlocklist) IsRevoked(ctx context.Context, jti string) (bool, error) + type PostgresDatabase struct + func NewPostgresDatabase(config DatabaseConfig) (*PostgresDatabase, error) + func (db *PostgresDatabase) AddHook(hook QueryHook) + func (db *PostgresDatabase) Begin(ctx context.Context) (pgx.Tx, error) + func (db *PostgresDatabase) Close() error + func (db *PostgresDatabase) Exec(ctx context.Context, query string, args ...interface{}) error + func (db *PostgresDatabase) Query(ctx context.Context, query string, args ...interface{}) (Rows, error) + func (db *PostgresDatabase) QueryRow(ctx context.Context, query string, args ...interface{}) Row + func (db *PostgresDatabase) WithTx(ctx context.Context, fn TransactionFunc) error + type PostgresRateLimitStore struct + func NewPostgresRateLimitStore(db Database) *PostgresRateLimitStore + func (s *PostgresRateLimitStore) Allow(ctx context.Context, key string, limit int, window time.Duration) (bool, error) + func (s *PostgresRateLimitStore) Close() error + func (s *PostgresRateLimitStore) InitSchema(ctx context.Context) error + type PostgresTokenStore struct + func NewPostgresTokenStore(db Database) *PostgresTokenStore + func (s *PostgresTokenStore) FindPasswordResetToken(ctx context.Context, tokenHash string) (*PasswordResetToken, error) + func (s *PostgresTokenStore) FindRefreshToken(ctx context.Context, tokenHash string) (*RefreshToken, error) + func (s *PostgresTokenStore) MarkPasswordResetUsed(ctx context.Context, tokenHash string) error + func (s *PostgresTokenStore) RevokeAllUserTokens(ctx context.Context, userID string) error + func (s *PostgresTokenStore) RevokeRefreshToken(ctx context.Context, tokenHash string) error + func (s *PostgresTokenStore) SavePasswordResetToken(ctx context.Context, token *PasswordResetToken) error + func (s *PostgresTokenStore) SaveRefreshToken(ctx context.Context, token *RefreshToken) error + type QueryHook func(ctx context.Context, query string, args []interface{}, duration time.Duration, ...) + type Range struct + From T + Present bool + To T + Valid bool + type RateLimitConfig struct + Enabled bool + PerIP int + PerUser int + ResetPeriod time.Duration + type RateLimitStore interface + Allow func(ctx context.Context, key string, limit int, window time.Duration) (bool, error) + Close func() error + type RateLimiter struct + func NewRateLimiter(config RateLimitConfig, store RateLimitStore) *RateLimiter + func (rl *RateLimiter) CheckIPLimit(ctx context.Context, ip string) (bool, error) + func (rl *RateLimiter) CheckUserLimit(ctx context.Context, userKey string) (bool, error) + type RefreshToken struct + CreatedAt time.Time + ExpiresAt time.Time + ID int64 + IPAddress string + RevokedAt *time.Time + TokenHash string + UserAgent string + UserID string + type RouteInfo struct + Handler string + Method string + Middlewares []string + Path string + type RouteListCommand struct + func (c *RouteListCommand) Description() string + func (c *RouteListCommand) Execute(ctx *CommandContext) error + func (c *RouteListCommand) Name() string + type Router struct + func NewRouter() *Router + func (r *Router) Build() + func (r *Router) Delete(path string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (r *Router) Get(path string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (r *Router) GetRoutes() []RouteInfo + func (r *Router) Group(prefix string, middleware ...MiddlewareFunc) *RouterGroup + func (r *Router) Head(path string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (r *Router) Options(path string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (r *Router) Patch(path string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (r *Router) Post(path string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (r *Router) Put(path string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (r *Router) Register(method, path string, handler HandlerFunc, middleware []MiddlewareFunc) + func (r *Router) SPA(root fs.FS, index string, middleware ...MiddlewareFunc) + func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) + func (r *Router) Static(prefix string, root fs.FS, middleware ...MiddlewareFunc) + func (r *Router) Use(middleware ...MiddlewareFunc) + type RouterGroup struct + func (rg *RouterGroup) Delete(relativePath string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (rg *RouterGroup) Get(relativePath string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (rg *RouterGroup) Group(prefix string, middleware ...MiddlewareFunc) *RouterGroup + func (rg *RouterGroup) Head(relativePath string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (rg *RouterGroup) Options(relativePath string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (rg *RouterGroup) Patch(relativePath string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (rg *RouterGroup) Post(relativePath string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (rg *RouterGroup) Put(relativePath string, handler HandlerFunc, middleware ...MiddlewareFunc) + func (rg *RouterGroup) Use(middleware ...MiddlewareFunc) + type Row interface + Scan func(dest ...interface{}) error + type Rows interface + Close func() + Err func() error + Next func() bool + Scan func(dest ...interface{}) error + type ServeCommand struct + func (c *ServeCommand) DefineFlags(fs *flag.FlagSet) + func (c *ServeCommand) Description() string + func (c *ServeCommand) Execute(ctx *CommandContext) error + func (c *ServeCommand) Name() string + type ServerConfig struct + IdleTimeout time.Duration + Port string + ReadTimeout time.Duration + ShutdownTimeout time.Duration + WriteTimeout time.Duration + type SortField struct + Direction string + Field string + func (s SortField) SQL() string + type SortParser struct + AllowedFields map[string]bool + func NewSortParser(allowedFields []string) *SortParser + func (p *SortParser) Parse(r *http.Request) ([]SortField, error) + type TimestampRange = Range[int64] + type TokenBlocklist interface + Invalidate func(ctx context.Context, jti string, expiresIn time.Duration) error + IsRevoked func(ctx context.Context, jti string) (bool, error) + type TokenResponse struct + AccessToken string + ExpiresIn int + RefreshToken string + TokenType string + type TokenStore interface + FindPasswordResetToken func(ctx context.Context, tokenHash string) (*PasswordResetToken, error) + FindRefreshToken func(ctx context.Context, tokenHash string) (*RefreshToken, error) + MarkPasswordResetUsed func(ctx context.Context, tokenHash string) error + RevokeAllUserTokens func(ctx context.Context, userID string) error + RevokeRefreshToken func(ctx context.Context, tokenHash string) error + SavePasswordResetToken func(ctx context.Context, token *PasswordResetToken) error + SaveRefreshToken func(ctx context.Context, token *RefreshToken) error + type TokenUser struct + Claims map[string]interface{} + Email string + ID string + Password string + func (u *TokenUser) GetClaims() map[string]interface{} + func (u *TokenUser) GetEmail() string + func (u *TokenUser) GetID() string + func (u *TokenUser) GetPassword() string + func (u *TokenUser) SetPassword(password string) + type TransactionFunc func(ctx context.Context, tx pgx.Tx) error + type UUID [16]byte + func NewUuid() UUID + func NewV4() UUID + func NewV7() (UUID, error) + func ParseUUIDFromString(s string) (UUID, error) + func ParseUuid(s string) (UUID, error) + func (u UUID) String() string + type UploadConfig struct + func DefaultConfig() *UploadConfig + type UploadOption func(*UploadConfig) + func WithAllowedExts(exts ...string) UploadOption + func WithConcurrent(enabled bool) UploadOption + func WithLogger(logger *slog.Logger) UploadOption + func WithMaxFileSize(size uint64) UploadOption + func WithMaxFiles(max uint8) UploadOption + func WithMaxWorkers(max int) UploadOption + func WithPath(path string) UploadOption + type UploadResult struct + Errors map[string]error + Paths []string + type Validator struct + func NewValidator() *Validator + func (v *Validator) AddError(field, message string) *Validator + func (v *Validator) Custom(field string, fn func(string) bool, value string, message string) *Validator + func (v *Validator) Email(field, value string) *Validator + func (v *Validator) ErrorCount() int + func (v *Validator) ErrorMap() map[string]string + func (v *Validator) Errors() []string + func (v *Validator) GetError(field string) string + func (v *Validator) HasError(field string) bool + func (v *Validator) In(field, value string, allowed ...string) *Validator + func (v *Validator) IsValid() bool + func (v *Validator) Length(field, value string, length int) *Validator + func (v *Validator) Matches(field, value, otherField, otherValue string) *Validator + func (v *Validator) MaxLength(field, value string, max int) *Validator + func (v *Validator) MinLength(field, value string, min int) *Validator + func (v *Validator) NumRange(field string, value, min, max int) *Validator + func (v *Validator) OptionalEmail(field string, value JsonNull[string]) *Validator + func (v *Validator) OptionalIn(field string, value JsonNull[string], allowed ...string) *Validator + func (v *Validator) OptionalLength(field string, value JsonNull[string], length int) *Validator + func (v *Validator) OptionalMatches(field string, value JsonNull[string], pattern string) *Validator + func (v *Validator) OptionalMaxLength(field string, value JsonNull[string], max int) *Validator + func (v *Validator) OptionalMinLength(field string, value JsonNull[string], min int) *Validator + func (v *Validator) Pattern(field, value string, pattern string) *Validator + func (v *Validator) Required(field, value string) *Validator