xctrl

command module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 6 Imported by: 0

README

xctrl - XSwitch XCC API Go 语言 SDK

小樱桃在用的Go语言SDK 1.1,API更规范,推荐升级。旧的1.0版代码和文档见这里

目录结构:

  • ctrl:节点管理
  • proto:Google Protocol Buffer协议描述
  • tboy 是一个冒牌的的FreeSWITCH,用于测试
  • xctrl:xctrl Go语言SDK生成器,参考自Go Micro框架
  • consitent 多节点一致性hash管理器,用于多个FreeSWITCH的hash节点获取,文档参见hash节点文档

更多文档参见proto/doc

使用和开发

  1. 克隆该项目到本地:
git clone https://git.xswitch.cn/xswitch/xctrl.git
cd xctrl
  1. Protocol Buffers编译器(protoc)
brew install protobuf
  1. 安装protoc-gen-doc依赖:
  • 推荐方式:
make setup  
  • 手动安装:
go install github.com/chuanlinzhang/protoc-gen-doc/cmd/protoc-gen-doc@v0.0.2
  1. 根据需要生成相应语言的代码:
  • 生成Go代码
make proto

  • 生成Java代码
make java

  • 生成HTML文档
make doc-html

  • 生成Markdown文档
make doc-md

测试

go run main.go
make test

开发

channel缓存存取

channel结构可以临时存到内存中,用于获取channel携带参数

type Channel struct {
	xctrl.ChannelEvent
	CtrlUuid string
	lock     sync.RWMutex
	subs     []nats.Subscriber
}

//保存缓存
channel.Save()
//获取缓存中数据
channe.GetVariable("variable_name")

//channel.Save() 保存的变量在内存中,通话结束后需要主动调用函数释放
crtl.DelChannel(channel.uuid)

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
bus
nats
Package nats provides a NATS Conn
Package nats provides a NATS Conn
example
inbound Module
pkg
proto
Package snowflake provides a very simple Twitter snowflake generator and parser.
Package snowflake provides a very simple Twitter snowflake generator and parser.
Package micro is a pluggable framework for microservices
Package micro is a pluggable framework for microservices
api
api/handler
Package handler provides http handlers
Package handler provides http handlers
api/handler/event
Package event provides a handler which publishes an event
Package event provides a handler which publishes an event
api/handler/web
Package web contains the web handler including websocket support
Package web contains the web handler including websocket support
api/resolver
Package resolver resolves a http request to an endpoint
Package resolver resolves a http request to an endpoint
api/resolver/grpc
Package grpc resolves a grpc service like /greeter.Say/Hello to greeter service
Package grpc resolves a grpc service like /greeter.Say/Hello to greeter service
api/resolver/host
Package host resolves using http host
Package host resolves using http host
api/resolver/path
Package path resolves using http path
Package path resolves using http path
api/resolver/vpath
Package vpath resolves using http path and recognised versioned urls
Package vpath resolves using http path and recognised versioned urls
api/router
Package router provides api service routing
Package router provides api service routing
api/router/registry
Package registry provides a dynamic api service router
Package registry provides a dynamic api service router
api/server
Package server provides an API gateway server which handles inbound requests
Package server provides an API gateway server which handles inbound requests
client
Package client is an interface for an RPC client
Package client is an interface for an RPC client
codec
Package codec is an interface for encoding messages
Package codec is an interface for encoding messages
codec/bytes
Package bytes provides a bytes codec which does not encode or decode anything
Package bytes provides a bytes codec which does not encode or decode anything
codec/grpc
Package grpc provides a grpc codec
Package grpc provides a grpc codec
codec/json
Package json provides a json codec
Package json provides a json codec
codec/jsonrpc
Package jsonrpc provides a json-rpc 1.0 codec
Package jsonrpc provides a json-rpc 1.0 codec
codec/proto
Package proto provides a proto codec
Package proto provides a proto codec
codec/protorpc
Package proto is a generated protocol buffer package.
Package proto is a generated protocol buffer package.
codec/text
Package text reads any text/* content-type
Package text reads any text/* content-type
debug/handler
Package handler implements service debug handler embedded in go-micro services
Package handler implements service debug handler embedded in go-micro services
debug/log
Package log provides debug logging
Package log provides debug logging
debug/log/memory
Package memory provides an in memory log buffer
Package memory provides an in memory log buffer
debug/profile
Package profile is for profilers
Package profile is for profilers
debug/profile/http
Package http enables the http profiler
Package http enables the http profiler
debug/profile/pprof
Package pprof provides a pprof profiler
Package pprof provides a pprof profiler
debug/stats
Package stats provides runtime stats
Package stats provides runtime stats
debug/trace
Package trace provides an interface for distributed tracing
Package trace provides an interface for distributed tracing
errors
Package errors provides a way to return detailed information for an RPC request error.
Package errors provides a way to return detailed information for an RPC request error.
logger
Package log provides a log interface
Package log provides a log interface
metadata
Package metadata is a way of defining message headers
Package metadata is a way of defining message headers
server
Package server is an interface for a micro server
Package server is an interface for a micro server
store
Package store is an interface for distribute data storage.
Package store is an interface for distribute data storage.
store/cache
Package cache implements a faulting style read cache on top of multiple micro stores
Package cache implements a faulting style read cache on top of multiple micro stores
store/file
Package local is a file system backed store
Package local is a file system backed store
store/memory
Package memory is a in-memory store store
Package memory is a in-memory store store
sync
Package sync is an interface for distributed synchronization
Package sync is an interface for distributed synchronization
sync/memory
Package memory provides a sync.Mutex implementation of the lock for local use
Package memory provides a sync.Mutex implementation of the lock for local use
util/backoff
Package backoff provides backoff functionality
Package backoff provides backoff functionality
util/log
Package log is a global internal logger
Package log is a global internal logger
util/qson
Package qson implmenets decoding of URL query params into JSON and Go values (using JSON struct tags).
Package qson implmenets decoding of URL query params into JSON and Go values (using JSON struct tags).
util/ring
Package ring provides a simple ring buffer for storing local data
Package ring provides a simple ring buffer for storing local data

Jump to

Keyboard shortcuts

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