without any theory about serialization i will simply introduce how to quick start using protobuf in golang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Go 15 hrs 59 mins █████████████████▌░░░ 83.4% | |
Thrift 1 hr 31 mins █▋░░░░░░░░░░░░░░░░░░░ 8.0% | |
Other 41 mins ▊░░░░░░░░░░░░░░░░░░░░ 3.6% | |
JSON 32 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.8% | |
Bash 10 mins ▏░░░░░░░░░░░░░░░░░░░░ 0.9% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package strategy | |
import "code.byted.org/gopkg/logs" | |
type Executable interface { | |
Exec() | |
} | |
type Curry struct { | |
ExecIndex int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 闭包更加好嘛 | |
// 就是新手看不懂了 | |
const urls = { | |
getApp: '/api/app/get', | |
delApp: '/api/app/del' | |
} | |
const getAppList = reqWrapper((params) => request.get(urls.getApp, { params }), (res) => { | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="root"> | |
<!-- to be filled --> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
import Vue from "vue"; | |
import axios from "axios"; | |
import router from "../router"; | |
// Full config: https://github.com/axios/axios#request-config | |
// axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || ''; | |
// axios.defaults.headers.common['Authorization'] = AUTH_TOKEN; | |
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; |