首页 \ 问答 \ Google云端存储的搜索功能(Search capabilities with Google Cloud Storage)

Google云端存储的搜索功能(Search capabilities with Google Cloud Storage)

我将使用Google的基础设施来存储文件,而我在Google云端硬盘和Google云端存储之间犹豫不决。 我不认为我会存储大量数据(小于50GB)。 不过,我想通过文件内容(全文)向我的用户提供搜索功能。 我知道它适用于Google云端硬盘SDK https://developers.google.com/drive/search-parameters,但我不确定它适用于Google云端存储文件吗? 我不想强迫我的用户有一个谷歌帐户,他们将能够共享文件给他人,他们将通过我的网站做所有的东西。

还有一个问题,有没有一种方法可以管理Google API的身份(创建/更新用户)? 没有Gmail帐户?

谢谢


I'm going to use Google's infrastructure to store files and I hesitate between Google Drive and Google Cloud Storage. I don't think I'll store a lot of data (less than 50GB). However I would like to offer search functionality through files contents (FULL TEXT) to my users. I know it's available with Google Drive SDK https://developers.google.com/drive/search-parameters but I'm not sure it is for Google Cloud Storage files ? I don't want to force my users to have a google account and they will be able to share files to others, and they will do all their stuff through my web site.

One more question, is there a way to manage identities with a Google API (create/update users) ? without a gmail account ?

thanks


原文:https://stackoverflow.com/questions/16397918
更新时间:2022-08-23 14:08

最满意答案

根据Typescript的规范, “this”指的是方法所属的类的实例。

您可以使用传递给回调的事件对象的target属性:

class foo {
  public test(evt){
    alert($(evt.target).data("id")); // "undefined"
    console.log($(evt.target));
  }
}

或者是event.currentTarget取决于你想获得实际点击的元素还是获取事件的元素。


According to Typescript's spec "this" is referring to the instance of class the method belongs to/is called on.

You could use the target attribute of the event object passed to the callback:

class foo {
  public test(evt){
    alert($(evt.target).data("id")); // "undefined"
    console.log($(evt.target));
  }
}

Or event.currentTarget depending on if you want to get the element actually clicked on or the element which captured the event.

相关问答

更多
  • 根据Typescript的规范, “this”指的是方法所属的类的实例。 您可以使用传递给回调的事件对象的target属性: class foo { public test(evt){ alert($(evt.target).data("id")); // "undefined" console.log($(evt.target)); } } 或者是event.currentTarget取决于你想获得实际点击的元素还是获取事件的元素。 According to Typescript ...
  • 你得到一个运行时错误,因为你没有正确加载JQuery,如果问题出现在那个问题上,那么你会看到编译器错误。 查看现有问题: Uncaught ReferenceError:$未定义? You're getting a runtime error because you haven't loaded JQuery properly, if the issue was with the typings then you would've seen a compiler error. See existing qu ...
  • jQuery插件(和其他基于插件的库)的问题是,您不仅需要基础库的library.d.ts文件,而且还需要每个插件的plugin.d.ts文件。 不知何故,plugin.d.ts文件需要扩展library.d.ts文件中定义的库接口。 幸运的是,TypeScript有一个很漂亮的小功能,可以让你做到这一点。 对于classes ,目前只能在项目中对类进行单一的定义。 所以如果你定义一个class Foo ,你放在class Foo的成员就是你所得到的。 Foo任何其他定义将导致错误。 然而,使用interf ...
  • 所以说没有用于确保一个方法总是被绑定到它的this指针的类型脚本(这不仅仅是一个jQuery问题)。这并不意味着没有一个相当简单的方法来解决这个问题。 您需要的是为您的方法生成代理,以在调用回调之前还原this指针。 然后,在将该代理传递到事件之前,需要将该回调函数包装起来。 jQuery有一个内置的机制,称为jQuery.proxy() 。 以上是使用该方法的上述代码的示例(请注意添加的$.proxy()调用。) class Editor { textarea: JQuery; co ...
  • 我仍然想使用jquery,但我不明白如何将此用法转换为Typescript需要工作的内容。 将该函数移出该类并从该类中调用它。 或者创建一个self变量来同时使用this (class)和this (jquery)。 更多 https://basarat.gitbooks.io/typescript/content/docs/arrow-functions.html#tip-arrow-functions-with-libraries-that-use-this I still want to use jq ...
  • 尝试更改evt:EventTarget以evt:JQuery.Event try changing evt: EventTarget to evt: JQuery.Event
  • 事实证明,从JQuery加载了单独的Event接口。 我开始工作的方式是将事件类型分配给JQuery.Event。 即: import * as $ from 'jquery' export class Test { ele: JQuery; constructor() { this.ele = $('
    Hello World
    '); this.ele.mousedown((evt) => { this.my_mousedown(evt); }); } ...
  • 好的,总结一下你的问题,你试图使用jQuery来挂钩(和取消)DOM元素上的事件,但是你希望事件处理程序的'this'上下文指向包含事件处理程序的类。 有多种方法可以解决这个问题。 首先,您可以使用jQuery.proxy class LoginDialog { public OpenHandler(context: LoginDialog, event: Event, ui: DialogUIParams) { $(window).on("scroll", $.proxy(conte ...
  • 也许做一个更经典的JavaScript方式可以解决它,与功能而不是箭头功能。 var that = this; $('').on('change paste keyup', function() { that.myProperty = $(this).val; that.change(); }).appendTo(result); Maybe do a more classic javas ...
  • 这不是一个错误。 它是一个计划的功能。 这是因为一旦定义了索引器,它也可以用于访问属性,因此属性需要是索引器的子类型。 例如: interface Foo{ [x:string]:number; // Now all properties must be subtypes of number bar:number ; // okay baz:string ; // Error } 试试吧 你可以在这里找到工作的Jquery定义: https : //github.com/b ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)