broc

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2021 License: Apache-2.0 Imports: 3 Imported by: 2

README

broc

The RPC Framework which is based on NATS.

License

Licensed under the Apache License

Authors

Copyright(c) 2020 Fred Chien fred@brobridge.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broc

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

func NewBroc

func NewBroc(conn *nats.Conn) *Broc

func (*Broc) Apply

func (broc *Broc) Apply() error

func (*Broc) Register

func (broc *Broc) Register(method string, handlers ...Handler)

func (*Broc) SetPrefix

func (broc *Broc) SetPrefix(prefix string)

func (*Broc) Use

func (broc *Broc) Use(handler Handler)

type Context

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

func NewContext

func NewContext(broc *Broc) *Context

func (*Context) Get

func (ctx *Context) Get(propName string) interface{}

func (*Context) GetMeta

func (ctx *Context) GetMeta() map[string]interface{}

func (*Context) Next

func (ctx *Context) Next() (interface{}, error)

func (*Context) Set

func (ctx *Context) Set(propName string, value interface{})

type Handler

type Handler func(*Context) (interface{}, error)

Jump to

Keyboard shortcuts

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