handler

package
v0.0.0-...-d4a6c04 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAccountHandler

func CreateAccountHandler(w http.ResponseWriter, r *http.Request)

CreateAccountHandler handles the creation of a new account

func CreateProjectHandler

func CreateProjectHandler(w http.ResponseWriter, r *http.Request)

CreateProjectHandler handles the creation of a new project

func CreateResponseModelHandler

func CreateResponseModelHandler(w http.ResponseWriter, r *http.Request)

func CreateURLConfigHandler

func CreateURLConfigHandler(w http.ResponseWriter, r *http.Request)

CreateURLConfigHandler handles the creation of a new URL config

func CreateURLHTTPStatusHandler

func CreateURLHTTPStatusHandler(w http.ResponseWriter, r *http.Request)

func DeleteAccountHandler

func DeleteAccountHandler(w http.ResponseWriter, r *http.Request)

DeleteAccountHandler handles deleting an account

func DeleteProjectHandler

func DeleteProjectHandler(w http.ResponseWriter, r *http.Request)

func DeleteResponseModelHandler

func DeleteResponseModelHandler(w http.ResponseWriter, r *http.Request)

DeleteResponseModelHandler handles deleting a response model

func DeleteURLConfigHandler

func DeleteURLConfigHandler(w http.ResponseWriter, r *http.Request)

DeleteURLConfigHandler handles deleting a URL config

func DeleteURLHTTPStatusHandler

func DeleteURLHTTPStatusHandler(w http.ResponseWriter, r *http.Request)

DeleteURLHTTPStatusHandler handles deleting an HTTP status

func GetAccountHandler

func GetAccountHandler(w http.ResponseWriter, r *http.Request)

GetAccountHandler retrieves a single account by ID from the database

func GetAllAccountsHandler

func GetAllAccountsHandler(w http.ResponseWriter, r *http.Request)

GetAllAccountsHandler retrieves all accounts from the database

func GetAllProjectsHandler

func GetAllProjectsHandler(w http.ResponseWriter, r *http.Request)

GetAllProjectsHandler retrieves all projects from the database

func GetAllResponseModelsHandler

func GetAllResponseModelsHandler(w http.ResponseWriter, r *http.Request)

GetAllResponseModelsHandler retrieves all response models from the database

func GetAllURLConfigsHandler

func GetAllURLConfigsHandler(w http.ResponseWriter, r *http.Request)

GetAllURLConfigsHandler retrieves all URL configs from the database

func GetAllURLHTTPStatusesHandler

func GetAllURLHTTPStatusesHandler(w http.ResponseWriter, r *http.Request)

GetAllURLHTTPStatusesHandler retrieves all HTTP statuses from the database

func GetProjectHandler

func GetProjectHandler(w http.ResponseWriter, r *http.Request)

GetProjectHandler retrieves a single project by ID from the database

func GetResponseModelHandler

func GetResponseModelHandler(w http.ResponseWriter, r *http.Request)

GetResponseModelHandler retrieves a single response model by ID from the database

func GetURLConfigHandler

func GetURLConfigHandler(w http.ResponseWriter, r *http.Request)

GetURLConfigHandler retrieves a single URL config by ID from the database

func LoginHandler

func LoginHandler(w http.ResponseWriter, r *http.Request)

LoginHandler handles user login and generates JWT token

func MockHandler

func MockHandler(w http.ResponseWriter, r *http.Request)

func UpdateAccountHandler

func UpdateAccountHandler(w http.ResponseWriter, r *http.Request)

UpdateAccountHandler handles updating an existing account

func UpdateProjectHandler

func UpdateProjectHandler(w http.ResponseWriter, r *http.Request)

func UpdateResponseModelHandler

func UpdateResponseModelHandler(w http.ResponseWriter, r *http.Request)

func UpdateURLConfigHandler

func UpdateURLConfigHandler(w http.ResponseWriter, r *http.Request)

func UpdateURLHTTPStatusHandler

func UpdateURLHTTPStatusHandler(w http.ResponseWriter, r *http.Request)

Types

type Account

type Account struct {
	ID       int64  `json:"id"`
	Email    string `json:"email"`
	Password string `json:"password"`
}

Account represents the account structure

type Claims

type Claims struct {
	Email     string `json:"email"`
	AccountID int64  `json:"account_id"`
	jwt.RegisteredClaims
}

Claims represents the structure of the JWT claims, including account_id

type Credentials

type Credentials struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

Credentials represents the user's login credentials

type Project

type Project struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	OwnerID     int64  `json:"owner_id"` // Changed AccountID to OwnerID
}

Project represents the project structure

type ResponseModel

type ResponseModel struct {
	ID              int64       `json:"id"`
	URLHTTPStatusID int         `json:"url_http_status_id"`
	Model           interface{} `json:"model"` // Assuming model is JSONB in the database
	Description     string      `json:"description"`
}

ResponseModel represents a structure for a response model

type URLConfig

type URLConfig struct {
	ID          int64  `json:"id"`
	Path        string `json:"path"`
	Method      string `json:"method"`
	Description string `json:"description"`
	ProjectID   int64  `json:"project_id"` // Add ProjectID to the struct
}

URLConfig represents a URL configuration structure

type URLHTTPStatus

type URLHTTPStatus struct {
	ID         int64 `json:"id"`
	URLID      int64 `json:"url_id"`
	HTTPStatus int   `json:"http_status"`
	Percentage int   `json:"percentage"`
}

URLHTTPStatus represents a structure for an HTTP status associated with a URL

Jump to

Keyboard shortcuts

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