Skip to content

Commit 2fddd2f

Browse files
committed
add ProxyConfig stubs
1 parent c36986f commit 2fddd2f

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

proxy/config.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ type HookOnStartup struct {
146146
Preload []string `yaml:"preload"`
147147
}
148148

149+
type PeerConfig struct {
150+
Name string `yaml:"name"`
151+
Description string `yaml:"description"`
152+
BaseURL string `yaml:"baseURL"`
153+
ApiKey string `yaml:"apikey"`
154+
Priority int `yaml:"priority"`
155+
}
156+
149157
type Config struct {
150158
HealthCheckTimeout int `yaml:"healthCheckTimeout"`
151159
LogRequests bool `yaml:"logRequests"`
@@ -154,6 +162,7 @@ type Config struct {
154162
Models map[string]ModelConfig `yaml:"models"` /* key is model ID */
155163
Profiles map[string][]string `yaml:"profiles"`
156164
Groups map[string]GroupConfig `yaml:"groups"` /* key is group ID */
165+
Peers map[string]PeerConfig `yaml:"peers"` /* key is peer ID */
157166

158167
// for key/value replacements in model's cmd, cmdStop, proxy, checkEndPoint
159168
Macros map[string]string `yaml:"macros"`

proxy/config_posix_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ groups:
148148
persistent: true
149149
members:
150150
- "model4"
151+
peers:
152+
desktop:
153+
name: "Desktop"
154+
description: "runs Linux"
155+
baseURL: "http://10.0.4.11:8080"
156+
apikey: "secret-key"
157+
priority: 10
151158
`
152159

153160
if err := os.WriteFile(tempFile, []byte(content), 0644); err != nil {
@@ -232,6 +239,15 @@ groups:
232239
Members: []string{"model4"},
233240
},
234241
},
242+
Peers: map[string]PeerConfig{
243+
"desktop": {
244+
Name: "Desktop",
245+
Description: "runs Linux",
246+
BaseURL: "http://10.0.4.11:8080",
247+
ApiKey: "secret-key",
248+
Priority: 10,
249+
},
250+
},
235251
}
236252

237253
assert.Equal(t, expected, config)

0 commit comments

Comments
 (0)