mist

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 7 Imported by: 2

README

Mist middleware

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultManager = &defaultManager

DefaultManager is the default middleware manager

Functions

func FullContext

func FullContext() context.Context

全局context,使用注意时注意暴露安全 TODO: hide from global

func GetWm

func GetWm(name string) interface{}

func NewFuncMyOption

func NewFuncMyOption(n string, f func(Options)) *funcOption

func WriteRuntimeMsg

func WriteRuntimeMsg() string

Types

type ContextKey

type ContextKey string

type Handler

type Handler func(ctx context.Context, req interface{}) (interface{}, error)

type Interceptor

type Interceptor func(ctx context.Context, req interface{}, info *ServerInfo, handler Handler) (interface{}, error)

type MD

type MD map[string][]string

type Manager

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

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) Init

func (m *Manager) Init(opt ...Option)

func (*Manager) Inter

func (m *Manager) Inter() Interceptor

func (*Manager) Register

func (m *Manager) Register(name string, mw Middleware)

func (*Manager) Run

func (m *Manager) Run() error

type Middleware

type Middleware interface {
	Inter(full bool) Interceptor
	Init(opt []Option)
}

type Option

type Option interface {
	Apply(Options)
	Name() string
}

type Options

type Options interface{}

type Runner

type Runner interface {
	Run(ctx context.Context, info *ServerInfo) error
}

type ServerInfo

type ServerInfo struct {
	Server         interface{}
	IsClientStream bool
	IsServerStream bool
	FullMethod     string
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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