上一页 1 ··· 107 108 109 110 111 112 113 114 115 ··· 132 下一页

2018年5月19日

ballerina 学习十六 错误&&异常处理

摘要: ballerina 的error 处理和elxiir 以及rust 比较类似使用模式匹配,但是他的 error lifting 还是比较方便的 同时check 也挺好,异常处理没什么特殊的 throw 以及 throw catch finally 简单例子 error-handling import 阅读全文

posted @ 2018-05-19 23:08 荣锋亮 阅读(224) 评论(0) 推荐(0)

ballerina 学习十五 控制流

摘要: ballerina 的控制流没有什么特殊,只是相比一般语言多了一个模式匹配的操作match ,实际上其他语言(erlang elixir rust 中的模式匹配是很强大的) 简单例子 if/else import ballerina/io; function main(string… args) { 阅读全文

posted @ 2018-05-19 22:48 荣锋亮 阅读(210) 评论(0) 推荐(0)

ballerina 学习十四 values && types

摘要: ballerina 包含的数据类型有string int map array record boolean ojbect function table tuple any 简单说明 数据类型和其他语言相比没有设么特殊的,因为是借鉴了好多中语言其中的table 还是不错(C# datatable) 直 阅读全文

posted @ 2018-05-19 22:35 荣锋亮 阅读(257) 评论(0) 推荐(0)

ballerina 学习十三 函数&&documentation

摘要: ballerina 函数和其他语言一样的,可以实现重用 简单例子 代码 import ballerina/io; documentation { `User` is a user defined object F{{name}} This is the description for the Use 阅读全文

posted @ 2018-05-19 22:18 荣锋亮 阅读(175) 评论(0) 推荐(0)

ballerina 学习十二 变量

摘要: ballerina 有两种方式进行变量的定义,类型加上名称以及初始值。,使用var 关键字 简单例子 代码 import ballerina/io; // 全局public 变量,使用类型定义 public string user="dalong"; function appdemo (string 阅读全文

posted @ 2018-05-19 21:25 荣锋亮 阅读(163) 评论(0) 推荐(0)

ballerina 学习十一 Packages

摘要: ballerina 的包还是比较简单的,实际上就是对于源码文件集合的管理,同时我们可以添加别名,同时可以进行 其他包的引用 import 简单例子 代码 import ballerina/math; import ballerina/io as console; function main(stri 阅读全文

posted @ 2018-05-19 21:14 荣锋亮 阅读(161) 评论(0) 推荐(0)

ballerina 学习十 streams

摘要: ballerina 的streams 使用的是siddhi complex event processing 引擎处理,可以包含的语法有 projection filtering windows join pattern 简单例子 参考代码 import ballerina/io; import b 阅读全文

posted @ 2018-05-19 20:05 荣锋亮 阅读(287) 评论(0) 推荐(0)

2018年5月18日

ballerina 学习九 Client endpoints

摘要: 说白了就是连接外部服务的,可以是http jms websocket 。。。。 简单例子 代码 import ballerina/http; import ballerina/log; endpoint http:Client baiduEP { url:"http://www.baidu.com" 阅读全文

posted @ 2018-05-18 14:38 荣锋亮 阅读(330) 评论(0) 推荐(0)

ballerina 学习八 Parallel( 并行处理)

摘要: 实际上就是并行进行任务的处理 简单例子 代码 import ballerina/io; function main (string… args) { worker first { io:println("first"); } worker second { io:println("second"); 阅读全文

posted @ 2018-05-18 13:51 荣锋亮 阅读(189) 评论(0) 推荐(0)

ballerina 学习七 object 创建&& 初始化

摘要: 在 ballerina 总中object 是一个包含public private 类型字段同时包含函数,需要开发人员进行自定义类型以及行为 说白了,就是类似面向对象的class 基本使用 代码 import ballerina/http; import ballerina/io; type App 阅读全文

posted @ 2018-05-18 13:23 荣锋亮 阅读(202) 评论(0) 推荐(0)

ballerina 学习六 xml && json

摘要: ballerina xml && json 参考使用 代码比较简单,使用起来还是比较方便的 xml 代码说明: import ballerina/io; function main (string… args) { xml person1 = xml `<person><fname>John</fn 阅读全文

posted @ 2018-05-18 10:39 荣锋亮 阅读(280) 评论(0) 推荐(0)

2018年5月14日

ballerina 学习五 使用composer管理ballerina 项目

摘要: 1. 启动 composer 备注: 因为这个命名和php的一个包管理工具重名了,所以可能需要使用决定路径 比如我的mac系统使用:Library/Ballerina/ballerina-0.970.1/bin/composer 2. 参考界面 具体的操作比较简单,就不描述了。 3. 参考资料 ht 阅读全文

posted @ 2018-05-14 16:24 荣锋亮 阅读(301) 评论(0) 推荐(0)

ballerina 学习四 如何进行项目结构规划

摘要: 备注: * ballerina 程序员可以将代码放到一个文件或者一个项目目录 * 一个ballerina program是一个已经编译以及链接的二进制文件 * package是一个包含ballerina 源码文件的目录 * repository是一个版本化的已经编译或者源码 * project自动管 阅读全文

posted @ 2018-05-14 16:03 荣锋亮 阅读(286) 评论(0) 推荐(0)

ballerina 学习三 根据swagger 以及protobuf 生成code

摘要: 备注: 基本环境安装就不用介绍了,swagger 以及grpc 同时也不用介绍了,都是比较简单的代码,就是一个简单的测试 1. 初始化项目 ballerina init 项目结构如下: ├── README.md ├── hello_service.bal ├── swagger.json ├── 阅读全文

posted @ 2018-05-14 11:58 荣锋亮 阅读(666) 评论(0) 推荐(0)

ballerina 学习二 ballerina 命令参数

摘要: 1. 目前支持的命令 run Run Ballerina program build Compile Ballerina program install Install packages to home repository pull Download package from Ballerina 阅读全文

posted @ 2018-05-14 11:29 荣锋亮 阅读(259) 评论(0) 推荐(0)

ballerina 学习一 基本项目安装试用

摘要: ballerina介绍 建议参考这篇文章: https://mp.weixin.qq.com/s/DqdlOhquqMaGOJf26lANPw 1. 安装 直接下载对应操作系统的二进制文件即可,同时官方也提供了linux 操作系统对应的各种发行包(deb, rpm) 参考地址: https://ba 阅读全文

posted @ 2018-05-14 10:07 荣锋亮 阅读(458) 评论(0) 推荐(0)

2018年5月11日

dockerize 容器工具集基本使用

摘要: 基本功能: * 在启动的时候根据环境变量或者模版生成配置文锦啊 * 多日志文件重定向到标准输入输出 * 等待其他服务(tcp,http unix)起来之后在启动主进程 1. 安装 直接使用容器 jwilder/dockerize 或者下载启动 参考安装如下: ENV DOCKERIZE_VERSIO 阅读全文

posted @ 2018-05-11 20:25 荣锋亮 阅读(1088) 评论(0) 推荐(0)

nginx-unit docker 运行以及php &&golang 简单使用

摘要: 备注: nginx unit nginx 开源的新的nginx 开发平台,但是说白了,个人感觉一般,而且官方文档也不是很好, api 接口目前暂时文档比较。。。。,以前写过虚拟机&&物理机安装部署的方式,今天写一个使用docker 进行安装部署的方式,同时添加golang语言的使用,算是比较全了,毕 阅读全文

posted @ 2018-05-11 16:08 荣锋亮 阅读(598) 评论(0) 推荐(0)

2018年5月9日

ffmpeg hls 点播负载均衡简单实现

摘要: 备注: 主要是进行文件的切片处理,以及m3u8 的文件前缀添加以达到通过nginx 或者类似的分布式文件工具进行数据切片处理 参考配置如下: ffmpeg -y -i mydemo.mp4 -vcodec copy -acodec copy -vbsf h264_mp4toannexb appdem 阅读全文

posted @ 2018-05-09 16:20 荣锋亮 阅读(1667) 评论(0) 推荐(0)

nginx grpc 试用

摘要: 1. 编译 wget https://nginx.org/download/nginx-1.13.10.tar.gz tar xvf nginx-1.13.10.tar.gz cd nginx-1.13.10 ./configure --with-http_ssl_module --with-htt 阅读全文

posted @ 2018-05-09 16:15 荣锋亮 阅读(645) 评论(0) 推荐(0)

autoconf 添加三方库(libcurl)简单试用

摘要: 1. 参考项目 https://github.com/rongfengliang/autoconf-project 2. 项目说明 a. 项目结构 ├── Jenkinsfile # jenkins 构建,实际使用可选 ├── Makefile.am ├── README.md ├── autoge 阅读全文

posted @ 2018-05-09 14:24 荣锋亮 阅读(817) 评论(0) 推荐(0)

2018年5月8日

autoconf 简单demo试用

摘要: 1. 安装工具 yum install -y automake 2. 基本项目 a. 项目参考结构 ├── AUTHORS ├── COPYING ├── ChangeLog ├── Makefile.am ├── NEWS ├── README ├── README.md ├── a.out ├─ 阅读全文

posted @ 2018-05-08 14:06 荣锋亮 阅读(312) 评论(0) 推荐(0)

homeland 开源论坛系统搭建试用

摘要: 备注: 需要使用docker docker-compose 1. clone 代码 git clone https://github.com/ruby-china/homeland-docker.git 2. 基本配置 app.local.env 配置例如: app_name=网站名称 domain 阅读全文

posted @ 2018-05-08 12:38 荣锋亮 阅读(967) 评论(0) 推荐(0)

2018年5月7日

mongooseim xmpp 服务器docker 安装试用

摘要: 备注: 预备环境docker xmpp client 1. 启动mongooseim docker run -d -t -h mongooseim-1 --name mongooseim-1 -p 5222:5222 mongooseim/mongooseim:latest 2. 添加测试账户 do 阅读全文

posted @ 2018-05-07 13:32 荣锋亮 阅读(765) 评论(0) 推荐(0)

2018年5月4日

几张 ejabberd 架构部署图

摘要: 阅读全文

posted @ 2018-05-04 12:07 荣锋亮 阅读(513) 评论(0) 推荐(0)

elixir 集成ejabberd

摘要: 备注: 我开发测试的环境时centos 1. 预备环境 1. openssl yum install -y openssl-devel 2. xml yum install -y expat-devel 3. yaml yum install -y libyaml-devel 2. 项目创建 mix 阅读全文

posted @ 2018-05-04 12:03 荣锋亮 阅读(337) 评论(0) 推荐(0)

2018年5月3日

drone 学习六 发布部署&&集成私有容器仓库&&构建代码s3 保存

摘要: 备注: 需要进行drone 以及gitlab 环境的配置,可以参考相关资料 1. 参考项目 https://github.com/rongfengliang/drone-appdemo 2. drone 构建配置(使用docker && s3 插件) pipeline: backend: image 阅读全文

posted @ 2018-05-03 13:21 荣锋亮 阅读(1046) 评论(0) 推荐(0)

hoverfly api 模拟框架了解

摘要: What is Hoverfly? Hoverfly is a lightweight, open source API simulation tool. Using Hoverfly, you can create realistic simulations of the APIs your ap 阅读全文

posted @ 2018-05-03 10:45 荣锋亮 阅读(1050) 评论(0) 推荐(0)

2018年5月2日

drone 学习一 几个核心组件

摘要: 1. clone 这个是内置的,实际上就行进行代码clone的 参考配置,同时我们可以使用自定义的插件 clone: + git: + image: plugins/git pipeline: build: image: golang commands: - go build - go test 2 阅读全文

posted @ 2018-05-02 19:58 荣锋亮 阅读(769) 评论(0) 推荐(0)

drone 学习三 条件步骤

摘要: 1. 基本格式 pipeline: slack: image: plugins/slack channel: dev + when: + branch: master 2. 几种条件类型 a. branch when: branch: [master, develop] b. events when 阅读全文

posted @ 2018-05-02 19:39 荣锋亮 阅读(499) 评论(0) 推荐(0)

drone 学习二 pipeline 说明

摘要: 1. 基本语法 pipeline: backend: image: golang commands: - go build - go test frontend: image: node commands: - npm install - npm run test - npm run build 2 阅读全文

posted @ 2018-05-02 19:30 荣锋亮 阅读(619) 评论(0) 推荐(0)

drone 学习四 几个有用的命令

摘要: 1. 安装cli 工具 linux curl -L https://github.com/drone/drone-cli/releases/download/v0.8.5/drone_linux_amd64.tar.gz | tar zx sudo install -t /usr/local/bin 阅读全文

posted @ 2018-05-02 19:13 荣锋亮 阅读(520) 评论(0) 推荐(0)

drone 学习五 集成gitlab 配置以及简单测试

摘要: 备注: 使用docker-compose 进行安装 同时集成gitlab,预备环境 docker docker-compose gitlab 1. docker-compose version: '3' services: drone-server: image: drone/drone:0.8 p 阅读全文

posted @ 2018-05-02 18:58 荣锋亮 阅读(1085) 评论(0) 推荐(0)

2018年4月30日

ambassador kubernetes native api gateway

摘要: github 上的介绍: Ambassador is an open source Kubernetes-native API Gateway built on Envoy, designed for microservices. Key features include: Self-service 阅读全文

posted @ 2018-04-30 09:48 荣锋亮 阅读(831) 评论(0) 推荐(0)

2018年4月19日

使用distillery 实现版本的动态升级&& 动态降级

摘要: 备注: distillery 使用很棒的elixir 打包构建工具,下面演示的是升级以及降级 1. 参考项目 https://github.com/rongfengliang/phoenix-rest-demo.git 备注: 此项目已经以及配置distillery了,可以参考文档 2. 升级&& 阅读全文

posted @ 2018-04-19 21:18 荣锋亮 阅读(411) 评论(0) 推荐(0)

使用distillery 构建专业的 phoenix 项目软件包

摘要: 备注: 首先需要安装 elixir 环境 1. 基本项目说明 参考项目: https://github.com/rongfengliang/phoenix-rest-demo 2. 项目说明 备注: 主要是插件的配置 mix.exs defp deps do [ {:phoenix, "~> 1.3 阅读全文

posted @ 2018-04-19 19:13 荣锋亮 阅读(440) 评论(0) 推荐(0)

mix deps HEX_HTTP_CONCURRENCY=1 HEX_HTTP_TIMEOUT=120 timeout

摘要: mix deps.get timeout 问题: If this happens consistently, adjust your concurrency and timeout settings: HEX_HTTP_CONCURRENCY=1 HEX_HTTP_TIMEOUT=120 mix d 阅读全文

posted @ 2018-04-19 13:22 荣锋亮 阅读(500) 评论(0) 推荐(0)

elixir jenkins 集成构建方式配置

摘要: 备注: 主要问题是环境变量配置的问题,解决方法是使用软连接进行解决 1. 下载软件包 wget https://github.com/elixir-lang/elixir/releases/download/v1.6.4/Precompiled.zip 2. 配置环境变量 配置环境变量 export 阅读全文

posted @ 2018-04-19 13:10 荣锋亮 阅读(204) 评论(0) 推荐(0)

phoenix 使用activerecord模式框架ecto 访问数据库

摘要: 备注: 需要先安装mysql 以及phoenix 框架,测试使用的是docker 进行安装,具可以参考代码 1. 创建项目 mix phx.new first --database mysql 2. 修改数据库链接 config/dev.exs config :first, First.Repo, 阅读全文

posted @ 2018-04-19 10:56 荣锋亮 阅读(276) 评论(0) 推荐(0)

phoenxi elixir 框架几个方便的命令

摘要: 1. 已有命令 mix app.start # Starts all registered apps mix app.tree # Prints the application tree mix archive # Lists installed archives mix archive.build 阅读全文

posted @ 2018-04-19 10:21 荣锋亮 阅读(437) 评论(0) 推荐(1)

上一页 1 ··· 107 108 109 110 111 112 113 114 115 ··· 132 下一页

导航