-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] [Networking] ArangoRotue WebSocket Support (#1759)
- Loading branch information
Showing
14 changed files
with
478 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// DISCLAIMER | ||
// | ||
// Copyright 2024 ArangoDB GmbH, Cologne, Germany | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// Copyright holder is ArangoDB GmbH, Cologne, Germany | ||
// | ||
|
||
package v1alpha1 | ||
|
||
import shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" | ||
|
||
type ArangoRouteSpecOptions struct { | ||
// Upgrade keeps the connection upgrade options | ||
Upgrade ArangoRouteSpecOptionsUpgrade `json:"upgrade,omitempty"` | ||
} | ||
|
||
func (a *ArangoRouteSpecOptions) Validate() error { | ||
if a == nil { | ||
a = &ArangoRouteSpecOptions{} | ||
} | ||
|
||
if err := shared.WithErrors( | ||
shared.ValidateOptionalInterfacePath("upgrade", a.Upgrade), | ||
); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
48 changes: 48 additions & 0 deletions
48
pkg/apis/networking/v1alpha1/route_spec_options_upgrade.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// | ||
// DISCLAIMER | ||
// | ||
// Copyright 2024 ArangoDB GmbH, Cologne, Germany | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// Copyright holder is ArangoDB GmbH, Cologne, Germany | ||
// | ||
|
||
package v1alpha1 | ||
|
||
import shared "github.com/arangodb/kube-arangodb/pkg/apis/shared" | ||
|
||
type ArangoRouteSpecOptionsUpgrade []ArangoRouteSpecOptionUpgrade | ||
|
||
func (a ArangoRouteSpecOptionsUpgrade) Validate() error { | ||
return shared.ValidateInterfaceList(a) | ||
} | ||
|
||
type ArangoRouteSpecOptionUpgrade struct { | ||
// Type defines type of the Upgrade | ||
// +doc/enum: websocket|HTTP WebSocket Upgrade type | ||
Type ArangoRouteUpgradeOptionType `json:"type"` | ||
|
||
// Enabled defines if upgrade option is enabled | ||
Enabled *bool `json:"enabled,omitempty"` | ||
} | ||
|
||
func (a ArangoRouteSpecOptionUpgrade) Validate() error { | ||
if err := shared.WithErrors( | ||
shared.ValidateRequiredInterfacePath("type", a.Type), | ||
); err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// DISCLAIMER | ||
// | ||
// Copyright 2024 ArangoDB GmbH, Cologne, Germany | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// Copyright holder is ArangoDB GmbH, Cologne, Germany | ||
// | ||
|
||
package v1alpha1 | ||
|
||
import "github.com/arangodb/kube-arangodb/pkg/util/errors" | ||
|
||
type ArangoRouteUpgradeOptionType string | ||
|
||
const ( | ||
ArangoRouteUpgradeOptionWebsocket ArangoRouteUpgradeOptionType = "websocket" | ||
) | ||
|
||
func (a ArangoRouteUpgradeOptionType) Validate() error { | ||
switch a { | ||
case ArangoRouteUpgradeOptionWebsocket: | ||
return nil | ||
default: | ||
return errors.Errorf("Invalid UpgradeOptionType: %s", a) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.