diff options
author | Ethan Koenig <etk39@cornell.edu> | 2017-01-24 21:43:02 -0500 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-01-25 10:43:02 +0800 |
commit | 833f8b94c2cd88277eba32984594aad2b7b2b05d (patch) | |
tree | ad197af65043b654f0c64702db707b9335568bd7 /modules | |
parent | 8bc431952f4ae76559054c3a9f41804b145d9230 (diff) | |
download | gitea-833f8b94c2cd88277eba32984594aad2b7b2b05d.tar.gz gitea-833f8b94c2cd88277eba32984594aad2b7b2b05d.zip |
Search bar for issues/pulls (#530)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/indexer/indexer.go | 14 | ||||
-rw-r--r-- | modules/setting/setting.go | 6 | ||||
-rw-r--r-- | modules/util/util.go | 25 |
3 files changed, 45 insertions, 0 deletions
diff --git a/modules/indexer/indexer.go b/modules/indexer/indexer.go new file mode 100644 index 0000000000..2b7b76f7f2 --- /dev/null +++ b/modules/indexer/indexer.go @@ -0,0 +1,14 @@ +// Copyright 2016 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package indexer + +import ( + "code.gitea.io/gitea/models" +) + +// NewContext start indexer service +func NewContext() { + models.InitIssueIndexer() +} diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 910ec93021..fd0f5085c9 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -123,6 +123,12 @@ var ( UsePostgreSQL bool UseTiDB bool + // Indexer settings + Indexer struct { + IssuePath string + UpdateQueueLength int + } + // Webhook settings Webhook = struct { QueueLength int diff --git a/modules/util/util.go b/modules/util/util.go new file mode 100644 index 0000000000..4859965388 --- /dev/null +++ b/modules/util/util.go @@ -0,0 +1,25 @@ +// Copyright 2017 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package util + +// OptionalBool a boolean that can be "null" +type OptionalBool byte + +const ( + // OptionalBoolNone a "null" boolean value + OptionalBoolNone = iota + // OptionalBoolTrue a "true" boolean value + OptionalBoolTrue + // OptionalBoolFalse a "false" boolean value + OptionalBoolFalse +) + +// OptionalBoolOf get the corresponding OptionalBool of a bool +func OptionalBoolOf(b bool) OptionalBool { + if b { + return OptionalBoolTrue + } + return OptionalBoolFalse +} |