configmodels

package
v0.0.0-...-1180a88 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateFields

func ValidateFields(cfg any)

Types

type App

type App map[string]string

func (App) Validate

func (a App) Validate()

type Base

type Base struct {
	ProjectPath string
	Name        string
	AppConfig   App
	Models      []Model
	HTTP        []HTTPHandler
	Services    []Service
	Database    Database
}

func (Base) Validate

func (c Base) Validate()

type BaseYaml

type BaseYaml struct {
	ProjectPath string
	Name        string        `yaml:"name"`
	AppConfig   App           `yaml:"appConfig"`
	Models      []Model       `yaml:"models"`
	HTTP        []HTTPHandler `yaml:"http"`
	Services    []ServiceYaml `yaml:"services"`
	Database    Database      `yaml:"db"`
}

type Database

type Database struct {
	Type     string
	User     string  `yaml:"user"`
	Password string  `yaml:"password"`
	Name     string  `yaml:"name"`
	Schema   []Table `yaml:"schema"`
}

func (Database) Validate

func (c Database) Validate()

type HTTPHandler

type HTTPHandler struct {
	Name         string `yaml:"handlerName"`
	Method       string `yaml:"method"`
	Path         string `yaml:"path"`
	RequestBody  string `yaml:"requestBody"`
	ResponseBody string `yaml:"responseBody"`
	Service      string `yaml:"service"`
}

func (HTTPHandler) Validate

func (c HTTPHandler) Validate()

type Method

type Method struct {
	Name    string
	Accepts datastructures.OrderedMap[string, string]
	Returns string
}

func (Method) Validate

func (c Method) Validate()

type MethodYaml

type MethodYaml struct {
	Name    string    `yaml:"name"`
	Accepts yaml.Node `yaml:"accepts"`
	Returns string    `yaml:"returns"`
}

type Model

type Model struct {
	Name   string            `yaml:"name"`
	Fields map[string]string `yaml:"fields"`
}

func (Model) Validate

func (c Model) Validate()

type Service

type Service struct {
	Name    string
	Methods []Method
}

func (Service) Validate

func (c Service) Validate()

type ServiceYaml

type ServiceYaml struct {
	Name    string       `yaml:"name"`
	Methods []MethodYaml `yaml:"methods"`
}

type Table

type Table struct {
	TableName string   `yaml:"tableName"`
	Model     string   `yaml:"model"`
	Ops       []string `yaml:"ops"`
}

func (Table) Validate

func (c Table) Validate()

Jump to

Keyboard shortcuts

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