Skip to content

Commit

Permalink
Remove protobuf changes
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Mar 13, 2024
1 parent ddd6890 commit de5cf77
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
25 changes: 10 additions & 15 deletions backend/protos/xyz/block/ftl/v1/ftl.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ service VerbService {
rpc Call(CallRequest) returns (CallResponse);
}

message DeploymentName {
string module = 1;
string hash = 2;
}

enum DeploymentChangeType {
DEPLOYMENT_ADDED = 0;
DEPLOYMENT_REMOVED = 1;
Expand All @@ -73,7 +68,7 @@ message GetSchemaResponse {

message PullSchemaRequest {}
message PullSchemaResponse {
DeploymentName deployment_name = 1;
string deployment_name = 1;
string module_name = 2;
// For deletes this will not be present.
optional schema.Module schema = 4;
Expand Down Expand Up @@ -112,13 +107,13 @@ message CreateDeploymentRequest {
optional google.protobuf.Struct labels = 3;
}
message CreateDeploymentResponse {
DeploymentName deployment_name = 1;
string deployment_name = 1;
// Currently active deployment for this module, if any.
optional string active_deployment_name = 2;
}

message GetDeploymentArtefactsRequest {
DeploymentName deployment_name = 1;
string deployment_name = 1;
repeated DeploymentArtefact have_artefacts = 2;
}
message GetDeploymentArtefactsResponse {
Expand All @@ -127,7 +122,7 @@ message GetDeploymentArtefactsResponse {
}

message GetDeploymentRequest {
DeploymentName deployment_name = 1;
string deployment_name = 1;
}
message GetDeploymentResponse {
schema.Module schema = 1;
Expand Down Expand Up @@ -164,7 +159,7 @@ message RegisterRunnerRequest {
message RegisterRunnerResponse {}

message UpdateDeployRequest {
DeploymentName deployment_name = 1;
string deployment_name = 1;
int32 min_replicas = 2;
}
message UpdateDeployResponse {}
Expand All @@ -176,7 +171,7 @@ message ReplaceDeployRequest {
message ReplaceDeployResponse {}

message StreamDeploymentLogsRequest {
DeploymentName deployment_name = 1;
string deployment_name = 1;
optional string request_name = 2;
google.protobuf.Timestamp time_stamp = 3;
int32 log_level = 4;
Expand Down Expand Up @@ -222,7 +217,7 @@ message StatusResponse {
repeated Deployment deployments = 3;

message IngressRoute {
DeploymentName deployment_name = 1;
string deployment_name = 1;
schema.VerbRef verb = 2;
string method = 3;
string path = 4;
Expand Down Expand Up @@ -312,16 +307,16 @@ service ControllerService {
}

message DeployRequest {
DeploymentName deployment_name = 1;
string deployment_name = 1;
}
message DeployResponse {}

message TerminateRequest {
DeploymentName deployment_name = 1;
string deployment_name = 1;
}

message ReserveRequest {
DeploymentName deployment_name = 1;
string deployment_name = 1;
}
message ReserveResponse {}

Expand Down
10 changes: 7 additions & 3 deletions internal/model/deployment_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ import (
"encoding/hex"
"fmt"
"strings"

"github.com/alecthomas/types/optional"
)

type DeploymentName struct {
module string
hash string
}

type MaybeDeploymentName optional.Option[DeploymentName]
// type MaybeDeploymentName optional.Option[DeploymentName]

var _ interface {
sql.Scanner
Expand Down Expand Up @@ -68,10 +66,12 @@ func (d *DeploymentName) UnmarshalText(bytes []byte) error {
}

func (d *DeploymentName) MarshalText() ([]byte, error) {
fmt.Printf("deploymentName.mashalText(): %s\n", d.String())
return []byte(d.String()), nil
}

func (d *DeploymentName) Scan(value any) error {
fmt.Printf("deploymentName.Scan()")
if value == nil {
return nil
}
Expand All @@ -84,5 +84,9 @@ func (d *DeploymentName) Scan(value any) error {
}

func (d *DeploymentName) Value() (driver.Value, error) {
fmt.Printf("deploymentName.value(): %s\n", d.String())
return d.String(), nil
}

var _ sql.Scanner = (*DeploymentName)(nil)
var _ driver.Valuer = (*DeploymentName)(nil)

0 comments on commit de5cf77

Please sign in to comment.