models

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package models contains application-owned database entities and API types. Keep feature-specific persistence models in descriptive files such as invoice_models.go.

A basic GORM model looks like this:

type Invoice struct {
	gorm.Model
	Name string `gorm:"size:120;not null"`
}

Keep request DTOs in *_inputs.go and response DTOs in *_outputs.go. Do not expose a persistence model directly when the API needs a stable shape.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthResponse

type HealthResponse struct {
	Status string `json:"status"`
	App    string `json:"app"`
}

type HelloInput

type HelloInput struct {
	Name string `json:"name" query:"name" validate:"omitempty,max=60"`
}

type HelloMessage

type HelloMessage struct {
	gorm.Model
	Slug    string `gorm:"size:64;not null;uniqueIndex:ux_hello_slug_lang,priority:1"`
	Lang    string `gorm:"size:16;not null;uniqueIndex:ux_hello_slug_lang,priority:2;index"`
	Message string `gorm:"size:255;not null"`
}

type HelloResponse

type HelloResponse struct {
	App           string `json:"app"`
	Message       string `json:"message"`
	Locale        string `json:"locale"`
	Authenticated bool   `json:"authenticated"`
	IdentityID    string `json:"identity_id,omitempty"`
	Role          string `json:"role,omitempty"`
	Source        string `json:"source"`
}

Jump to

Keyboard shortcuts

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