models

package
v0.0.0-...-1cea508 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Environment string
	Logger      models.Logger
	HTTPServer  HTTPServerConfig
	HTTPRouter  HTTPRouterConfig
	Database    DatabaseConfig
}

type DatabaseConfig

type DatabaseConfig struct {
	Host        string
	Port        int
	User        string
	DbName      string
	Password    string
	Tables      []string
	CreateTable bool
}

type Error

type Error struct {
	Message string `json:"message"`
}

type HTTPRouterConfig

type HTTPRouterConfig struct {
	TimeoutSec     int
	AllowedOrigins []string
	AllowedMethods []string
	AllowedHeaders []string
}

type HTTPServerConfig

type HTTPServerConfig struct {
	Port int
}

type TodoItem

type TodoItem struct {
	ID        int       `json:"id" pg:"id,pk"`
	Todo      string    `json:"todo" pg:"todo"`
	CreatedOn time.Time `json:"created_on" pg:"created_on"`
	// contains filtered or unexported fields
}

TodoItem model

type TodoPostRequest

type TodoPostRequest struct {
	Todo string `json:"todo"`
}

TodoPostRequest request model to POST

func (*TodoPostRequest) IsValid

func (tReq *TodoPostRequest) IsValid() error

type TodoPostResponse

type TodoPostResponse struct {
	ID int `json:"id"`
}

TodoPostResponse response model to POST

Jump to

Keyboard shortcuts

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