models

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

api/models/auth_models.go

api/models/database_models.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnDefinition

type ColumnDefinition struct {
	Name string `json:"name" binding:"required"`
	Type string `json:"type" binding:"required"` // e.g., "TEXT", "INTEGER", "REAL", "BLOB"
}

ColumnDefinition represents a single column in a table schema request

type CreateAPIKeyResponse

type CreateAPIKeyResponse struct {
	APIKey  string `json:"api_key"` // The full key (prefix + secret). Store securely!
	Message string `json:"message,omitempty"`
}

CreateAPIKeyResponse returns the newly generated API key ONCE.

type CreateDatabaseRequest

type CreateDatabaseRequest struct {
	DBName string `json:"db_name" binding:"required"`
}

CreateDatabaseRequest defines the structure for creating a database registration

type CreateSchemaRequest

type CreateSchemaRequest struct {
	TableName string             `json:"table_name" binding:"required"`
	Columns   []ColumnDefinition `json:"columns" binding:"required,min=1,dive"`
}

CreateSchemaRequest defines the structure for the schema creation request body

type CustomClaims

type CustomClaims struct {
	UserID string `json:"userId"`
	jwt.RegisteredClaims
}

CustomClaims includes standard claims and our custom userID claim for JWT

type GetUser

type GetUser struct {
	Token string `json:"token"`
}

GetUser defines the structure for the get user by user_id body

type LoginRequest

type LoginRequest struct {
	Email    string `json:"email" binding:"required"`
	Password string `json:"password" binding:"required"`
}

LoginRequest defines the structure for the login request body

type LoginResponse

type LoginResponse struct {
	Message string              `json:"message"`
	User    domain.UserMetadata `json:"user"`
	Token   string              `json:"token"`
}

LoginResponse defines the structure for the login response body

type SignupRequest

type SignupRequest struct {
	Email    string `json:"email" binding:"required,email"`
	Username string `json:"username" binding:"required,min=6"`
	Password string `json:"password" binding:"required,min=8"`
}

SignupRequest defines the structure for the signup request body

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL