From 9c2a0a55fa809a27c1dd8a604eeeede924e781da Mon Sep 17 00:00:00 2001 From: zenghongru Date: Tue, 15 Jun 2021 17:23:58 +0800 Subject: [PATCH] feat: script --- go.mod | 1 + script/tablestore.go | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 3fc3c55..11a6ff3 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/aliyun/aliyun-tablestore-go-sdk/v5 v5.0.6 github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect github.com/gin-gonic/gin v1.7.2 + github.com/golang/protobuf v1.3.3 github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22 github.com/influxdata/influxdb-client-go/v2 v2.4.0 github.com/sirupsen/logrus v1.5.0 diff --git a/script/tablestore.go b/script/tablestore.go index 045894f..b5213a1 100644 --- a/script/tablestore.go +++ b/script/tablestore.go @@ -44,31 +44,31 @@ func InitOTS(env *env.Env) { request.IndexName = idx schemas := []*tablestore.FieldSchema{ - &tablestore.FieldSchema{ + { FieldName: proto.String("profile_type"), FieldType: tablestore.FieldType_KEYWORD, Index: proto.Bool(true), EnableSortAndAgg: proto.Bool(true), }, - &tablestore.FieldSchema{ + { FieldName: proto.String("create_time"), FieldType: tablestore.FieldType_LONG, Index: proto.Bool(true), EnableSortAndAgg: proto.Bool(true), }, - &tablestore.FieldSchema{ + { FieldName: proto.String("service"), FieldType: tablestore.FieldType_KEYWORD, Index: proto.Bool(true), EnableSortAndAgg: proto.Bool(true), }, - &tablestore.FieldSchema{ + { FieldName: proto.String("ip"), FieldType: tablestore.FieldType_KEYWORD, Index: proto.Bool(true), EnableSortAndAgg: proto.Bool(true), }, - &tablestore.FieldSchema{ + { FieldName: proto.String("host"), FieldType: tablestore.FieldType_KEYWORD, Index: proto.Bool(true),