我的项目树是 $GOPATH/src/gillab.myfirm.ru/golang/rkn
我尝试使用glide来获取依赖关系glide install,但我遇到了一个问题:
[ERROR] Error scanning gitlab.myfirm.ru/golang/rkn/events: cannot find package "." in:
/Users/droot/.glide/cache/src/https-gitlab.myfirm.ru-golang-rkn/events
Run Code Online (Sandbox Code Playgroud)
我不明白滑行到底要我什么。这是什么包装"."?
$GOPATH/src/gitlab.myfirm.ru/golang/rkn/event/events.go 只有4进口
package events
import (
"github.com/streadway/amqp"
log "github.com/Sirupsen/logrus"
"fmt"
"gitlab.myfirm.ru/golang/rkn/config"
)
........
Run Code Online (Sandbox Code Playgroud)
同样的问题,我还有另外4个软件包。
文件夹结构:
project
|
+-coffee
| |
| +-main.coffee
| |
| +-testDir
| | |
| | +-models.coffee
| | |
| | +-views.coffee
| |
| +-anotherDir
| | |
| | +-routes.coffee
| | |
| | +-views.coffee
| | |
| | +-modules.coffee
| |
| +- etc...
|
+-www
Run Code Online (Sandbox Code Playgroud)
这个想法是在将文件coffee/写入目录时将文件夹结构与目录保持一致www/。中可以有任意数量的子文件夹coffee/。.coffee每个文件夹中的所有文件都应该连接到一个modules.js文件中:
www
|
+-modules.js
|
+-testDir
| |
| +-modules.js
|
+-anotherDir
| |
| +-modules.js
| …Run Code Online (Sandbox Code Playgroud) 在文档指南中有例子:
namespace app\controllers;
use yii\rest\ActiveController;
class UserController extends ActiveController
{
public $modelClass = 'app\models\User';
}
Run Code Online (Sandbox Code Playgroud)
但我不明白,如何处理行动.
例如:
DataBase具有多对多关系的表(通过Junction表).
Сomponent根据传输的数据处理模型并从多个表中形成共同响应.可以返回数组或对象数组.
在命令控制器中使用它时,它就像:
class LastTweetsController extends Controller
{
/**
* @param int $count
*
* @throws yii\base\InvalidConfigException
*/
public function actionIndex($count = 10)
{
/** @var TweetLastfinder $tweetLastFinder */
$tweetLastFinder = Yii::$app->get('tweetlastfinder');
/**
* @var TweetShow $tweetShow
*/
$tweetShow = Yii::$app->get('tweetshow');
// For show tweets into terminal:
$tweetShow->showLastTweetsJSON($tweetLastFinder->findLastTweets($count));
}
}
Run Code Online (Sandbox Code Playgroud)
但是我如何在ActiveController中进行相同的操作(传递参数$ count并返回JSON中的结果)?
资源接收参数
例子: http://example.com/show-data?json={"fob":"bar"}
在 GET 请求的情况下,一切都清楚并且运行良好。
urlStr := "http://87.236.22.7:1488/test/show-data"
json := `"foo":"bar"`
r, _ := http.Get(urlStr+`?json=`+json)
println(r.Status)
200 OK
Run Code Online (Sandbox Code Playgroud)
但是在使用 POST 请求时应该怎么做呢?
我试试
urlStr := "http://87.236.22.7:1488/test/show-data"
json := `{"foo":"bar"}`
form := url.Values{}
form.Set("json", json)
println(form.Encode())
post, _ := http.PostForm(urlStr, form)
println(post.Status)
400 Bad Request
json parameter is missing
Run Code Online (Sandbox Code Playgroud)
但它不起作用。
沉迷于汇编程序的学习
mov byte ptr [rax+rdx-01],00
RAX=00000004
RDX=2295EA3B878
Run Code Online (Sandbox Code Playgroud)
和
mov [r10+rsi],al
RAX=0000000000000065
RSI=000002295EA3B878
R10=0000000000000000
Run Code Online (Sandbox Code Playgroud)
很清楚mov al byte ptr。但我不明白什么意思 [rax+rdx-01]和[r10+rsi] rax 和 r10 不是指针。
在大多数情况下,我面临[RAX+C1]rax 是指针而 C1 是偏移量的情况,但是我不知道寄存器存储某些值而不是指针时的含义