aclow

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: MIT Imports: 15 Imported by: 0

README

aclow

Snippets
Jetbrains

Basta clicar em File | Import Settings no menu e selecionar o arquivo em snippets/GoAclow.zip

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Body

func Body(r Message, err error) interface{}

func BodyAsBool

func BodyAsBool(r Message, err error) bool

func BodyAsFloat64

func BodyAsFloat64(r Message, err error) float64

func BodyAsInt64

func BodyAsInt64(r Message, err error) int64

func BodyAsString

func BodyAsString(r Message, err error) string

func GenerateTests

func GenerateTests(src string, dest string)

Types

type App

type App struct {
	Conn      *nats.EncodedConn
	Config    map[string]interface{}
	Resources map[string]interface{}
	NodeMap   map[string]Node
	Logger    Logger
	OnError   func(address string, msg Message, err error)
	// contains filtered or unexported fields
}

func (*App) Call

func (a *App) Call(address string, msg Message) (r Message, err error)

func (*App) Publish

func (a *App) Publish(address string, msg Message)

func (*App) RegisterModule

func (a *App) RegisterModule(moduleName string, nodes []Node)

func (*App) Start

func (a *App) Start(opt StartOptions)

func (*App) Wait

func (a *App) Wait()

type Caller

type Caller = func(a string, d Message) (Message, error)

type Log

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

type Logger

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

type Message

type Message struct {
	Header map[string]interface{}
	Body   interface{}
}

type MockNode

type MockNode struct {
	Tester        *Tester
	MockedModule  string
	MockedAddress string
	Mock          func(Message) (Message, error)
}

func (*MockNode) Address

func (m *MockNode) Address() []string

func (*MockNode) Execute

func (m *MockNode) Execute(msg Message, call Caller) (Message, error)

func (*MockNode) Start

func (m *MockNode) Start(app *App)

type Node

type Node interface {
	Address() []string
	Start(app *App)
	Execute(msg Message, call Caller) (Message, error)
}

type ReplyMessage

type ReplyMessage struct {
	Message
	Err error
}

type StartOptions

type StartOptions struct {
	Local         bool
	Debug         bool
	Host          string
	Port          int
	ClusterPort   int
	ClusterRoutes []*url.URL
}

type TestResource

type TestResource struct {
}

type Tester

type Tester struct {
	App *App
	// contains filtered or unexported fields
}

func (*Tester) Assert

func (t *Tester) Assert(assertFunc func(Message, error))

func (*Tester) Mock

func (t *Tester) Mock(module string, address string, mock func(Message) (Message, error))

func (*Tester) Run

func (t *Tester) Run(msg Message, testing *testing.T)

func (*Tester) Test

func (t *Tester) Test(module string, node Node)

type Tuple

type Tuple []interface{}

Directories

Path Synopsis
cmd
examples

Jump to

Keyboard shortcuts

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