plant

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: MIT Imports: 11 Imported by: 0

README

plant

生产消费者模式

Documentation

Index

Constants

View Source
const MiddlewareName = "plant"

Variables

This section is empty.

Functions

func Consume

func Consume(ctx context.Context, containers ...interface{}) (abstract.OnceSubscription, bool)

Consume 从生产者处消费数据,请不要对指针类型数据进行修改

func KeepConsume

func KeepConsume(ctx context.Context, containers ...interface{}) (abstract.Subscription, bool)

KeepConsume 持续从生产者处消费数据,请不要对指针类型数据进行修改

func Put

func Put(ctx context.Context, material interface{}) error

func RegisterSetUp

func RegisterSetUp(name string, full bool, setUp SetUp)

name the plant name full 是否需要全量权限

Types

type Middleware

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

func (*Middleware) Init

func (m *Middleware) Init(opt []mist.Option)

func (*Middleware) Inter

func (m *Middleware) Inter(full bool) mist.Interceptor

func (*Middleware) Run

func (m *Middleware) Run(ctx context.Context, info *mist.ServerInfo) error

type SetUp

type SetUp func() (productor abstract.Productor, materials []interface{}, product interface{})

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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