-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(gateway): add route and chores for connector
- Loading branch information
1 parent
a9fa47f
commit 54df9ee
Showing
6 changed files
with
303 additions
and
0 deletions.
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,38 @@ | ||
package models | ||
|
||
type ConnectorTLS struct { | ||
// CA is the Certificate Authority used to generate the [Cert] for the server and the client. | ||
CA string `json:"ca" bson:"ca" validate:"required,certPEM"` | ||
// Cert is generated from [CA] certificate and used by the client to authorize the connection to the Docker Engine. | ||
Cert string `json:"cert" bson:"cert" validate:"required,certPEM"` | ||
// Key is the private key for the certificate on [Cert] field. | ||
Key string `json:"key" bson:"key" validate:"required,privateKeyPEM"` | ||
} | ||
|
||
type Connector struct { | ||
// UID is the unique identifier of Connector. | ||
UID string `json:"uid" bson:"uid"` | ||
// TenantID indicate which namespace this connector is related. | ||
TenantID string `json:"tenant_id" bson:"tenant_id"` | ||
// Status shows the connection status for the connector. | ||
Status string `json:"status" bson:"-"` | ||
// Enable indicates if the Connection's connection is enable. | ||
Enable bool `json:"enable" bson:"enable"` | ||
// Secure indicates if the Connector use HTTPS for authentication. | ||
Secure bool `json:"secure" bson:"secure"` | ||
// Address is the address with the port for the Docker Engine. | ||
Address string `json:"address" bson:"address" validate:"required,hostname_port"` | ||
// TLS stores the configuration for authenticate using TLS on the Docker Engine. | ||
TLS *ConnectorTLS `json:"tls,omitempty" bson:"tls,omitempty"` | ||
} | ||
|
||
type ConnectorChanges struct { | ||
// Enable indicates if the Connection's connection is enable. | ||
Enable *bool `json:"enable"` | ||
// Secure indicates if the Connector use HTTPS for authentication. | ||
Secure *bool `json:"secure"` | ||
// Address is the address with the port for the Docker Engine. | ||
Address *string `json:"address" validate:"hostname_port"` | ||
// TLS stores the configuration for authenticate using TLS on the Docker Engine. | ||
TLS *ConnectorTLS `json:"tls"` | ||
} |
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