request

package
v0.0.0-...-ae86d3b Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EmailRegex is the regex for the email validation.
	EmailRegex = `^[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,4}$`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateProjectRequest

type CreateProjectRequest struct {
	Client      string               `json:"project-client"`
	Command     string               `json:"command"`
	Database    int                  `json:"project-database"`
	Name        string               `json:"project-name"`
	OwnerEmail  string               `json:"project-owner-email"`
	Runtime     int                  `json:"project-runtime"`
	Environment []ProjectEnvironment `json:"project-environment"`
	// The following fields are not part of the request body.
	ClientID  uint
	ProjectID uint
	// contains filtered or unexported fields
}

CreateProjectRequest represents the request body of the /project/create endpoint.

func (*CreateProjectRequest) Validate

func (r *CreateProjectRequest) Validate(db *gorm.DB) map[string][]string

Validate is for the data validation. It returns the array of the errors. If the data is fine, it returns empty arra.

type ProjectEnvironment

type ProjectEnvironment struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

ProjectEnvironment represents the environment of the project.

type QueryRequest

type QueryRequest struct {
	Query string `json:"query"`
}

QueryRequest represents the request for the query.

Jump to

Keyboard shortcuts

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