istio

Форк
0
/
options.go 
58 строк · 1.7 Кб
1
// Copyright Istio Authors
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//     http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15
package wasm
16

17
import (
18
	"time"
19

20
	extensions "istio.io/api/extensions/v1alpha1"
21
	"istio.io/istio/pkg/util/sets"
22
)
23

24
const (
25
	DefaultPurgeInterval         = 1 * time.Hour
26
	DefaultModuleExpiry          = 24 * time.Hour
27
	DefaultHTTPRequestTimeout    = 15 * time.Second
28
	DefaultHTTPRequestMaxRetries = 5
29
)
30

31
// Options contains configurations to create a Cache instance.
32
type Options struct {
33
	PurgeInterval         time.Duration
34
	ModuleExpiry          time.Duration
35
	InsecureRegistries    sets.String
36
	HTTPRequestTimeout    time.Duration
37
	HTTPRequestMaxRetries int
38
}
39

40
func defaultOptions() Options {
41
	return Options{
42
		PurgeInterval:         DefaultPurgeInterval,
43
		ModuleExpiry:          DefaultModuleExpiry,
44
		InsecureRegistries:    sets.New[string](),
45
		HTTPRequestTimeout:    DefaultHTTPRequestTimeout,
46
		HTTPRequestMaxRetries: DefaultHTTPRequestMaxRetries,
47
	}
48
}
49

50
// GetOptions is a struct for providing options to Get method of Cache.
51
type GetOptions struct {
52
	Checksum        string
53
	ResourceName    string
54
	ResourceVersion string
55
	RequestTimeout  time.Duration
56
	PullSecret      []byte
57
	PullPolicy      extensions.PullPolicy
58
}
59

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.