dogma

package module
v0.0.0-...-4e14a4b Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 7 Imported by: 0

README

go-dogma

A library & tool for generating web interface definition code from documentation.

Supported output languages & roadmap

  • Golang
    • generate type definition code & data validation code
    • typed service definition (use with gorilla/mux)
  • Typescript
    • generate type definition code & data validation code
    • typed request method (based on fetch)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleRestFunc

func HandleRestFunc[T func(Context, PU, PC) (R, error), PU any, PC any, R any](s *Server, handle T)

Types

type Context

type Context struct {
	Session any
}

type Method

type Method struct {
	Name   string `json:"name"`
	Method string `json:"method"`
}

type ResultBase

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

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(router *mux.Router, sessionMan SessionManager, desc map[reflect.Type]Method, logger *log.Logger) *Server

type SessionManager

type SessionManager interface {
	Load(writer http.ResponseWriter, request *http.Request) any
	Store(writer http.ResponseWriter, request *http.Request, session any)
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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