bus

package
v0.0.67 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ldate     = 1 << iota     // the date in the local time zone: 2009/01/23
	Ltime                     // the time in the local time zone: 01:23:23
	LstdFlags = Ldate | Ltime // initial values for the standard logger
)
View Source
const RequestIDKey ctxKeyRequestID = 0

Variables

View Source
var Apibus *linq.Model
View Source
var DefaultLogger func(next http.Handler) http.Handler
View Source
var SchemaBus *linq.Schema

Functions

func AllApi_manager

func AllApi_manager(project, state, search string, page, rows int, _select string) (e.List, error)

func ApiManager

func ApiManager(next http.Handler) http.Handler

func DefineApimanager

func DefineApimanager() error

func DeleteApi_manager

func DeleteApi_manager(id string) (e.Item, error)

func ExecutePath

func ExecutePath(endpoint *Endpoint, w http.ResponseWriter, r *http.Request)

func GetApi_managerById

func GetApi_managerById(id string) (e.Item, error)

* * Handler for CRUD data

func GetReqID

func GetReqID(ctx context.Context) string

func RequestLogger

func RequestLogger(f LogFormatter) func(next http.Handler) http.Handler

func StateApi_manager

func StateApi_manager(id, state string) (e.Item, error)

func UpSertApi_manager

func UpSertApi_manager(project, stage, method, path, id string, data e.Json) (e.Item, error)

Types

type DefaultLogFormatter

type DefaultLogFormatter struct {
	Logger  LoggerInterface
	NoColor bool
}

func (*DefaultLogFormatter) NewLogEntry

func (l *DefaultLogFormatter) NewLogEntry(r *http.Request) LogEntry

type Endpoint

type Endpoint struct {
	Ok     bool
	Method string
	Scheme string
	Host   string
	Path   string
	Proto  string
	Header http.Header
	Params []e.Json
	Query  url.Values
	Body   e.Json
}

func FindPath

func FindPath(endpoint *Endpoint) *Endpoint

func (*Endpoint) Define

func (c *Endpoint) Define() e.Json

type LogEntry

type LogEntry interface {
	Write(status, bytes int, header http.Header, elapsed time.Duration, extra interface{})
	Panic(v interface{}, stack []byte)
}

type LogFormatter

type LogFormatter interface {
	NewLogEntry(r *http.Request) LogEntry
}

type LoggerInterface

type LoggerInterface interface {
	Print(v ...interface{})
}

Jump to

Keyboard shortcuts

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