eventcar

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: GPL-3.0 Imports: 18 Imported by: 0

README

eventcar

基于SIDECAR模式事件调用的模型

该模型建立基于eventbus的基制进行分布式任务协调处理,以提供多节点的并发逻辑处理能力。 eventcar,基意思是专门处理的event基制交通小汽车

初始化Schema

进入到模型代码库 cd schema

执行命令 protoc --gofast_out=. eventmsg.proto

Documentation

Overview

*

  • =========================================================================== *
  • define all interface in this file
  • =========================================================================== *

Index

Constants

View Source
const (
	PREFIX = "eventcar"

	STATUS_DONE    int8 = 5
	STATUS_RUNNING int8 = 1
	STATUS_CANNEL  int8 = 3

	REQ_TIMEOUT = 3 * time.Second

	// ---- value is for  interface "FutureReturnResult"
	NONE         int8 = 0
	ALL_COMPLETE int8 = 1
	ANY_ERRORS   int8 = 2
	ALL_ERRORS   int8 = 3
)

*

  • --------------------------------- *
  • constant region
  • --------------------------------- *

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

Agent define service bus agent proxy

func NewAgent

func NewAgent(conf *Config) *Agent

NewAgent check agent

func (*Agent) FireByPublish

func (myself *Agent) FireByPublish(eventName string, msgBody []byte, callback ...api.Callback) error

func (*Agent) FireByQueue

func (myself *Agent) FireByQueue(eventName string, msgBody []byte, callback ...api.Callback) error

FireByQueue call by event name and define callback

func (*Agent) On

func (myself *Agent) On(eventName string, fn func(api.ReqMsgContext)) error

On implement event name

func (*Agent) Start

func (myself *Agent) Start()

func (*Agent) Stop

func (myself *Agent) Stop()

type Config

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

Config

func NewConfig

func NewConfig() *Config

func (*Config) CheckBeforeStart

func (myself *Config) CheckBeforeStart() error

func (*Config) SetNatsClientId

func (myself *Config) SetNatsClientId(newClientId string)

func (*Config) SetNatsClusterId

func (myself *Config) SetNatsClusterId(newClusterId string)

func (*Config) SetNatsHost

func (myself *Config) SetNatsHost(hosts []string)

func (*Config) SetNodeIdFilePath

func (myself *Config) SetNodeIdFilePath(nodeIdFilePath string)

func (*Config) SetNodeRoles

func (myself *Config) SetNodeRoles(newRoles []string)

func (*Config) SetRegisterServer

func (myself *Config) SetRegisterServer(config clientv3.Config)

SetRegisterServer define restier servers handle

func (*Config) SetSettingDir

func (myself *Config) SetSettingDir(paths ...string)

Directories

Path Synopsis
* * =========================================================================== * * define all interface in this file * =========================================================================== *
* * =========================================================================== * * define all interface in this file * =========================================================================== *
test

Jump to

Keyboard shortcuts

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