trinity

package module
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 18 Imported by: 0

README

trinity-micro

cd example/benchmark
go run main.go api

example: https://github.com/PolarPanda611/trinity-micro-example

Documentation

Overview

Author: Daniel TAN Date: 2021-10-02 22:31:49 LastEditors: Daniel TAN LastEditTime: 2021-10-03 23:02:06 FilePath: /trinity-micro/container.go Description:

Author: Daniel TAN Date: 2021-10-18 00:50:02 LastEditors: Daniel TAN LastEditTime: 2021-10-18 01:49:37 FilePath: /trinity-micro/cron.go Description:

Author: Daniel TAN Date: 2021-10-02 00:36:09 LastEditors: Daniel TAN LastEditTime: 2021-12-18 00:11:08 FilePath: /trinity-micro/di_router.go Description:

Author: Daniel TAN Date: 2021-10-02 22:31:03 LastEditors: Daniel TAN LastEditTime: 2021-10-02 22:46:53 FilePath: /trinity-micro/router.go Description:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DIHandler

func DIHandler(container *container.Container, instanceName string, funcName string, isRaw bool) func(w http.ResponseWriter, r *http.Request)

multi instance di handler

func IsFunc added in v0.1.14

func IsFunc(handlerType reflect.Type) bool

func NewCronLogger added in v0.1.6

func NewCronLogger(log logrus.FieldLogger) cron.Logger

func RegisterController

func RegisterController(rootPath string, instanceName string, requestMaps ...RequestMap)

func RegisterInstance

func RegisterInstance(instanceName string, instancePool *sync.Pool)

Types

type Config

type Config struct {
	Mux    mux
	Logger logrus.FieldLogger
}

type RequestMap

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

func NewRawRequestMapping

func NewRawRequestMapping(method string, path string, funcName string, handlers ...func(http.Handler) http.Handler) RequestMap

func NewRequestMapping

func NewRequestMapping(method string, path string, funcName string, handlers ...func(http.Handler) http.Handler) RequestMap

type Trinity

type Trinity struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func Default

func Default() *Trinity

func New

func New(c ...Config) *Trinity

func (*Trinity) AddCronJobs added in v0.1.6

func (t *Trinity) AddCronJobs(resourceName string, spec string, cmd func(srv interface{}), jobNames ...string)

func (*Trinity) Run added in v0.1.14

func (t *Trinity) Run(instanceName string, f interface{}) error

func (*Trinity) ServeHTTP added in v0.1.14

func (t *Trinity) ServeHTTP(addr ...string) error

Directories

Path Synopsis
core
dbx
e
httpx
* @Author: Daniel TAN * @Description: * @Date: 2021-08-06 09:15:58 * @LastEditTime: 2021-09-07 10:46:38 * @LastEditors: Please set LastEditors * @FilePath: /fr-price-common-pkg/core/httpx/parse.go Author: Daniel TAN Date: 2021-09-05 10:24:33 LastEditors: Daniel TAN LastEditTime: 2021-10-03 14:56:13 FilePath: /trinity-micro/core/httpx/response.go Description:
* @Author: Daniel TAN * @Description: * @Date: 2021-08-06 09:15:58 * @LastEditTime: 2021-09-07 10:46:38 * @LastEditors: Please set LastEditors * @FilePath: /fr-price-common-pkg/core/httpx/parse.go Author: Daniel TAN Date: 2021-09-05 10:24:33 LastEditors: Daniel TAN LastEditTime: 2021-10-03 14:56:13 FilePath: /trinity-micro/core/httpx/response.go Description:
utils
* @Author: Daniel TAN * @Description: * @Date: 2021-08-24 11:37:54 * @LastEditTime: 2021-08-24 12:56:19 * @LastEditors: Daniel TAN * @FilePath: /fr-price-common-pkg/core/utils/md5.go * @Author: Daniel TAN * @Description: * @Date: 2021-08-06 10:11:31 * @LastEditTime: 2021-08-26 10:53:30 * @LastEditors: Daniel TAN * @FilePath: /fr-price-common-pkg/core/utils/string_converter.go * @Author: Daniel TAN * @Description: * @Date: 2021-08-18 09:27:53 * @LastEditTime: 2021-08-18 09:28:00 * @LastEditors: Daniel TAN * @FilePath: /fr-price-common-pkg/core/utils/type_converter.go
* @Author: Daniel TAN * @Description: * @Date: 2021-08-24 11:37:54 * @LastEditTime: 2021-08-24 12:56:19 * @LastEditors: Daniel TAN * @FilePath: /fr-price-common-pkg/core/utils/md5.go * @Author: Daniel TAN * @Description: * @Date: 2021-08-06 10:11:31 * @LastEditTime: 2021-08-26 10:53:30 * @LastEditors: Daniel TAN * @FilePath: /fr-price-common-pkg/core/utils/string_converter.go * @Author: Daniel TAN * @Description: * @Date: 2021-08-18 09:27:53 * @LastEditTime: 2021-08-18 09:28:00 * @LastEditors: Daniel TAN * @FilePath: /fr-price-common-pkg/core/utils/type_converter.go
example

Jump to

Keyboard shortcuts

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