bus

package
v0.0.71 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 18 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 AllApimanager added in v0.0.68

func AllApimanager(package_name, 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 DeleteApimanager added in v0.0.68

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

func ExecutePath

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

func GetApimanagerById added in v0.0.68

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

* * Handler for CRUD data

func GetApimanagerByPath added in v0.0.68

func GetApimanagerByPath(method, path string) (e.Item, error)

func GetReqID

func GetReqID(ctx context.Context) string

func RequestLogger

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

func StateApimanager added in v0.0.68

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

func UpSertApimanager added in v0.0.68

func UpSertApimanager(package_name, kind, method, path 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