istio
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
15package wasm16
17import (18"time"19
20extensions "istio.io/api/extensions/v1alpha1"21"istio.io/istio/pkg/util/sets"22)
23
24const (25DefaultPurgeInterval = 1 * time.Hour26DefaultModuleExpiry = 24 * time.Hour27DefaultHTTPRequestTimeout = 15 * time.Second28DefaultHTTPRequestMaxRetries = 529)
30
31// Options contains configurations to create a Cache instance.
32type Options struct {33PurgeInterval time.Duration34ModuleExpiry time.Duration35InsecureRegistries sets.String36HTTPRequestTimeout time.Duration37HTTPRequestMaxRetries int38}
39
40func defaultOptions() Options {41return Options{42PurgeInterval: DefaultPurgeInterval,43ModuleExpiry: DefaultModuleExpiry,44InsecureRegistries: sets.New[string](),45HTTPRequestTimeout: DefaultHTTPRequestTimeout,46HTTPRequestMaxRetries: DefaultHTTPRequestMaxRetries,47}48}
49
50// GetOptions is a struct for providing options to Get method of Cache.
51type GetOptions struct {52Checksum string53ResourceName string54ResourceVersion string55RequestTimeout time.Duration56PullSecret []byte57PullPolicy extensions.PullPolicy58}
59