Go语言中文网 为您找到相关结果 1205

【区块链】Tendermint——本机单节点部署

Tendermint 由于工作原因2年前开始接触Hyperledger Fabric,其社区还是很活跃的,已经从当年的v0.7发展到如今v2.0了。但不得不说Fabric的体量还是挺大的,对于二次开发来说有一定难度。所以最近开始转向Tendermint,因为Tendermint更简单、易于理解、性能更高(当然这是Tendermint自己标榜的),不过事实上相对于Fabric确实更易于理解,更方便开发区块链的应用系统。 摘要 Tendermint由两个主要部分组成,一个负责共识,一个负责应用程序接口,共识引擎称作Tendermint Core,应用程序接口称作ABCI(Application BlockChain Interface),利用ABCI可以开发自己业务逻辑。而Tendermint ...阅读全文

博文 2020-04-13 09:32:41 夏洛的克

How would one provide a default interface, defined in terms of itself, to users?

<p>This is basically what I want to do:</p> <pre><code>// Hypothetical checker for seeing if some set of keys are in a SQL DB type Checker interface { KeysInDb(keys []string) ([]bool, error) KeyInDb(key string) (bool, error) } // This is the weird part func (c Checker) KeyInDb(key string) (bool, error) { result...阅读全文

使用Kubernetes正确处理客户端请求

确保所有客户端请求均得到正确处理 让我们从Pod的客户端的剖析(客户端消费Pod提供的服务)的角度来看Pod的生命周期。我们希望确保妥善处理客户端的请求,因为如果在pod启动或关闭时连接开始中断,则很麻烦。 Kubernetes本身并不能保证不会发生这种情况,所以让我们看看我们需要采取什么措施来防止这种情况发生。 在Pod启动时防止客户端连接断开 如果您了解service和service endpoints的工作方式,那么确保在pod启动时正确处理每个连接非常简单。Pod启动后,会将其作为端点添加到对应的服务(Kubernetes 采用了基于标签的服务发现方式,它们的标签选择器与Pod的标签匹配)。Pod还需要向Kubernetes发出信号,表明已经准备好(通过readiness probe...阅读全文

Right Now, 73 Years Ago, Allied Paratroopers Began Gearing Up and Loading Up on C-47's and Gliders Ahead of D-Day, H-Hour...

<p>Unbelievable it&#39;s been 73 years. Never forget the sacrifices. </p> <p>If you enjoy history, please watch HBO&#39;s Band of Brothers. It is a fantastic series that follows the formation of E Company, 506th Parachute Infantry Regiment, 101st Airborne. Currahee! </p> <p><a href="https://youtu.be/...阅读全文

【区块链】Tendermint——本机单节点部署

Tendermint 由于工作原因2年前开始接触Hyperledger Fabric,其社区还是很活跃的,已经从当年的v0.7发展到如今v2.0了。但不得不说Fabric的体量还是挺大的,对于二次开发来说有一定难度。所以最近开始转向Tendermint,因为Tendermint更简单、易于理解、性能更高(当然这是Tendermint自己标榜的),不过事实上相对于Fabric确实更易于理解,更方便开发区块链的应用系统。 摘要 Tendermint由两个主要部分组成,一个负责共识,一个负责应用程序接口,共识引擎称作Tendermint Core,应用程序接口称作ABCI(Application BlockChain Interface),利用ABCI可以开发自己业务逻辑。而Tendermint ...阅读全文

博文 2020-01-29 18:32:38 夏洛克

golang快速入门[2.3]-go语言开发环境配置-linux

golang快速入门[2.3]-go语言开发环境配置-linuxlinux安装Go语言开发包默认读者会使用linux的基本操作配置go语言的开发环境的第一步是要在go官网下载页面下载开发包linux需要下载tar.gz压缩文件这里我们下载的是 64 位的开发包,如果读者的电脑是 32 位系统或者有特殊的需求,则需要下载 32 位的开发包在上图所示页面中向下滚动即可找到 32 位开发包的下载地址,如下图所示注意,如果在ubuntu这样有图形化界面的linux操作系统,我们可以直接下载没有图形化界面时,我们需要在命令行中操作第一步:下载开发包>> wget https://dl.google.com/go/go1.13.7.linux-amd64.tar.gz --2020-02-06 14:1...阅读全文

博文 2020-02-07 19:33:11 jonson_jackson

Has work on Glide ceased?

<p>I&#39;ve just been taking a look at the issues on GitHub to see if other people are experiencing an issue that I am when using Glide, and then realised that the last commit was on the 14th of December last year. I know just over a month doesn&#39;t seem like a long time, but I&#39;d imagine that Glide would be the kind of proje...阅读全文

资源 2018-01-26 04:30:02 xuanbao

Newbie question: How does a golang server compare to NGINX and Apache?

<p>I used Apache in the past, for hosting PHP websites. I know very little about NGINX but from what I understand it&#39;s also a web/mail server. </p> <p>How do most developers use Go on the server, do they install the web server software together with the Go program, or do they use the stdlib http/smtp server? </p> &...阅读全文

offline go dev on windows

<p>Hello! Could anyone share best practice for subj. I have 2 PC. One for internet and one for dev. </p> <p>Internet PC has no admin rights so no installation. Only portable. </p> <p>Dev PC has no Internet connection. But has admin rights. So install Go env, gogland and so - is not problem.</p> <p>Probl...阅读全文

资源 2017-07-20 13:30:21 polaris

24.依赖管理及go module

Go语言的依赖管理随着版本的更迭正逐渐完善起来。 windows开启go module:set GO111MODULE=on Linux开启go module:export GO111MODULE=on 依赖管理 为什么需要依赖管理 最早的时候,Go所依赖的所有的第三方库都放在GOPATH这个目录下面。这就导致了同一个库只能保存一个版本的代码。如果不同的项目依赖同一个第三方的库的不同版本,应该怎么解决? godep Go语言从v1.5开始开始引入vendor模式,如果项目目录下有vendor目录,那么go工具链会优先使用vendor内的包进行编译、测试等。 godep是一个通过vender模式实现的Go语言的第三方依赖管理工具,类似的还有由社区维护准官方包管理工具dep。 安装 执行以下命令...阅读全文

博文 2020-05-05 13:32:44 雪上霜

Is there a good way to tell the optimal number of HTTP requests to make simultaneously?

<p>I&#39;ve written a couple of web crawler-type programs in Go, and whenever I do, I run into the question of how many worker goroutines I should spawn. It has to be limited to keep from exhausting file descriptors, but what is a good limit? I usually just spawn 10 or 20 because those seem to give decent performance, but is there a good ...阅读全文

Should i use Go in this project?

<p>Go is my favorite language by far. I&#39;m building a project to learn new things , it&#39;s a graphql proxy, and i&#39;m in doubt if Go is the best choice or not.</p> <p>The proxy gonna receive a unknow graphql query and do some processing behind the scenes with the response from origin. The problem is that the qu...阅读全文

资源 2017-05-07 10:00:09 xuanbao

图解kubernetes命令执行核心实现

K8s中的命令执行由apiserver、kubelet、cri、docker等组件共同完成, 其中最复杂的就是协议切换以及各种流拷贝相关,让我们一起来看下关键实现,虽然代码比较多,但是不会开发应该也能看懂,祝你好运 1. 基础概念 K8s中的命令执行中有很多协议相关的处理, 我们先一起看下这些协议处理相关的基础概念 1.1 Http协议中的Connection与Upgrade HTTP/1.1中允许在同一个链接上通过Header头中的Connection配合Upgrade来实现协议的转换,简单来说就是允许在通过HTTP建立的链接之上使用其他的协议来进行通信,这也是k8s中命令中实现协议升级的关键 1.2 Http协议中的101状态码 在HTTP协议中除了我们常见的HTTP1.1,还支持web...阅读全文

博文 2020-04-08 14:33:17 仔仔

首发特性:goproxy.cn 现已推出首个 Go 模块代理统计数据 API

前言 这周很值得纪念,首先是 goproxy.cn 已缓存的模块版本总数突破了一百万,这甚至比起 Go 官方的 proxy.golang.org 已缓存的还要多出不少。其次是 goproxy.cn 的日访问量已稳定在千万级,正在朝着亿级进发,目前这在国内我了解到的别的几个同类服务中是最多的了。另外尤为重要的一点是,经过我们的不懈努力,甚至付出了两次事故的代价(详见:status.goproxy.cn),我们终于使得 goproxy.cn 达到了零错误率!现在的 goproxy.cn 可以说是很稳的了,大家可以放心使用。 刚刚在开头稍微为这一个月发生的事情做了个小总结。接下来说一下本次的重点,也就是 goproxy.cn 推出了 Go 模块代理世界中的首个统计数据 API(文档详见:gopro...阅读全文

博文 2020-03-30 23:35:16 煎鱼eddycjy

golang快速入门[2.3]-go语言开发环境配置-linux

linux安装Go语言开发包 默认读者会使用linux的基本操作 配置go语言的开发环境的第一步是要在go官网下载页面下载开发包 linux需要下载tar.gz压缩文件 image 这里我们下载的是 64 位的开发包,如果读者的电脑是 32 位系统或者有特殊的需求,则需要下载 32 位的开发包 在上图所示页面中向下滚动即可找到 32 位开发包的下载地址,如下图所示 image 注意,如果在ubuntu这样有图形化界面的linux操作系统,我们可以直接下载 没有图形化界面时,我们需要在命令行中操作 第一步:下载开发包 >> wget https://dl.google.com/go/go1.13.7.linux-amd64.tar.gz --2020-02-06 14:18:58-- http...阅读全文

博文 2020-02-12 07:32:58 唯识相链2

What's the most idiomatic API example for an enterprise golang server?

<p>&#34;Most idiomatic&#34; is subjective--and that&#39;s fine. What do you think is the most idiomatic golang server example on the internet? I&#39;m wanting to follow idiomatic patterns for the cli (spf13/cobra ?), for logging (logrus ?), for routing (net/http ?), middleware (std lib ?), for dockerizing (from scratch ?) etc....阅读全文

A leftpad fix?

<p>We probably need a community supported mirror for packages.</p> <p>Simplest way that I can think of goes something like this.</p> <p>in Gopkg.toml, add source as the community maintained mirror, like so</p> <p>```</p> <p>[[constraint]]</p> <p>name = &#34;github.com/user/p...阅读全文

资源 2018-02-09 02:30:10 agolangf

What are the non-websever golang projects you have worked on?

<p>Hello, Ive briefly fiddled with golang and really like it so far. I love the simplicity of go routines. I work mostly with large python projects at work and have been thinking of starting to implement go instead. However, most of the projects I read about use go to do web development. I understand that go was designed for that application ...阅读全文

资源 2017-07-14 08:00:23 blov

Mac安装Go环境

一、下载 去Golang官网 )下载需要的版本,这里直接下载苹果版的pkg 二、 安装 直接双击运行pkg,在弹出的安装页面直接安装就行了。 三、测试 输入go version测试go版本。用go env可以查看go环境的变量 默认安装的 GOROOT="/usr/local/go" GOPATH="/Users/admin/go" > go version go version go1.14.3 darwin/amd64 >go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/Users/admin/Library/Caches/go-build" GOENV="/Users/admin/Library/Application Su...阅读全文

博文 2020-05-29 07:32:42 过愙

要获得中间件开发的Offer,难么?

# 前言本文主要是写给那些想从事中间件开发的同学看的 :)如果你没有这个打算,那么本文的学习路线非但不实用,还可能会影响你正常的工作 :)# 什么是中间件开发?随着国内软件行业的发展,国内互联网公司规模越来越大,业务越来越复杂,随之使用大量的中间件来提高后台服务性能。由此产生了中间件开发和维护人员。诚然,在小公司,中间件,例如缓存,MQ,RPC 等服务,极大可能是由业务开发人员自己维护,或者委托第三方云平台运维(支付一些费用)。但,如果后台开发超过 200 人,基本就会组建自己的中间件或者基础架构团队,用于维护后台服务器基础架构和中间件。更大规模的公司,则由于各种各样的原因(性能,KPI),会自己开发中间件,简称自研。这要求中间件团队需要更多的人员。# 中间件开发人员需要哪些素质?既然需要中...阅读全文

博文 2020-04-07 15:32:46 编程的程序员

Golang Summer Internships 2018?

<p>Background: I&#39;m a sophomore and computer science major, and I love working with golang. I worked on a privacy-oriented anonymous authentication proxy last summer in go, and want to continue working in Go.</p> <p>Actual Question: What are some companies/institutions that work in Go, and are looking for interns in the Un...阅读全文

资源 2018-02-26 14:30:13 agolangf

Auto-generating proxy objects

<p>So I&#39;m trying to generate proxy objects to wrap some existing objects. I&#39;d like to create proxies which add logging without having to write the logging in to each of my objects and method calls.</p> <p>I know I can do this by writing a proxy myself, but I have a lot of objects that I don&#39;t want to chan...阅读全文

资源 2018-01-17 14:30:13 blov