pomme/internal/types.go

46 lines
976 B
Go

package internal
import "gorm.io/gorm"
// User struct represents a user in the database.
type User struct {
gorm.Model
Username string
HashedPassword string
}
// Response struct represents a json response.
type Response struct {
Message string `json:"message,omitempty"`
HTTPResponse int `json:"status,omitempty"`
}
// ZoneRequest represents a Zone file request.
type ZoneRequest struct {
*Zone
User string `json:"user,omitempty" gorm:"foreignKey:username;references:User"`
}
// Zone struct represents a zonefile in the database.
type Zone struct {
gorm.Model
FileName string `json:"name"`
RawFileName string `json:"rawfilename"`
Body string `json:"body"`
}
type Config struct {
Server string
HashingSecret string
Port string
DB string
TestDB string
}
// GenericNestedResponse[T]
// @Description Some Generic List Response.
type GenericResponse[T any] struct {
// Response items
Response T
}