Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/blobserve/pkg/config/blobserve.go
2506 views
1
// Copyright (c) 2023 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package blobserve_config
6
7
import "github.com/gitpod-io/gitpod/common-go/util"
8
9
// Config configures a server.
10
type BlobServe struct {
11
Port int `json:"port"`
12
Timeout util.Duration `json:"timeout,omitempty"`
13
Repos map[string]Repo `json:"repos"`
14
// AllowAnyRepo enables users to access any repo/image, irregardles if they're listed in the
15
// ref config or not.
16
AllowAnyRepo bool `json:"allowAnyRepo"`
17
BlobSpace BlobSpace `json:"blobSpace"`
18
}
19
20
type StringReplacement struct {
21
Path string `json:"path"`
22
Search string `json:"search"`
23
Replacement string `json:"replacement"`
24
}
25
26
type InlineReplacement struct {
27
Search string `json:"search"`
28
Replacement string `json:"replacement"`
29
}
30
31
type Repo struct {
32
PrePull []string `json:"prePull,omitempty"`
33
Workdir string `json:"workdir,omitempty"`
34
Replacements []StringReplacement `json:"replacements,omitempty"`
35
InlineStatic []InlineReplacement `json:"inlineStatic,omitempty"`
36
}
37
38
type BlobSpace struct {
39
Location string `json:"location"`
40
MaxSize int64 `json:"maxSizeBytes,omitempty"`
41
}
42
43