文章分类 - Golang
摘要:Table of Contents 目录 Introduction 简介 Getting Started 开始 Data Structures 数据结构 Introducing the net/http package (an interlude) net/http包简介(插曲) Using net
阅读全文
摘要:目录 Prerequisites 前提条件 Design API endpoints 设计API终节点 Create a folder for your code 为你的代码创建文件夹 Create the data 创建数据 Write a handler to return all items
阅读全文
摘要:In this last topic, you'll learn a couple new go commands. While the go run command is a useful shortcut for compiling and running a program when you'
阅读全文
摘要:Now that you've gotten your code to a stable place (nicely done, by the way), add a test. Testing your code during development can expose bugs that fi
阅读全文
摘要:In the last changes you'll make to your module's code, you'll add support for getting greetings for multiple people in one request. In other words, yo
阅读全文
摘要:In this section, you'll change your code so that instead of returning a single greeting every time, it returns one of several predefined greeting mess
阅读全文
摘要:Handling errors is an essential feature of solid code. In this section, you'll add a bit of code to return an error from the greetings module, then ha
阅读全文
摘要:In the previous section, you created a greetings module. In this section, you'll write code to make calls to the Hello function in the module you just
阅读全文
摘要:Table of Contents 目录 Prerequisites 前提条件Start a module that others can use 开始一个其他人可使用的模块 This is the first part of a tutorial that introduces a few fun
阅读全文
摘要:Table of Contents 目录 Prerequisites 前提条件 Install Go 安装Go Write some code 编写一些代码 Call code in an external package 调用外部包的代码 Write more code 编写更多代码 In thi
阅读全文
摘要:Download and install Go quickly with the steps described here. 按照这里说明的步骤可以快速地下载和安装Go。 For other content on installing, you might be interested in: 你可能
阅读全文
摘要:Installing Go 安装Go Instructions for downloading and installing Go. Go的下载和安装指南。 Tutorial: Getting started 教程:入门 A brief Hello, World tutorial to get st
阅读全文
摘要:What is Iris Iris是什么 Please navigate to GitHub Wiki for the complete documentation of the Iris latest stable release. This page is currently under con
阅读全文
摘要:API Versioning 版本控制 The versioning subpackage provides semver versioning for your APIs. All best practice conventions are implemented, including the s
阅读全文
摘要:Middleware 中间件 When we refer to the concept of Middleware within Iris, we're talking about running code before or after our main handler within an HTT
阅读全文
摘要:Blank Iris without middleware by default 无中间件的空白 Iris Use 使用 app := iris.New() instead of 代替 // Default with "debug" Logger Level. // Localization ena
阅读全文
摘要:Grouping routes 分组路由 func main() { app := iris.Default() // Simple group: v1 v1 := app.Party("/v1") { v1.Post("/login", loginEndpoint) v1.Post("/submi
阅读全文
摘要:Upload files 上传文件 Single file 单个文件 const maxSize = 8 * iris.MB func main() { app := iris.Default() app.Post("/upload", func(ctx iris.Context) { // Set
阅读全文
摘要:Query and post form parameters Query和post 表单参数 POST /post?id=a&id=b&id=c&name=john&name=doe&name=kataras Content-Type: application/x-www-form-urlencod
阅读全文
摘要:Another example: query + post form 另一个示例:query+post 表单 POST /post?id=1234&page=1 HTTP/1.1 Content-Type: application/x-www-form-urlencoded name=kataras
阅读全文